diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 68d20180a2..e1c0fbd5b3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,8 +3,6 @@ /agent/runner/ @artemgavrilov @percona/pmm-review-be /api/ @BupycHuk @percona/pmm-review-be /managed/services/checks/ @idoqo @percona/pmm-review-be -/managed/services/dbaas @gen1us2k @recharte @percona/pmm-review-be -/managed/services/management/dbaas @gen1us2k @recharte @percona/pmm-review-be /update/ @BupycHuk @talhabinrizwan @percona/pmm-review-be **/go.mod @percona/pmm-review-dependency @percona/pmm-review-be **/Dockerfile @percona/pmm-review-dependency @percona/pmm-review-be diff --git a/.licenserc.yaml b/.licenserc.yaml index 0db7da52ac..d95dde3469 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -13,9 +13,6 @@ header: - "**/amclient/**" - "**/ammodels/**" - "qan-api2/migrations/**" - - "managed/services/dbaas/kubernetes/client/kubeclient_interface.go" - - "managed/services/dbaas/olm/operator_service_interface.go" - - "managed/services/dbaas/kubernetes/operator_service_interface.go" license: spdx-id: AGPL-3.0-or-later copyright-owner: Percona LLC diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6efdba02c2..e489039ffa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,14 +19,12 @@ This project is built from several repositories: * [percona/pmm](https://github.com/percona/pmm/tree/main/api) * [percona-platform/saas](https://github.com/percona-platform/saas) -* [percona-platform/dbaas-api](https://github.com/percona-platform/dbaas-api) ### PMM Server #### Backends * [percona/pmm-managed](https://github.com/percona/pmm/tree/main/managed) manages configuration of PMM server components (VictoriaMetrics, Grafana, etc.) and exposes API for that. APIs are used by [pmm-admin](https://github.com/percona/pmm/tree/main/admin) -* [percona-platform/dbaas-controller](https://github.com/percona-platform/dbaas-controller) exposes a simplified API for managing Percona Kubernetes Operators. * [percona/qan-api](https://github.com/percona/pmm/tree/main/qan-api2) query analytics API * [percona/pmm-update](https://github.com/percona/pmm/tree/main/update) is a tool for updating packages and OS configuration for PMM diff --git a/Makefile b/Makefile index 858336e987..94c955890f 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,3 @@ TARGET ?= _bash env: ## Run `make TARGET` in devcontainer (`make env TARGET=help`); TARGET defaults to bash COMPOSE_PROFILES=$(PROFILES) \ docker exec -it --workdir=/root/go/src/github.com/percona/pmm pmm-server make $(TARGET) - -update-dbaas-catalog: ## Update the DBaaS catalog from the latest production branch (percona-platform). - wget https://raw.githubusercontent.com/percona/dbaas-catalog/percona-platform/percona-dbaas-catalog.yaml -O managed/data/crds/olm/percona-dbaas-catalog.yaml diff --git a/Makefile.include b/Makefile.include index 7c59505c85..ae9170233f 100644 --- a/Makefile.include +++ b/Makefile.include @@ -9,11 +9,7 @@ help: ## Display this help message @grep -h '^[a-zA-Z]' $(MAKEFILE_LIST) | \ awk -F ':.*?## ' 'NF==2 {printf " %-26s%s\n", $$1, $$2}' @echo - @echo "To test DBaaS components with minikube:" - @echo "Start minikube: minikube start --cpus=2 --nodes=3 --kubernetes-version=v1.20.0" - @echo "ENABLE_DBAAS=1 NETWORK=minikube make env-up" - @echo "DBAAS_ALLOW_UNSUPPORTED_OPERATORS=1 DBAAS_PXC_OP_CHANNEL=fast-v1 ENABLE_DBAAS=1 NETWORK=minikube make env-up" - @echo Check the docker-compose.yml file to see which environment variables are available. + @echo Check the docker-compose.yml file to see which environment variables are available. init: ## Install tools rm -rf bin/* @@ -47,7 +43,7 @@ gen-api: ## Generate PMM API bin/buf generate -v api - for API in api/agentlocalpb api/serverpb api/inventorypb api/managementpb api/managementpb/dbaas api/managementpb/ia api/managementpb/alerting api/managementpb/backup api/managementpb/azure api/managementpb/role api/qanpb api/managementpb/agent api/managementpb/node api/managementpb/service api/platformpb api/userpb; do \ + for API in api/agentlocalpb api/serverpb api/inventorypb api/managementpb api/managementpb/ia api/managementpb/alerting api/managementpb/backup api/managementpb/azure api/managementpb/role api/qanpb api/managementpb/agent api/managementpb/node api/managementpb/service api/platformpb api/userpb; do \ set -x ; \ bin/swagger mixin $$API/json/header.json $$API/*.swagger.json --output=$$API/json/$$(basename $$API).json --keep-spec-order; \ bin/swagger flatten --with-flatten=expand --with-flatten=remove-unused $$API/json/$$(basename $$API).json --output=$$API/json/$$(basename $$API).json ; \ @@ -87,7 +83,6 @@ gen-api: ## Generate PMM API api/userpb/json/userpb.json \ api/inventorypb/json/inventorypb.json \ api/managementpb/json/managementpb.json \ - api/managementpb/dbaas/json/dbaas.json \ api/managementpb/ia/json/ia.json \ api/managementpb/alerting/json/alerting.json \ api/managementpb/backup/json/backup.json \ @@ -127,7 +122,7 @@ clean: clean_swagger ## Remove generated files find api -name '*.pb.gw.go' -print -delete find api -name '*.validate.go' -print -delete - for API in api/agentlocalpb api/serverpb api/inventorypb api/managementpb api/managementpb/dbaas api/managementpb/ia api/managementpb/alerting api/managementpb/backup api/managementpb/role api/managementpb/agent api/managementpb/node api/managementpb/service api/qanpb api/platformpb ; do \ + for API in api/agentlocalpb api/serverpb api/inventorypb api/managementpb api/managementpb/ia api/managementpb/alerting api/managementpb/backup api/managementpb/role api/managementpb/agent api/managementpb/node api/managementpb/service api/qanpb api/platformpb ; do \ rm -fr $$API/json/client $$API/json/models $$API/json/$$(basename $$API).json ; \ done rm -f api/swagger/swagger.json api/swagger/swagger-dev.json diff --git a/api-tests/init.go b/api-tests/init.go index 91490bc281..8dcf91195f 100644 --- a/api-tests/init.go +++ b/api-tests/init.go @@ -40,7 +40,6 @@ import ( inventoryClient "github.com/percona/pmm/api/inventorypb/json/client" alertingClient "github.com/percona/pmm/api/managementpb/alerting/json/client" backupsClient "github.com/percona/pmm/api/managementpb/backup/json/client" - dbaasClient "github.com/percona/pmm/api/managementpb/dbaas/json/client" iaClient "github.com/percona/pmm/api/managementpb/ia/json/client" managementClient "github.com/percona/pmm/api/managementpb/json/client" platformClient "github.com/percona/pmm/api/platformpb/json/client" @@ -220,7 +219,6 @@ func init() { transport.Consumers["application/zip"] = runtime.ByteStreamConsumer() inventoryClient.Default = inventoryClient.New(transport, nil) managementClient.Default = managementClient.New(transport, nil) - dbaasClient.Default = dbaasClient.New(transport, nil) serverClient.Default = serverClient.New(transport, nil) amclient.Default = amclient.New(alertmanagerTransport, nil) iaClient.Default = iaClient.New(transport, nil) diff --git a/api-tests/management/dbaas/helpers.go b/api-tests/management/dbaas/helpers.go deleted file mode 100644 index 9d5fd87694..0000000000 --- a/api-tests/management/dbaas/helpers.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -// Package dbaas contains DBaaS API tests. -package dbaas - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - pmmapitests "github.com/percona/pmm/api-tests" - dbaasClient "github.com/percona/pmm/api/managementpb/dbaas/json/client" - "github.com/percona/pmm/api/managementpb/dbaas/json/client/kubernetes" -) - -func registerKubernetesCluster(t *testing.T, kubernetesClusterName string, kubeconfig string) { - t.Helper() - registerKubernetesClusterResponse, err := dbaasClient.Default.Kubernetes.RegisterKubernetesCluster( - &kubernetes.RegisterKubernetesClusterParams{ - Body: kubernetes.RegisterKubernetesClusterBody{ - KubernetesClusterName: kubernetesClusterName, - KubeAuth: &kubernetes.RegisterKubernetesClusterParamsBodyKubeAuth{Kubeconfig: kubeconfig}, - }, - Context: pmmapitests.Context, - }, - ) - require.NoError(t, err) - assert.NotNil(t, registerKubernetesClusterResponse) - t.Cleanup(func() { - _, _ = unregisterKubernetesCluster(kubernetesClusterName) - }) -} - -func unregisterKubernetesCluster(kubernetesClusterName string) (*kubernetes.UnregisterKubernetesClusterOK, error) { - return dbaasClient.Default.Kubernetes.UnregisterKubernetesCluster( - &kubernetes.UnregisterKubernetesClusterParams{ - Body: kubernetes.UnregisterKubernetesClusterBody{KubernetesClusterName: kubernetesClusterName}, - Context: pmmapitests.Context, - }, - ) -} diff --git a/api-tests/management/dbaas/kubernetes_server_test.go b/api-tests/management/dbaas/kubernetes_server_test.go deleted file mode 100644 index a6c663ab44..0000000000 --- a/api-tests/management/dbaas/kubernetes_server_test.go +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package dbaas - -import ( - "fmt" - "os" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - - pmmapitests "github.com/percona/pmm/api-tests" - dbaasClient "github.com/percona/pmm/api/managementpb/dbaas/json/client" - dbclusters "github.com/percona/pmm/api/managementpb/dbaas/json/client/db_clusters" - "github.com/percona/pmm/api/managementpb/dbaas/json/client/kubernetes" - psmdbclusters "github.com/percona/pmm/api/managementpb/dbaas/json/client/psmdb_clusters" -) - -func TestKubernetesServer(t *testing.T) { - if os.Getenv("PERCONA_TEST_DBAAS") != "1" { - t.Skip("PERCONA_TEST_DBAAS env variable is not passed, skipping") - } - kubeConfig := os.Getenv("PERCONA_TEST_DBAAS_KUBECONFIG") - if kubeConfig == "" { - t.Skip("PERCONA_TEST_DBAAS_KUBECONFIG env variable is not provided") - } - t.Run("Basic", func(t *testing.T) { - kubernetesClusterName := pmmapitests.TestString(t, "api-test-cluster") - clusters, err := dbaasClient.Default.Kubernetes.ListKubernetesClusters(nil) - require.NoError(t, err) - require.NotContains(t, clusters.Payload.KubernetesClusters, - &kubernetes.ListKubernetesClustersOKBodyKubernetesClustersItems0{KubernetesClusterName: kubernetesClusterName}) - - registerKubernetesCluster(t, kubernetesClusterName, kubeConfig) - clusters, err = dbaasClient.Default.Kubernetes.ListKubernetesClusters(nil) - assert.NoError(t, err) - assert.GreaterOrEqual(t, len(clusters.Payload.KubernetesClusters), 1) - assert.Contains(t, clusters.Payload.KubernetesClusters, - &kubernetes.ListKubernetesClustersOKBodyKubernetesClustersItems0{KubernetesClusterName: kubernetesClusterName}) - - unregisterKubernetesClusterResponse, err := dbaasClient.Default.Kubernetes.UnregisterKubernetesCluster( - &kubernetes.UnregisterKubernetesClusterParams{ - Body: kubernetes.UnregisterKubernetesClusterBody{KubernetesClusterName: kubernetesClusterName}, - Context: pmmapitests.Context, - }, - ) - require.NoError(t, err) - assert.NotNil(t, unregisterKubernetesClusterResponse) - - clusters, err = dbaasClient.Default.Kubernetes.ListKubernetesClusters(nil) - assert.NoError(t, err) - require.NotContains(t, clusters.Payload.KubernetesClusters, - &kubernetes.ListKubernetesClustersOKBodyKubernetesClustersItems0{KubernetesClusterName: kubernetesClusterName}) - }) - - t.Run("DuplicateClusterName", func(t *testing.T) { - kubernetesClusterName := pmmapitests.TestString(t, "api-test-cluster-duplicate") - - registerKubernetesCluster(t, kubernetesClusterName, kubeConfig) - registerKubernetesClusterResponse, err := dbaasClient.Default.Kubernetes.RegisterKubernetesCluster( - &kubernetes.RegisterKubernetesClusterParams{ - Body: kubernetes.RegisterKubernetesClusterBody{ - KubernetesClusterName: kubernetesClusterName, - KubeAuth: &kubernetes.RegisterKubernetesClusterParamsBodyKubeAuth{Kubeconfig: kubeConfig}, - }, - Context: pmmapitests.Context, - }, - ) - pmmapitests.AssertAPIErrorf(t, err, 409, codes.AlreadyExists, fmt.Sprintf("Kubernetes Cluster with Name %q already exists.", kubernetesClusterName)) - require.Nil(t, registerKubernetesClusterResponse) - }) - - t.Run("EmptyKubernetesClusterName", func(t *testing.T) { - registerKubernetesClusterResponse, err := dbaasClient.Default.Kubernetes.RegisterKubernetesCluster( - &kubernetes.RegisterKubernetesClusterParams{ - Body: kubernetes.RegisterKubernetesClusterBody{ - KubernetesClusterName: "", - KubeAuth: &kubernetes.RegisterKubernetesClusterParamsBodyKubeAuth{Kubeconfig: kubeConfig}, - }, - Context: pmmapitests.Context, - }, - ) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid field KubernetesClusterName: value '' must not be an empty string") - require.Nil(t, registerKubernetesClusterResponse) - }) - - t.Run("EmptyKubeConfig", func(t *testing.T) { - registerKubernetesClusterResponse, err := dbaasClient.Default.Kubernetes.RegisterKubernetesCluster( - &kubernetes.RegisterKubernetesClusterParams{ - Body: kubernetes.RegisterKubernetesClusterBody{ - KubernetesClusterName: "empty-kube-config", - KubeAuth: &kubernetes.RegisterKubernetesClusterParamsBodyKubeAuth{}, - }, - Context: pmmapitests.Context, - }, - ) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid field KubeAuth.Kubeconfig: value '' must not be an empty string") - require.Nil(t, registerKubernetesClusterResponse) - }) - - t.Run("GetKubernetesCluster", func(t *testing.T) { - kubernetesClusterName := pmmapitests.TestString(t, "api-test-cluster") - registerKubernetesCluster(t, kubernetesClusterName, kubeConfig) - - cluster, err := dbaasClient.Default.Kubernetes.GetKubernetesCluster(&kubernetes.GetKubernetesClusterParams{ - Body: kubernetes.GetKubernetesClusterBody{ - KubernetesClusterName: kubernetesClusterName, - }, - Context: pmmapitests.Context, - }) - assert.NoError(t, err) - assert.NotNil(t, cluster) - assert.NotNil(t, cluster.Payload.KubeAuth) - assert.Equal(t, kubeConfig, cluster.Payload.KubeAuth.Kubeconfig) - }) - - t.Run("GetResources", func(t *testing.T) { - kubernetesClusterName := pmmapitests.TestString(t, "api-test-cluster") - - resources, err := dbaasClient.Default.Kubernetes.GetResources(&kubernetes.GetResourcesParams{ - Body: kubernetes.GetResourcesBody{ - KubernetesClusterName: kubernetesClusterName, - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - require.NotNil(t, resources) - require.NotNil(t, resources.Payload.All) - require.NotNil(t, resources.Payload.Available) - assert.Greater(t, resources.Payload.All.CPUm, resources.Payload.Available.CPUm) - assert.Greater(t, resources.Payload.All.MemoryBytes, resources.Payload.Available.MemoryBytes) - assert.Greater(t, resources.Payload.All.DiskSize, resources.Payload.Available.DiskSize) - assert.Greater(t, resources.Payload.Available.CPUm, uint64(0)) - assert.Greater(t, resources.Payload.Available.MemoryBytes, uint64(0)) - assert.Greater(t, resources.Payload.Available.DiskSize, uint64(0)) - }) - - t.Run("UnregisterNotExistCluster", func(t *testing.T) { - unregisterKubernetesClusterOK, err := unregisterKubernetesCluster("not-exist-cluster") - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Kubernetes Cluster with name \"not-exist-cluster\" not found.") - require.Nil(t, unregisterKubernetesClusterOK) - }) - - t.Run("UnregisterEmptyClusterName", func(t *testing.T) { - unregisterKubernetesClusterOK, err := unregisterKubernetesCluster("") - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid field KubernetesClusterName: value '' must not be an empty string") - require.Nil(t, unregisterKubernetesClusterOK) - }) - - t.Run("UnregisterWithoutAndWithForce", func(t *testing.T) { - kubernetesClusterName := pmmapitests.TestString(t, "api-test-cluster") - dbClusterName := "first-psmdb-test" - clusters, err := dbaasClient.Default.Kubernetes.ListKubernetesClusters(nil) - require.NoError(t, err) - require.NotContains(t, clusters.Payload.KubernetesClusters, - &kubernetes.ListKubernetesClustersOKBodyKubernetesClustersItems0{KubernetesClusterName: kubernetesClusterName}) - registerKubernetesCluster(t, kubernetesClusterName, kubeConfig) - - paramsFirstPSMDB := psmdbclusters.CreatePSMDBClusterParams{ - Context: pmmapitests.Context, - Body: psmdbclusters.CreatePSMDBClusterBody{ - KubernetesClusterName: kubernetesClusterName, - Name: dbClusterName, - Params: &psmdbclusters.CreatePSMDBClusterParamsBodyParams{ - ClusterSize: 3, - Replicaset: &psmdbclusters.CreatePSMDBClusterParamsBodyParamsReplicaset{ - ComputeResources: &psmdbclusters.CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources{ - CPUm: 500, - MemoryBytes: "1000000000", - }, - DiskSize: "1000000000", - }, - }, - }, - } - _, err = dbaasClient.Default.PSMDBClusters.CreatePSMDBCluster(¶msFirstPSMDB) - assert.NoError(t, err) - - clusters, err = dbaasClient.Default.Kubernetes.ListKubernetesClusters(nil) - assert.NoError(t, err) - assert.GreaterOrEqual(t, len(clusters.Payload.KubernetesClusters), 1) - assert.Contains(t, clusters.Payload.KubernetesClusters, - &kubernetes.ListKubernetesClustersOKBodyKubernetesClustersItems0{KubernetesClusterName: kubernetesClusterName}) - - _, err = dbaasClient.Default.Kubernetes.UnregisterKubernetesCluster( - &kubernetes.UnregisterKubernetesClusterParams{ - Body: kubernetes.UnregisterKubernetesClusterBody{ - KubernetesClusterName: kubernetesClusterName, - }, - Context: pmmapitests.Context, - }, - ) - require.Error(t, err) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.FailedPrecondition, fmt.Sprintf(`Kubernetes cluster %s has PSMDB clusters`, kubernetesClusterName)) - - unregisterKubernetesClusterResponse, err := dbaasClient.Default.Kubernetes.UnregisterKubernetesCluster( - &kubernetes.UnregisterKubernetesClusterParams{ - Body: kubernetes.UnregisterKubernetesClusterBody{ - KubernetesClusterName: kubernetesClusterName, - Force: true, - }, - Context: pmmapitests.Context, - }, - ) - require.NoError(t, err) - assert.NotNil(t, unregisterKubernetesClusterResponse) - - _, err = dbaasClient.Default.Kubernetes.UnregisterKubernetesCluster( - &kubernetes.UnregisterKubernetesClusterParams{ - Body: kubernetes.UnregisterKubernetesClusterBody{ - KubernetesClusterName: kubernetesClusterName, - }, - Context: pmmapitests.Context, - }, - ) - require.Error(t, err) - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, fmt.Sprintf(`Kubernetes Cluster with name "%s" not found.`, kubernetesClusterName)) - - registerKubernetesCluster(t, kubernetesClusterName, kubeConfig) - deletePSMDBClusterParamsParam := dbclusters.DeleteDBClusterParams{ - Context: pmmapitests.Context, - Body: dbclusters.DeleteDBClusterBody{ - KubernetesClusterName: kubernetesClusterName, - Name: dbClusterName, - }, - } - _, err = dbaasClient.Default.DBClusters.DeleteDBCluster(&deletePSMDBClusterParamsParam) - assert.NoError(t, err) - - listPSMDBClustersParamsParam := dbclusters.ListDBClustersParams{ - Context: pmmapitests.Context, - Body: dbclusters.ListDBClustersBody{ - KubernetesClusterName: kubernetesClusterName, - }, - } - - for { - psmDBClusters, err := dbaasClient.Default.DBClusters.ListDBClusters(&listPSMDBClustersParamsParam) - assert.NoError(t, err) - if len(psmDBClusters.Payload.PSMDBClusters) == 0 { - break - } - time.Sleep(1 * time.Second) - } - - unregisterKubernetesClusterResponse, err = dbaasClient.Default.Kubernetes.UnregisterKubernetesCluster( - &kubernetes.UnregisterKubernetesClusterParams{ - Body: kubernetes.UnregisterKubernetesClusterBody{ - KubernetesClusterName: kubernetesClusterName, - }, - Context: pmmapitests.Context, - }, - ) - assert.NoError(t, err) - assert.NotNil(t, unregisterKubernetesClusterResponse) - }) -} diff --git a/api-tests/management/dbaas/psmdb_cluster_test.go b/api-tests/management/dbaas/psmdb_cluster_test.go deleted file mode 100644 index 4044fdfd36..0000000000 --- a/api-tests/management/dbaas/psmdb_cluster_test.go +++ /dev/null @@ -1,284 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package dbaas - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - - pmmapitests "github.com/percona/pmm/api-tests" - dbaasClient "github.com/percona/pmm/api/managementpb/dbaas/json/client" - dbclusters "github.com/percona/pmm/api/managementpb/dbaas/json/client/db_clusters" - psmdbclusters "github.com/percona/pmm/api/managementpb/dbaas/json/client/psmdb_clusters" -) - -const ( - psmdbKubernetesClusterName = "api-test-k8s-mongodb-cluster" -) - -//nolint:funlen -func TestPSMDBClusterServer(t *testing.T) { - if pmmapitests.Kubeconfig == "" { - t.Skip("Skip tests of PSMDBClusterServer without kubeconfig") - } - registerKubernetesCluster(t, psmdbKubernetesClusterName, pmmapitests.Kubeconfig) - - t.Run("BasicPSMDBCluster", func(t *testing.T) { - paramsFirstPSMDB := psmdbclusters.CreatePSMDBClusterParams{ - Context: pmmapitests.Context, - Body: psmdbclusters.CreatePSMDBClusterBody{ - KubernetesClusterName: psmdbKubernetesClusterName, - Name: "first-psmdb-test", - Params: &psmdbclusters.CreatePSMDBClusterParamsBodyParams{ - ClusterSize: 3, - Replicaset: &psmdbclusters.CreatePSMDBClusterParamsBodyParamsReplicaset{ - ComputeResources: &psmdbclusters.CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources{ - CPUm: 500, - MemoryBytes: "1000000000", - }, - DiskSize: "1000000000", - }, - }, - }, - } - - _, err := dbaasClient.Default.PSMDBClusters.CreatePSMDBCluster(¶msFirstPSMDB) - assert.NoError(t, err) - // Create one more PSMDB Cluster. - paramsSecondPSMDB := psmdbclusters.CreatePSMDBClusterParams{ - Context: pmmapitests.Context, - Body: psmdbclusters.CreatePSMDBClusterBody{ - KubernetesClusterName: psmdbKubernetesClusterName, - Name: "second-psmdb-test", - Params: &psmdbclusters.CreatePSMDBClusterParamsBodyParams{ - ClusterSize: 1, - Replicaset: &psmdbclusters.CreatePSMDBClusterParamsBodyParamsReplicaset{ - ComputeResources: &psmdbclusters.CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources{ - CPUm: 500, - MemoryBytes: "1000000000", - }, - DiskSize: "1000000000", - }, - }, - }, - } - _, err = dbaasClient.Default.PSMDBClusters.CreatePSMDBCluster(¶msSecondPSMDB) - assert.NoError(t, err) - - listPSMDBClustersParamsParam := dbclusters.ListDBClustersParams{ - Context: pmmapitests.Context, - Body: dbclusters.ListDBClustersBody{ - KubernetesClusterName: psmdbKubernetesClusterName, - }, - } - dbClusters, err := dbaasClient.Default.DBClusters.ListDBClusters(&listPSMDBClustersParamsParam) - assert.NoError(t, err) - - for _, name := range []string{"first-psmdb-test", "second-psmdb-test"} { - foundPSMDB := false - for _, psmdb := range dbClusters.Payload.PSMDBClusters { - if name == psmdb.Name { - foundPSMDB = true - - break - } - } - assert.True(t, foundPSMDB, "Cannot find PSMDB with name %s in cluster list", name) - } - - paramsUpdatePSMDB := psmdbclusters.UpdatePSMDBClusterParams{ - Context: pmmapitests.Context, - Body: psmdbclusters.UpdatePSMDBClusterBody{ - KubernetesClusterName: psmdbKubernetesClusterName, - Name: "second-psmdb-test", - Params: &psmdbclusters.UpdatePSMDBClusterParamsBodyParams{ - ClusterSize: 2, - Replicaset: &psmdbclusters.UpdatePSMDBClusterParamsBodyParamsReplicaset{ - ComputeResources: &psmdbclusters.UpdatePSMDBClusterParamsBodyParamsReplicasetComputeResources{ - CPUm: 2, - MemoryBytes: "128", - }, - }, - }, - }, - } - - _, err = dbaasClient.Default.PSMDBClusters.UpdatePSMDBCluster(¶msUpdatePSMDB) - pmmapitests.AssertAPIErrorf(t, err, 500, codes.Internal, `state is initializing: PSMDB cluster is not ready`) - - for _, psmdb := range dbClusters.Payload.PSMDBClusters { - if psmdb.Name == "" { - continue - } - deletePSMDBClusterParamsParam := dbclusters.DeleteDBClusterParams{ - Context: pmmapitests.Context, - Body: dbclusters.DeleteDBClusterBody{ - KubernetesClusterName: psmdbKubernetesClusterName, - Name: psmdb.Name, - }, - } - _, err := dbaasClient.Default.DBClusters.DeleteDBCluster(&deletePSMDBClusterParamsParam) - assert.NoError(t, err) - } - - cluster, err := dbaasClient.Default.PSMDBClusters.GetPSMDBClusterCredentials(&psmdbclusters.GetPSMDBClusterCredentialsParams{ - Body: psmdbclusters.GetPSMDBClusterCredentialsBody{ - KubernetesClusterName: psmdbKubernetesClusterName, - Name: "second-psmdb-test", - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - assert.Equal(t, cluster.Payload.ConnectionCredentials.Username, "userAdmin") - assert.Equal(t, cluster.Payload.ConnectionCredentials.Host, "second-psmdb-test-rs0.default.svc.cluster.local") - assert.Equal(t, cluster.Payload.ConnectionCredentials.Port, int32(27017)) - assert.Equal(t, cluster.Payload.ConnectionCredentials.Replicaset, "rs0") - assert.NotEmpty(t, cluster.Payload.ConnectionCredentials.Password) - - t.Skip("Skip restart till better implementation. https://jira.percona.com/browse/PMM-6980") - _, err = dbaasClient.Default.DBClusters.RestartDBCluster(&dbclusters.RestartDBClusterParams{ - Body: dbclusters.RestartDBClusterBody{ - KubernetesClusterName: psmdbKubernetesClusterName, - Name: "first-psmdb-test", - }, - Context: pmmapitests.Context, - }) - require.NoError(t, err) - }) - - t.Run("CreatePSMDBClusterEmptyName", func(t *testing.T) { - paramsPSMDBEmptyName := psmdbclusters.CreatePSMDBClusterParams{ - Context: pmmapitests.Context, - Body: psmdbclusters.CreatePSMDBClusterBody{ - KubernetesClusterName: psmdbKubernetesClusterName, - Name: "", - Params: &psmdbclusters.CreatePSMDBClusterParamsBodyParams{ - ClusterSize: 3, - Replicaset: &psmdbclusters.CreatePSMDBClusterParamsBodyParamsReplicaset{ - ComputeResources: &psmdbclusters.CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources{ - CPUm: 1, - MemoryBytes: "64", - }, - }, - }, - }, - } - _, err := dbaasClient.Default.PSMDBClusters.CreatePSMDBCluster(¶msPSMDBEmptyName) - pmmapitests.AssertAPIErrorf(t, err, 400, - codes.InvalidArgument, `invalid field Name: value '' must be a string conforming to regex "^[a-z]([-a-z0-9]*[a-z0-9])?$"`) - }) - - t.Run("CreatePSMDBClusterInvalidName", func(t *testing.T) { - paramsPSMDBInvalidName := psmdbclusters.CreatePSMDBClusterParams{ - Context: pmmapitests.Context, - Body: psmdbclusters.CreatePSMDBClusterBody{ - KubernetesClusterName: psmdbKubernetesClusterName, - Name: "123_asd", - Params: &psmdbclusters.CreatePSMDBClusterParamsBodyParams{ - ClusterSize: 3, - Replicaset: &psmdbclusters.CreatePSMDBClusterParamsBodyParamsReplicaset{ - ComputeResources: &psmdbclusters.CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources{ - CPUm: 1, - MemoryBytes: "64", - }, - }, - }, - }, - } - _, err := dbaasClient.Default.PSMDBClusters.CreatePSMDBCluster(¶msPSMDBInvalidName) - assert.Error(t, err) - pmmapitests.AssertAPIErrorf(t, err, 400, - codes.InvalidArgument, `invalid field Name: value '123_asd' must be a string conforming to regex "^[a-z]([-a-z0-9]*[a-z0-9])?$"`) - }) - - t.Run("ListUnknownCluster", func(t *testing.T) { - listPSMDBClustersParamsParam := dbclusters.ListDBClustersParams{ - Context: pmmapitests.Context, - Body: dbclusters.ListDBClustersBody{ - KubernetesClusterName: "Unknown-kubernetes-cluster-name", - }, - } - _, err := dbaasClient.Default.DBClusters.ListDBClusters(&listPSMDBClustersParamsParam) - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, `Kubernetes Cluster with name "Unknown-kubernetes-cluster-name" not found.`) - }) - - t.Run("RestartUnknownPSMDBCluster", func(t *testing.T) { - restartPSMDBClusterParamsParam := dbclusters.RestartDBClusterParams{ - Context: pmmapitests.Context, - Body: dbclusters.RestartDBClusterBody{ - KubernetesClusterName: psmdbKubernetesClusterName, - Name: "Unknown-psmdb-name", - }, - } - _, err := dbaasClient.Default.DBClusters.RestartDBCluster(&restartPSMDBClusterParamsParam) - require.Error(t, err) - assert.Equal(t, 500, err.(pmmapitests.ErrorResponse).Code()) //nolint:errorlint - }) - - t.Run("DeleteUnknownPSMDBCluster", func(t *testing.T) { - deletePSMDBClusterParamsParam := dbclusters.DeleteDBClusterParams{ - Context: pmmapitests.Context, - Body: dbclusters.DeleteDBClusterBody{ - KubernetesClusterName: psmdbKubernetesClusterName, - Name: "Unknown-psmdb-name", - }, - } - _, err := dbaasClient.Default.DBClusters.DeleteDBCluster(&deletePSMDBClusterParamsParam) - require.Error(t, err) - assert.Equal(t, 500, err.(pmmapitests.ErrorResponse).Code()) //nolint:errorlint - }) - - t.Run("SuspendResumeCluster", func(t *testing.T) { - paramsUpdatePSMDB := psmdbclusters.UpdatePSMDBClusterParams{ - Context: pmmapitests.Context, - Body: psmdbclusters.UpdatePSMDBClusterBody{ - KubernetesClusterName: psmdbKubernetesClusterName, - Name: "second-psmdb-test", - Params: &psmdbclusters.UpdatePSMDBClusterParamsBodyParams{ - Suspend: true, - Resume: true, - }, - }, - } - _, err := dbaasClient.Default.PSMDBClusters.UpdatePSMDBCluster(¶msUpdatePSMDB) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, `resume and suspend cannot be set together`) - }) - - t.Run("GetPSMDBClusterResources", func(t *testing.T) { - paramsPSMDBClusterResources := psmdbclusters.GetPSMDBClusterResourcesParams{ - Context: pmmapitests.Context, - Body: psmdbclusters.GetPSMDBClusterResourcesBody{ - Params: &psmdbclusters.GetPSMDBClusterResourcesParamsBodyParams{ - ClusterSize: 4, - Replicaset: &psmdbclusters.GetPSMDBClusterResourcesParamsBodyParamsReplicaset{ - ComputeResources: &psmdbclusters.GetPSMDBClusterResourcesParamsBodyParamsReplicasetComputeResources{ - CPUm: 2000, - MemoryBytes: "2000000000", - }, - }, - }, - }, - } - resources, err := dbaasClient.Default.PSMDBClusters.GetPSMDBClusterResources(¶msPSMDBClusterResources) - assert.NoError(t, err) - assert.Equal(t, resources.Payload.Expected.MemoryBytes, 16000000000) - assert.Equal(t, resources.Payload.Expected.CPUm, 16000) - assert.Equal(t, resources.Payload.Expected.DiskSize, 14000000000) - }) -} diff --git a/api-tests/management/dbaas/pxc_cluster_test.go b/api-tests/management/dbaas/pxc_cluster_test.go deleted file mode 100644 index c12f3f665c..0000000000 --- a/api-tests/management/dbaas/pxc_cluster_test.go +++ /dev/null @@ -1,323 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package dbaas - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - - pmmapitests "github.com/percona/pmm/api-tests" - dbaasClient "github.com/percona/pmm/api/managementpb/dbaas/json/client" - dbclusters "github.com/percona/pmm/api/managementpb/dbaas/json/client/db_clusters" - pxcclusters "github.com/percona/pmm/api/managementpb/dbaas/json/client/pxc_clusters" -) - -const ( - kubernetesClusterName = "api-test-k8s-cluster" -) - -//nolint:funlen -func TestPXCClusterServer(t *testing.T) { - if pmmapitests.Kubeconfig == "" { - t.Skip("Skip tests of PXCClusterServer without kubeconfig") - } - registerKubernetesCluster(t, kubernetesClusterName, pmmapitests.Kubeconfig) - - t.Run("BasicPXCCluster", func(t *testing.T) { - paramsFirstPXC := pxcclusters.CreatePXCClusterParams{ - Context: pmmapitests.Context, - Body: pxcclusters.CreatePXCClusterBody{ - KubernetesClusterName: kubernetesClusterName, - Name: "first-pxc-test", - Params: &pxcclusters.CreatePXCClusterParamsBodyParams{ - ClusterSize: 3, - Haproxy: &pxcclusters.CreatePXCClusterParamsBodyParamsHaproxy{ - ComputeResources: &pxcclusters.CreatePXCClusterParamsBodyParamsHaproxyComputeResources{ - CPUm: 500, - MemoryBytes: "1000000000", - }, - }, - PXC: &pxcclusters.CreatePXCClusterParamsBodyParamsPXC{ - ComputeResources: &pxcclusters.CreatePXCClusterParamsBodyParamsPXCComputeResources{ - CPUm: 1, - MemoryBytes: "64", - }, - DiskSize: "1000000000", - }, - }, - }, - } - - _, err := dbaasClient.Default.PXCClusters.CreatePXCCluster(¶msFirstPXC) - assert.NoError(t, err) - - // Create one more PXC Cluster. - paramsSecondPXC := pxcclusters.CreatePXCClusterParams{ - Context: pmmapitests.Context, - Body: pxcclusters.CreatePXCClusterBody{ - KubernetesClusterName: kubernetesClusterName, - Name: "second-pxc-test", - Params: &pxcclusters.CreatePXCClusterParamsBodyParams{ - ClusterSize: 1, - Proxysql: &pxcclusters.CreatePXCClusterParamsBodyParamsProxysql{ - ComputeResources: &pxcclusters.CreatePXCClusterParamsBodyParamsProxysqlComputeResources{ - CPUm: 500, - MemoryBytes: "1000000000", - }, - DiskSize: "1000000000", - }, - PXC: &pxcclusters.CreatePXCClusterParamsBodyParamsPXC{ - ComputeResources: &pxcclusters.CreatePXCClusterParamsBodyParamsPXCComputeResources{ - CPUm: 1, - MemoryBytes: "64", - }, - DiskSize: "1000000000", - }, - }, - }, - } - _, err = dbaasClient.Default.PXCClusters.CreatePXCCluster(¶msSecondPXC) - assert.NoError(t, err) - - listPXCClustersParamsParam := dbclusters.ListDBClustersParams{ - Context: pmmapitests.Context, - Body: dbclusters.ListDBClustersBody{ - KubernetesClusterName: kubernetesClusterName, - }, - } - pxcClusters, err := dbaasClient.Default.DBClusters.ListDBClusters(&listPXCClustersParamsParam) - assert.NoError(t, err) - - for _, name := range []string{"first-pxc-test", "second-pxc-test"} { - foundPXC := false - for _, pxc := range pxcClusters.Payload.PXCClusters { - if name == pxc.Name { - foundPXC = true - - break - } - } - assert.True(t, foundPXC, "Cannot find PXC with name %s in cluster list", name) - } - - getPXCClusterParamsParam := pxcclusters.GetPXCClusterCredentialsParams{ - Context: pmmapitests.Context, - Body: pxcclusters.GetPXCClusterCredentialsBody{ - KubernetesClusterName: kubernetesClusterName, - Name: "first-pxc-test", - }, - } - pxcCluster, err := dbaasClient.Default.PXCClusters.GetPXCClusterCredentials(&getPXCClusterParamsParam) - assert.NoError(t, err) - assert.Equal(t, pxcCluster.Payload.ConnectionCredentials.Username, "root") - assert.Equal(t, pxcCluster.Payload.ConnectionCredentials.Host, "first-pxc-test-haproxy") - assert.Equal(t, pxcCluster.Payload.ConnectionCredentials.Port, int32(3306)) - assert.NotEmpty(t, pxcCluster.Payload.ConnectionCredentials.Password) - - paramsUpdatePXC := pxcclusters.UpdatePXCClusterParams{ - Context: pmmapitests.Context, - Body: pxcclusters.UpdatePXCClusterBody{ - KubernetesClusterName: kubernetesClusterName, - Name: "second-pxc-test", - Params: &pxcclusters.UpdatePXCClusterParamsBodyParams{ - ClusterSize: 2, - Proxysql: &pxcclusters.UpdatePXCClusterParamsBodyParamsProxysql{ - ComputeResources: &pxcclusters.UpdatePXCClusterParamsBodyParamsProxysqlComputeResources{ - CPUm: 2, - MemoryBytes: "128", - }, - }, - PXC: &pxcclusters.UpdatePXCClusterParamsBodyParamsPXC{ - ComputeResources: &pxcclusters.UpdatePXCClusterParamsBodyParamsPXCComputeResources{ - CPUm: 2, - MemoryBytes: "128", - }, - }, - }, - }, - } - - _, err = dbaasClient.Default.PXCClusters.UpdatePXCCluster(¶msUpdatePXC) - pmmapitests.AssertAPIErrorf(t, err, 500, codes.Internal, `state is Error: PXC cluster is not ready`) - - for _, pxc := range pxcClusters.Payload.PXCClusters { - if pxc.Name == "" { - continue - } - deletePXCClusterParamsParam := dbclusters.DeleteDBClusterParams{ - Context: pmmapitests.Context, - Body: dbclusters.DeleteDBClusterBody{ - KubernetesClusterName: kubernetesClusterName, - Name: pxc.Name, - }, - } - _, err := dbaasClient.Default.DBClusters.DeleteDBCluster(&deletePXCClusterParamsParam) - assert.NoError(t, err) - } - - t.Skip("Skip restart till better implementation. https://jira.percona.com/browse/PMM-6980") - restartPXCClusterParamsParam := dbclusters.RestartDBClusterParams{ - Context: pmmapitests.Context, - Body: dbclusters.RestartDBClusterBody{ - KubernetesClusterName: kubernetesClusterName, - Name: "first-pxc-test", - }, - } - _, err = dbaasClient.Default.DBClusters.RestartDBCluster(&restartPXCClusterParamsParam) - assert.NoError(t, err) - }) - - t.Run("CreatePXCClusterEmptyName", func(t *testing.T) { - paramsPXCEmptyName := pxcclusters.CreatePXCClusterParams{ - Context: pmmapitests.Context, - Body: pxcclusters.CreatePXCClusterBody{ - KubernetesClusterName: kubernetesClusterName, - Name: "", - Params: &pxcclusters.CreatePXCClusterParamsBodyParams{ - ClusterSize: 1, - Proxysql: &pxcclusters.CreatePXCClusterParamsBodyParamsProxysql{ - ComputeResources: &pxcclusters.CreatePXCClusterParamsBodyParamsProxysqlComputeResources{ - CPUm: 1, - MemoryBytes: "64", - }, - }, - PXC: &pxcclusters.CreatePXCClusterParamsBodyParamsPXC{ - ComputeResources: &pxcclusters.CreatePXCClusterParamsBodyParamsPXCComputeResources{ - CPUm: 1, - MemoryBytes: "64", - }, - }, - }, - }, - } - _, err := dbaasClient.Default.PXCClusters.CreatePXCCluster(¶msPXCEmptyName) - pmmapitests.AssertAPIErrorf(t, err, 400, - codes.InvalidArgument, `invalid field Name: value '' must be a string conforming to regex "^[a-z]([-a-z0-9]*[a-z0-9])?$"`) - }) - - t.Run("CreatePXCClusterInvalidName", func(t *testing.T) { - paramsPXCInvalidName := pxcclusters.CreatePXCClusterParams{ - Context: pmmapitests.Context, - Body: pxcclusters.CreatePXCClusterBody{ - KubernetesClusterName: kubernetesClusterName, - Name: "123_asd", - Params: &pxcclusters.CreatePXCClusterParamsBodyParams{ - ClusterSize: 1, - Proxysql: &pxcclusters.CreatePXCClusterParamsBodyParamsProxysql{ - ComputeResources: &pxcclusters.CreatePXCClusterParamsBodyParamsProxysqlComputeResources{ - CPUm: 1, - MemoryBytes: "64", - }, - }, - PXC: &pxcclusters.CreatePXCClusterParamsBodyParamsPXC{ - ComputeResources: &pxcclusters.CreatePXCClusterParamsBodyParamsPXCComputeResources{ - CPUm: 1, - MemoryBytes: "64", - }, - }, - }, - }, - } - _, err := dbaasClient.Default.PXCClusters.CreatePXCCluster(¶msPXCInvalidName) - pmmapitests.AssertAPIErrorf(t, err, 400, - codes.InvalidArgument, `invalid field Name: value '123_asd' must be a string conforming to regex "^[a-z]([-a-z0-9]*[a-z0-9])?$"`) - }) - - t.Run("ListUnknownCluster", func(t *testing.T) { - listPXCClustersParamsParam := dbclusters.ListDBClustersParams{ - Context: pmmapitests.Context, - Body: dbclusters.ListDBClustersBody{ - KubernetesClusterName: "Unknown-kubernetes-cluster-name", - }, - } - _, err := dbaasClient.Default.DBClusters.ListDBClusters(&listPXCClustersParamsParam) - pmmapitests.AssertAPIErrorf(t, err, 404, - codes.NotFound, `Kubernetes Cluster with name "Unknown-kubernetes-cluster-name" not found.`) - }) - - t.Run("RestartUnknownPXCCluster", func(t *testing.T) { - restartPXCClusterParamsParam := dbclusters.RestartDBClusterParams{ - Context: pmmapitests.Context, - Body: dbclusters.RestartDBClusterBody{ - KubernetesClusterName: kubernetesClusterName, - Name: "Unknown-pxc-name", - }, - } - _, err := dbaasClient.Default.DBClusters.RestartDBCluster(&restartPXCClusterParamsParam) - require.Error(t, err) - assert.Equal(t, 500, err.(pmmapitests.ErrorResponse).Code()) //nolint:errorlint - }) - - t.Run("DeleteUnknownPXCCluster", func(t *testing.T) { - deletePXCClusterParamsParam := dbclusters.DeleteDBClusterParams{ - Context: pmmapitests.Context, - Body: dbclusters.DeleteDBClusterBody{ - KubernetesClusterName: kubernetesClusterName, - Name: "Unknown-pxc-name", - }, - } - _, err := dbaasClient.Default.DBClusters.DeleteDBCluster(&deletePXCClusterParamsParam) - require.Error(t, err) - assert.Equal(t, 500, err.(pmmapitests.ErrorResponse).Code()) //nolint:errorlint - }) - - t.Run("SuspendResumeCluster", func(t *testing.T) { - paramsUpdatePXC := pxcclusters.UpdatePXCClusterParams{ - Context: pmmapitests.Context, - Body: pxcclusters.UpdatePXCClusterBody{ - KubernetesClusterName: kubernetesClusterName, - Name: "second-pxc-test", - Params: &pxcclusters.UpdatePXCClusterParamsBodyParams{ - Suspend: true, - Resume: true, - }, - }, - } - _, err := dbaasClient.Default.PXCClusters.UpdatePXCCluster(¶msUpdatePXC) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, `resume and suspend cannot be set together`) - }) - - t.Run("GetPXCClusterResources", func(t *testing.T) { - paramsPXCClusterResources := pxcclusters.GetPXCClusterResourcesParams{ - Context: pmmapitests.Context, - Body: pxcclusters.GetPXCClusterResourcesBody{ - Params: &pxcclusters.GetPXCClusterResourcesParamsBodyParams{ - ClusterSize: 1, - Proxysql: &pxcclusters.GetPXCClusterResourcesParamsBodyParamsProxysql{ - ComputeResources: &pxcclusters.GetPXCClusterResourcesParamsBodyParamsProxysqlComputeResources{ - CPUm: 1000, - MemoryBytes: "1000000000", - }, - }, - PXC: &pxcclusters.GetPXCClusterResourcesParamsBodyParamsPXC{ - ComputeResources: &pxcclusters.GetPXCClusterResourcesParamsBodyParamsPXCComputeResources{ - CPUm: 1000, - MemoryBytes: "1000000000", - }, - }, - }, - }, - } - resources, err := dbaasClient.Default.PXCClusters.GetPXCClusterResources(¶msPXCClusterResources) - assert.NoError(t, err) - assert.Equal(t, resources.Payload.Expected.MemoryBytes, 2000000000) - assert.Equal(t, resources.Payload.Expected.CPUm, 2000) - assert.Equal(t, resources.Payload.Expected.DiskSize, 2000000000) - }) -} diff --git a/api-tests/server/logs_test.go b/api-tests/server/logs_test.go index 5c4585836c..0cd981ec0b 100644 --- a/api-tests/server/logs_test.go +++ b/api-tests/server/logs_test.go @@ -18,7 +18,6 @@ package server import ( "archive/zip" "bytes" - "os" "sort" "strings" "testing" @@ -84,11 +83,6 @@ func TestDownloadLogs(t *testing.T) { "vmproxy.log", } - if os.Getenv("PERCONA_TEST_DBAAS") == "1" { - expected = append(expected, "dbaas-controller.log") - sort.Strings(expected) - } - actual := make([]string, 0, len(zipR.File)) for _, file := range zipR.File { // skip with dynamic IDs now @TODO use regex to match ~ "client/pmm-agent/NODE_EXPORTER 297b465c-a767-4bc5-809d-d394a83c7086.log" diff --git a/api/managementpb/dbaas/components.pb.go b/api/managementpb/dbaas/components.pb.go deleted file mode 100644 index cbdfd6c57d..0000000000 --- a/api/managementpb/dbaas/components.pb.go +++ /dev/null @@ -1,1775 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: managementpb/dbaas/components.proto - -package dbaasv1beta1 - -import ( - reflect "reflect" - sync "sync" - - _ "github.com/envoyproxy/protoc-gen-validate/validate" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Component contains information about component. -type Component struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ImagePath string `protobuf:"bytes,1,opt,name=image_path,json=imagePath,proto3" json:"image_path,omitempty"` - ImageHash string `protobuf:"bytes,2,opt,name=image_hash,json=imageHash,proto3" json:"image_hash,omitempty"` - Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` - Critical bool `protobuf:"varint,4,opt,name=critical,proto3" json:"critical,omitempty"` - Default bool `protobuf:"varint,5,opt,name=default,proto3" json:"default,omitempty"` - Disabled bool `protobuf:"varint,6,opt,name=disabled,proto3" json:"disabled,omitempty"` -} - -func (x *Component) Reset() { - *x = Component{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Component) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Component) ProtoMessage() {} - -func (x *Component) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Component.ProtoReflect.Descriptor instead. -func (*Component) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{0} -} - -func (x *Component) GetImagePath() string { - if x != nil { - return x.ImagePath - } - return "" -} - -func (x *Component) GetImageHash() string { - if x != nil { - return x.ImageHash - } - return "" -} - -func (x *Component) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -func (x *Component) GetCritical() bool { - if x != nil { - return x.Critical - } - return false -} - -func (x *Component) GetDefault() bool { - if x != nil { - return x.Default - } - return false -} - -func (x *Component) GetDisabled() bool { - if x != nil { - return x.Disabled - } - return false -} - -// Matrix contains all available components. -type Matrix struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Mongod map[string]*Component `protobuf:"bytes,1,rep,name=mongod,proto3" json:"mongod,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Pxc map[string]*Component `protobuf:"bytes,2,rep,name=pxc,proto3" json:"pxc,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Pmm map[string]*Component `protobuf:"bytes,3,rep,name=pmm,proto3" json:"pmm,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Proxysql map[string]*Component `protobuf:"bytes,4,rep,name=proxysql,proto3" json:"proxysql,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Haproxy map[string]*Component `protobuf:"bytes,5,rep,name=haproxy,proto3" json:"haproxy,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Backup map[string]*Component `protobuf:"bytes,6,rep,name=backup,proto3" json:"backup,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Operator map[string]*Component `protobuf:"bytes,7,rep,name=operator,proto3" json:"operator,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - LogCollector map[string]*Component `protobuf:"bytes,8,rep,name=log_collector,json=logCollector,proto3" json:"log_collector,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *Matrix) Reset() { - *x = Matrix{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Matrix) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Matrix) ProtoMessage() {} - -func (x *Matrix) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Matrix.ProtoReflect.Descriptor instead. -func (*Matrix) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{1} -} - -func (x *Matrix) GetMongod() map[string]*Component { - if x != nil { - return x.Mongod - } - return nil -} - -func (x *Matrix) GetPxc() map[string]*Component { - if x != nil { - return x.Pxc - } - return nil -} - -func (x *Matrix) GetPmm() map[string]*Component { - if x != nil { - return x.Pmm - } - return nil -} - -func (x *Matrix) GetProxysql() map[string]*Component { - if x != nil { - return x.Proxysql - } - return nil -} - -func (x *Matrix) GetHaproxy() map[string]*Component { - if x != nil { - return x.Haproxy - } - return nil -} - -func (x *Matrix) GetBackup() map[string]*Component { - if x != nil { - return x.Backup - } - return nil -} - -func (x *Matrix) GetOperator() map[string]*Component { - if x != nil { - return x.Operator - } - return nil -} - -func (x *Matrix) GetLogCollector() map[string]*Component { - if x != nil { - return x.LogCollector - } - return nil -} - -// OperatorVersion contains information about operator and components matrix. -type OperatorVersion struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Product string `protobuf:"bytes,1,opt,name=product,proto3" json:"product,omitempty"` - Operator string `protobuf:"bytes,2,opt,name=operator,proto3" json:"operator,omitempty"` - Matrix *Matrix `protobuf:"bytes,3,opt,name=matrix,proto3" json:"matrix,omitempty"` -} - -func (x *OperatorVersion) Reset() { - *x = OperatorVersion{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OperatorVersion) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OperatorVersion) ProtoMessage() {} - -func (x *OperatorVersion) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OperatorVersion.ProtoReflect.Descriptor instead. -func (*OperatorVersion) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{2} -} - -func (x *OperatorVersion) GetProduct() string { - if x != nil { - return x.Product - } - return "" -} - -func (x *OperatorVersion) GetOperator() string { - if x != nil { - return x.Operator - } - return "" -} - -func (x *OperatorVersion) GetMatrix() *Matrix { - if x != nil { - return x.Matrix - } - return nil -} - -type GetPSMDBComponentsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - // Version of DB. - DbVersion string `protobuf:"bytes,2,opt,name=db_version,json=dbVersion,proto3" json:"db_version,omitempty"` -} - -func (x *GetPSMDBComponentsRequest) Reset() { - *x = GetPSMDBComponentsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPSMDBComponentsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPSMDBComponentsRequest) ProtoMessage() {} - -func (x *GetPSMDBComponentsRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPSMDBComponentsRequest.ProtoReflect.Descriptor instead. -func (*GetPSMDBComponentsRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{3} -} - -func (x *GetPSMDBComponentsRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *GetPSMDBComponentsRequest) GetDbVersion() string { - if x != nil { - return x.DbVersion - } - return "" -} - -type GetPSMDBComponentsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Versions []*OperatorVersion `protobuf:"bytes,1,rep,name=versions,proto3" json:"versions,omitempty"` -} - -func (x *GetPSMDBComponentsResponse) Reset() { - *x = GetPSMDBComponentsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPSMDBComponentsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPSMDBComponentsResponse) ProtoMessage() {} - -func (x *GetPSMDBComponentsResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPSMDBComponentsResponse.ProtoReflect.Descriptor instead. -func (*GetPSMDBComponentsResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{4} -} - -func (x *GetPSMDBComponentsResponse) GetVersions() []*OperatorVersion { - if x != nil { - return x.Versions - } - return nil -} - -type GetPXCComponentsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - // Version of DB. - DbVersion string `protobuf:"bytes,2,opt,name=db_version,json=dbVersion,proto3" json:"db_version,omitempty"` -} - -func (x *GetPXCComponentsRequest) Reset() { - *x = GetPXCComponentsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPXCComponentsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPXCComponentsRequest) ProtoMessage() {} - -func (x *GetPXCComponentsRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPXCComponentsRequest.ProtoReflect.Descriptor instead. -func (*GetPXCComponentsRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{5} -} - -func (x *GetPXCComponentsRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *GetPXCComponentsRequest) GetDbVersion() string { - if x != nil { - return x.DbVersion - } - return "" -} - -type GetPXCComponentsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Versions []*OperatorVersion `protobuf:"bytes,1,rep,name=versions,proto3" json:"versions,omitempty"` -} - -func (x *GetPXCComponentsResponse) Reset() { - *x = GetPXCComponentsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPXCComponentsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPXCComponentsResponse) ProtoMessage() {} - -func (x *GetPXCComponentsResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPXCComponentsResponse.ProtoReflect.Descriptor instead. -func (*GetPXCComponentsResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{6} -} - -func (x *GetPXCComponentsResponse) GetVersions() []*OperatorVersion { - if x != nil { - return x.Versions - } - return nil -} - -// ChangeComponent contains fields to manage components. -type ChangeComponent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - DefaultVersion string `protobuf:"bytes,1,opt,name=default_version,json=defaultVersion,proto3" json:"default_version,omitempty"` - Versions []*ChangeComponent_ComponentVersion `protobuf:"bytes,2,rep,name=versions,proto3" json:"versions,omitempty"` -} - -func (x *ChangeComponent) Reset() { - *x = ChangeComponent{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ChangeComponent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeComponent) ProtoMessage() {} - -func (x *ChangeComponent) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ChangeComponent.ProtoReflect.Descriptor instead. -func (*ChangeComponent) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{7} -} - -func (x *ChangeComponent) GetDefaultVersion() string { - if x != nil { - return x.DefaultVersion - } - return "" -} - -func (x *ChangeComponent) GetVersions() []*ChangeComponent_ComponentVersion { - if x != nil { - return x.Versions - } - return nil -} - -type ChangePSMDBComponentsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - Mongod *ChangeComponent `protobuf:"bytes,2,opt,name=mongod,proto3" json:"mongod,omitempty"` -} - -func (x *ChangePSMDBComponentsRequest) Reset() { - *x = ChangePSMDBComponentsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ChangePSMDBComponentsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangePSMDBComponentsRequest) ProtoMessage() {} - -func (x *ChangePSMDBComponentsRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ChangePSMDBComponentsRequest.ProtoReflect.Descriptor instead. -func (*ChangePSMDBComponentsRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{8} -} - -func (x *ChangePSMDBComponentsRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *ChangePSMDBComponentsRequest) GetMongod() *ChangeComponent { - if x != nil { - return x.Mongod - } - return nil -} - -type ChangePSMDBComponentsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ChangePSMDBComponentsResponse) Reset() { - *x = ChangePSMDBComponentsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ChangePSMDBComponentsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangePSMDBComponentsResponse) ProtoMessage() {} - -func (x *ChangePSMDBComponentsResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ChangePSMDBComponentsResponse.ProtoReflect.Descriptor instead. -func (*ChangePSMDBComponentsResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{9} -} - -type ChangePXCComponentsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - Pxc *ChangeComponent `protobuf:"bytes,2,opt,name=pxc,proto3" json:"pxc,omitempty"` - Proxysql *ChangeComponent `protobuf:"bytes,3,opt,name=proxysql,proto3" json:"proxysql,omitempty"` - Haproxy *ChangeComponent `protobuf:"bytes,4,opt,name=haproxy,proto3" json:"haproxy,omitempty"` -} - -func (x *ChangePXCComponentsRequest) Reset() { - *x = ChangePXCComponentsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ChangePXCComponentsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangePXCComponentsRequest) ProtoMessage() {} - -func (x *ChangePXCComponentsRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ChangePXCComponentsRequest.ProtoReflect.Descriptor instead. -func (*ChangePXCComponentsRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{10} -} - -func (x *ChangePXCComponentsRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *ChangePXCComponentsRequest) GetPxc() *ChangeComponent { - if x != nil { - return x.Pxc - } - return nil -} - -func (x *ChangePXCComponentsRequest) GetProxysql() *ChangeComponent { - if x != nil { - return x.Proxysql - } - return nil -} - -func (x *ChangePXCComponentsRequest) GetHaproxy() *ChangeComponent { - if x != nil { - return x.Haproxy - } - return nil -} - -type ChangePXCComponentsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ChangePXCComponentsResponse) Reset() { - *x = ChangePXCComponentsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ChangePXCComponentsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangePXCComponentsResponse) ProtoMessage() {} - -func (x *ChangePXCComponentsResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ChangePXCComponentsResponse.ProtoReflect.Descriptor instead. -func (*ChangePXCComponentsResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{11} -} - -type InstallOperatorRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - // operator_type tells what operator we are interested in updating. - OperatorType string `protobuf:"bytes,2,opt,name=operator_type,json=operatorType,proto3" json:"operator_type,omitempty"` - // version tells what version of the operator we should update to. - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *InstallOperatorRequest) Reset() { - *x = InstallOperatorRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InstallOperatorRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InstallOperatorRequest) ProtoMessage() {} - -func (x *InstallOperatorRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InstallOperatorRequest.ProtoReflect.Descriptor instead. -func (*InstallOperatorRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{12} -} - -func (x *InstallOperatorRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *InstallOperatorRequest) GetOperatorType() string { - if x != nil { - return x.OperatorType - } - return "" -} - -func (x *InstallOperatorRequest) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -type InstallOperatorResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Status tells if installation was successfull. - Status OperatorsStatus `protobuf:"varint,1,opt,name=status,proto3,enum=dbaas.v1beta1.OperatorsStatus" json:"status,omitempty"` -} - -func (x *InstallOperatorResponse) Reset() { - *x = InstallOperatorResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InstallOperatorResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InstallOperatorResponse) ProtoMessage() {} - -func (x *InstallOperatorResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InstallOperatorResponse.ProtoReflect.Descriptor instead. -func (*InstallOperatorResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{13} -} - -func (x *InstallOperatorResponse) GetStatus() OperatorsStatus { - if x != nil { - return x.Status - } - return OperatorsStatus_OPERATORS_STATUS_INVALID -} - -type CheckForOperatorUpdateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *CheckForOperatorUpdateRequest) Reset() { - *x = CheckForOperatorUpdateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CheckForOperatorUpdateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckForOperatorUpdateRequest) ProtoMessage() {} - -func (x *CheckForOperatorUpdateRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CheckForOperatorUpdateRequest.ProtoReflect.Descriptor instead. -func (*CheckForOperatorUpdateRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{14} -} - -// ComponentUpdateInformation contains version we can update to for certain component. -type ComponentUpdateInformation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AvailableVersion string `protobuf:"bytes,1,opt,name=available_version,json=availableVersion,proto3" json:"available_version,omitempty"` -} - -func (x *ComponentUpdateInformation) Reset() { - *x = ComponentUpdateInformation{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ComponentUpdateInformation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ComponentUpdateInformation) ProtoMessage() {} - -func (x *ComponentUpdateInformation) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ComponentUpdateInformation.ProtoReflect.Descriptor instead. -func (*ComponentUpdateInformation) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{15} -} - -func (x *ComponentUpdateInformation) GetAvailableVersion() string { - if x != nil { - return x.AvailableVersion - } - return "" -} - -// ComponentsUpdateInformation contains info about components and their available latest versions. -type ComponentsUpdateInformation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 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]*ComponentUpdateInformation `protobuf:"bytes,1,rep,name=component_to_update_information,json=componentToUpdateInformation,proto3" json:"component_to_update_information,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *ComponentsUpdateInformation) Reset() { - *x = ComponentsUpdateInformation{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ComponentsUpdateInformation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ComponentsUpdateInformation) ProtoMessage() {} - -func (x *ComponentsUpdateInformation) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ComponentsUpdateInformation.ProtoReflect.Descriptor instead. -func (*ComponentsUpdateInformation) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{16} -} - -func (x *ComponentsUpdateInformation) GetComponentToUpdateInformation() map[string]*ComponentUpdateInformation { - if x != nil { - return x.ComponentToUpdateInformation - } - return nil -} - -type CheckForOperatorUpdateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The cluster name is used as a key for this map, value contains components and their inforamtion about update. - ClusterToComponents map[string]*ComponentsUpdateInformation `protobuf:"bytes,1,rep,name=cluster_to_components,json=clusterToComponents,proto3" json:"cluster_to_components,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *CheckForOperatorUpdateResponse) Reset() { - *x = CheckForOperatorUpdateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CheckForOperatorUpdateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckForOperatorUpdateResponse) ProtoMessage() {} - -func (x *CheckForOperatorUpdateResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CheckForOperatorUpdateResponse.ProtoReflect.Descriptor instead. -func (*CheckForOperatorUpdateResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{17} -} - -func (x *CheckForOperatorUpdateResponse) GetClusterToComponents() map[string]*ComponentsUpdateInformation { - if x != nil { - return x.ClusterToComponents - } - return nil -} - -// ComponentVersion contains operations which should be done with component version. -type ChangeComponent_ComponentVersion struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - Disable bool `protobuf:"varint,2,opt,name=disable,proto3" json:"disable,omitempty"` - Enable bool `protobuf:"varint,3,opt,name=enable,proto3" json:"enable,omitempty"` -} - -func (x *ChangeComponent_ComponentVersion) Reset() { - *x = ChangeComponent_ComponentVersion{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_components_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ChangeComponent_ComponentVersion) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeComponent_ComponentVersion) ProtoMessage() {} - -func (x *ChangeComponent_ComponentVersion) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_components_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ChangeComponent_ComponentVersion.ProtoReflect.Descriptor instead. -func (*ChangeComponent_ComponentVersion) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_components_proto_rawDescGZIP(), []int{7, 0} -} - -func (x *ChangeComponent_ComponentVersion) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *ChangeComponent_ComponentVersion) GetDisable() bool { - if x != nil { - return x.Disable - } - return false -} - -func (x *ChangeComponent_ComponentVersion) GetEnable() bool { - if x != nil { - return x.Enable - } - return false -} - -var File_managementpb_dbaas_components_proto protoreflect.FileDescriptor - -var file_managementpb_dbaas_components_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, - 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb3, 0x01, 0x0a, 0x09, - 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6d, 0x61, - 0x67, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, - 0x6d, 0x61, 0x67, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6d, - 0x61, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x1a, 0x0a, 0x08, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x08, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x22, 0x9d, 0x09, 0x0a, 0x06, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x12, 0x39, 0x0a, 0x06, - 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x74, - 0x72, 0x69, 0x78, 0x2e, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x06, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x12, 0x30, 0x0a, 0x03, 0x70, 0x78, 0x63, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x2e, 0x50, 0x78, 0x63, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x70, 0x78, 0x63, 0x12, 0x30, 0x0a, 0x03, 0x70, 0x6d, 0x6d, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x2e, 0x50, 0x6d, - 0x6d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x70, 0x6d, 0x6d, 0x12, 0x3f, 0x0a, 0x08, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x73, 0x71, 0x6c, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x61, - 0x74, 0x72, 0x69, 0x78, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x73, 0x71, 0x6c, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x3c, 0x0a, 0x07, - 0x68, 0x61, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x61, - 0x74, 0x72, 0x69, 0x78, 0x2e, 0x48, 0x61, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x07, 0x68, 0x61, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x39, 0x0a, 0x06, 0x62, 0x61, - 0x63, 0x6b, 0x75, 0x70, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x64, 0x62, 0x61, - 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x74, 0x72, 0x69, - 0x78, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x62, - 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x3f, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, - 0x72, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x2e, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x4c, 0x0a, 0x0d, 0x6c, 0x6f, 0x67, 0x5f, 0x63, 0x6f, - 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x61, - 0x74, 0x72, 0x69, 0x78, 0x2e, 0x4c, 0x6f, 0x67, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x6c, 0x6f, 0x67, 0x43, 0x6f, 0x6c, 0x6c, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x1a, 0x53, 0x0a, 0x0b, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x50, 0x0a, 0x08, 0x50, 0x78, 0x63, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x50, 0x0a, 0x08, 0x50, - 0x6d, 0x6d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, - 0x6e, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x55, 0x0a, - 0x0d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x73, 0x71, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x18, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x54, 0x0a, 0x0c, 0x48, 0x61, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x53, 0x0a, 0x0b, 0x42, 0x61, - 0x63, 0x6b, 0x75, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x64, 0x62, 0x61, - 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, - 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x55, 0x0a, 0x0d, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x18, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x59, 0x0a, 0x11, 0x4c, 0x6f, 0x67, 0x43, 0x6f, 0x6c, - 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2e, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, - 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0x76, 0x0a, 0x0f, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x1a, - 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2d, 0x0a, 0x06, 0x6d, 0x61, - 0x74, 0x72, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x61, - 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x74, 0x72, 0x69, - 0x78, 0x52, 0x06, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x22, 0x72, 0x0a, 0x19, 0x47, 0x65, 0x74, - 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, - 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, - 0x0a, 0x0a, 0x64, 0x62, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x64, 0x62, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x58, 0x0a, - 0x1a, 0x47, 0x65, 0x74, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, - 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x70, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x50, 0x58, - 0x43, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x36, 0x0a, 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, - 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x15, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x62, - 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x64, 0x62, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x56, 0x0a, 0x18, 0x47, 0x65, 0x74, - 0x50, 0x58, 0x43, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x22, 0xf0, 0x01, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x6d, 0x70, - 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x4b, - 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x2f, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, - 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x67, 0x0a, 0x10, 0x43, - 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x21, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x22, 0x97, 0x01, 0x0a, 0x1c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, - 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, - 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, - 0x15, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x6d, - 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x64, 0x22, 0x1f, - 0x0a, 0x1d, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6f, 0x6d, - 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x85, 0x02, 0x0a, 0x1a, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x58, 0x43, 0x43, 0x6f, 0x6d, - 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, - 0x0a, 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x15, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x30, 0x0a, 0x03, 0x70, 0x78, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x03, 0x70, 0x78, - 0x63, 0x12, 0x3a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x73, 0x71, 0x6c, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, - 0x65, 0x6e, 0x74, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x38, 0x0a, - 0x07, 0x68, 0x61, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, - 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x52, 0x07, - 0x68, 0x61, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x22, 0x1d, 0x0a, 0x1b, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x50, 0x58, 0x43, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xaa, 0x01, 0x0a, 0x16, 0x49, 0x6e, 0x73, 0x74, 0x61, - 0x6c, 0x6c, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x3f, 0x0a, 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, - 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x15, 0x6b, 0x75, 0x62, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, - 0x10, 0x01, 0x52, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x21, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x22, 0x51, 0x0a, 0x17, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, - 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, - 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x1f, 0x0a, 0x1d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x46, - 0x6f, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x49, 0x0a, 0x1a, 0x43, 0x6f, 0x6d, 0x70, 0x6f, - 0x6e, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, - 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x10, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x22, 0xaf, 0x02, 0x0a, 0x1b, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, - 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x93, 0x01, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, - 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x72, - 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4c, 0x2e, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, - 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, - 0x6e, 0x74, 0x54, 0x6f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x1c, 0x63, 0x6f, 0x6d, 0x70, - 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x7a, 0x0a, 0x21, 0x43, 0x6f, 0x6d, 0x70, - 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x3f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, - 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, - 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x22, 0x90, 0x02, 0x0a, 0x1e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x46, 0x6f, - 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7a, 0x0a, 0x15, 0x63, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x46, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x46, 0x6f, 0x72, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x6f, 0x43, - 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x13, - 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, - 0x6e, 0x74, 0x73, 0x1a, 0x72, 0x0a, 0x18, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x6f, - 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x40, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2a, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0xf2, 0x07, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x70, - 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x9e, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x50, 0x53, - 0x4d, 0x44, 0x42, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x28, 0x2e, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x53, 0x4d, 0x44, 0x42, - 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x01, 0x2a, 0x22, 0x28, 0x2f, - 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, - 0x61, 0x61, 0x53, 0x2f, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x47, - 0x65, 0x74, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x12, 0x96, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x50, - 0x58, 0x43, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x2e, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x50, 0x58, 0x43, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x58, 0x43, 0x43, 0x6f, 0x6d, 0x70, 0x6f, - 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x3a, 0x01, 0x2a, 0x22, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, 0x2f, 0x43, - 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x50, 0x58, 0x43, - 0x12, 0xaa, 0x01, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x53, 0x4d, 0x44, 0x42, - 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2b, 0x2e, 0x64, 0x62, 0x61, - 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x53, - 0x4d, 0x44, 0x42, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x3a, 0x01, 0x2a, - 0x22, 0x2b, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, 0x2f, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x12, 0xa2, 0x01, - 0x0a, 0x13, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x58, 0x43, 0x43, 0x6f, 0x6d, 0x70, 0x6f, - 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x29, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x58, 0x43, 0x43, - 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2a, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x58, 0x43, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, - 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x2e, 0x3a, 0x01, 0x2a, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, 0x2f, 0x43, 0x6f, - 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, - 0x58, 0x43, 0x12, 0x9c, 0x01, 0x0a, 0x0f, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x25, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x49, 0x6e, - 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x3a, 0x01, 0x2a, - 0x22, 0x2f, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, 0x2f, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, - 0x72, 0x12, 0xb8, 0x01, 0x0a, 0x16, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x46, 0x6f, 0x72, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x2e, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x46, 0x6f, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x64, 0x62, 0x61, - 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x46, 0x6f, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x3b, 0x3a, 0x01, 0x2a, 0x22, 0x36, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, 0x2f, 0x43, 0x6f, 0x6d, 0x70, 0x6f, - 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x46, 0x6f, 0x72, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0xb5, 0x01, 0x0a, - 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x42, 0x0f, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x3b, 0x64, 0x62, 0x61, 0x61, 0x73, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x44, 0x62, 0x61, 0x61, 0x73, 0x2e, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x0d, 0x44, 0x62, 0x61, 0x61, 0x73, 0x5c, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x19, 0x44, 0x62, 0x61, 0x61, 0x73, 0x5c, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x44, 0x62, 0x61, 0x61, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_managementpb_dbaas_components_proto_rawDescOnce sync.Once - file_managementpb_dbaas_components_proto_rawDescData = file_managementpb_dbaas_components_proto_rawDesc -) - -func file_managementpb_dbaas_components_proto_rawDescGZIP() []byte { - file_managementpb_dbaas_components_proto_rawDescOnce.Do(func() { - file_managementpb_dbaas_components_proto_rawDescData = protoimpl.X.CompressGZIP(file_managementpb_dbaas_components_proto_rawDescData) - }) - return file_managementpb_dbaas_components_proto_rawDescData -} - -var ( - file_managementpb_dbaas_components_proto_msgTypes = make([]protoimpl.MessageInfo, 29) - file_managementpb_dbaas_components_proto_goTypes = []interface{}{ - (*Component)(nil), // 0: dbaas.v1beta1.Component - (*Matrix)(nil), // 1: dbaas.v1beta1.Matrix - (*OperatorVersion)(nil), // 2: dbaas.v1beta1.OperatorVersion - (*GetPSMDBComponentsRequest)(nil), // 3: dbaas.v1beta1.GetPSMDBComponentsRequest - (*GetPSMDBComponentsResponse)(nil), // 4: dbaas.v1beta1.GetPSMDBComponentsResponse - (*GetPXCComponentsRequest)(nil), // 5: dbaas.v1beta1.GetPXCComponentsRequest - (*GetPXCComponentsResponse)(nil), // 6: dbaas.v1beta1.GetPXCComponentsResponse - (*ChangeComponent)(nil), // 7: dbaas.v1beta1.ChangeComponent - (*ChangePSMDBComponentsRequest)(nil), // 8: dbaas.v1beta1.ChangePSMDBComponentsRequest - (*ChangePSMDBComponentsResponse)(nil), // 9: dbaas.v1beta1.ChangePSMDBComponentsResponse - (*ChangePXCComponentsRequest)(nil), // 10: dbaas.v1beta1.ChangePXCComponentsRequest - (*ChangePXCComponentsResponse)(nil), // 11: dbaas.v1beta1.ChangePXCComponentsResponse - (*InstallOperatorRequest)(nil), // 12: dbaas.v1beta1.InstallOperatorRequest - (*InstallOperatorResponse)(nil), // 13: dbaas.v1beta1.InstallOperatorResponse - (*CheckForOperatorUpdateRequest)(nil), // 14: dbaas.v1beta1.CheckForOperatorUpdateRequest - (*ComponentUpdateInformation)(nil), // 15: dbaas.v1beta1.ComponentUpdateInformation - (*ComponentsUpdateInformation)(nil), // 16: dbaas.v1beta1.ComponentsUpdateInformation - (*CheckForOperatorUpdateResponse)(nil), // 17: dbaas.v1beta1.CheckForOperatorUpdateResponse - nil, // 18: dbaas.v1beta1.Matrix.MongodEntry - nil, // 19: dbaas.v1beta1.Matrix.PxcEntry - nil, // 20: dbaas.v1beta1.Matrix.PmmEntry - nil, // 21: dbaas.v1beta1.Matrix.ProxysqlEntry - nil, // 22: dbaas.v1beta1.Matrix.HaproxyEntry - nil, // 23: dbaas.v1beta1.Matrix.BackupEntry - nil, // 24: dbaas.v1beta1.Matrix.OperatorEntry - nil, // 25: dbaas.v1beta1.Matrix.LogCollectorEntry - (*ChangeComponent_ComponentVersion)(nil), // 26: dbaas.v1beta1.ChangeComponent.ComponentVersion - nil, // 27: dbaas.v1beta1.ComponentsUpdateInformation.ComponentToUpdateInformationEntry - nil, // 28: dbaas.v1beta1.CheckForOperatorUpdateResponse.ClusterToComponentsEntry - (OperatorsStatus)(0), // 29: dbaas.v1beta1.OperatorsStatus - } -) - -var file_managementpb_dbaas_components_proto_depIdxs = []int32{ - 18, // 0: dbaas.v1beta1.Matrix.mongod:type_name -> dbaas.v1beta1.Matrix.MongodEntry - 19, // 1: dbaas.v1beta1.Matrix.pxc:type_name -> dbaas.v1beta1.Matrix.PxcEntry - 20, // 2: dbaas.v1beta1.Matrix.pmm:type_name -> dbaas.v1beta1.Matrix.PmmEntry - 21, // 3: dbaas.v1beta1.Matrix.proxysql:type_name -> dbaas.v1beta1.Matrix.ProxysqlEntry - 22, // 4: dbaas.v1beta1.Matrix.haproxy:type_name -> dbaas.v1beta1.Matrix.HaproxyEntry - 23, // 5: dbaas.v1beta1.Matrix.backup:type_name -> dbaas.v1beta1.Matrix.BackupEntry - 24, // 6: dbaas.v1beta1.Matrix.operator:type_name -> dbaas.v1beta1.Matrix.OperatorEntry - 25, // 7: dbaas.v1beta1.Matrix.log_collector:type_name -> dbaas.v1beta1.Matrix.LogCollectorEntry - 1, // 8: dbaas.v1beta1.OperatorVersion.matrix:type_name -> dbaas.v1beta1.Matrix - 2, // 9: dbaas.v1beta1.GetPSMDBComponentsResponse.versions:type_name -> dbaas.v1beta1.OperatorVersion - 2, // 10: dbaas.v1beta1.GetPXCComponentsResponse.versions:type_name -> dbaas.v1beta1.OperatorVersion - 26, // 11: dbaas.v1beta1.ChangeComponent.versions:type_name -> dbaas.v1beta1.ChangeComponent.ComponentVersion - 7, // 12: dbaas.v1beta1.ChangePSMDBComponentsRequest.mongod:type_name -> dbaas.v1beta1.ChangeComponent - 7, // 13: dbaas.v1beta1.ChangePXCComponentsRequest.pxc:type_name -> dbaas.v1beta1.ChangeComponent - 7, // 14: dbaas.v1beta1.ChangePXCComponentsRequest.proxysql:type_name -> dbaas.v1beta1.ChangeComponent - 7, // 15: dbaas.v1beta1.ChangePXCComponentsRequest.haproxy:type_name -> dbaas.v1beta1.ChangeComponent - 29, // 16: dbaas.v1beta1.InstallOperatorResponse.status:type_name -> dbaas.v1beta1.OperatorsStatus - 27, // 17: dbaas.v1beta1.ComponentsUpdateInformation.component_to_update_information:type_name -> dbaas.v1beta1.ComponentsUpdateInformation.ComponentToUpdateInformationEntry - 28, // 18: dbaas.v1beta1.CheckForOperatorUpdateResponse.cluster_to_components:type_name -> dbaas.v1beta1.CheckForOperatorUpdateResponse.ClusterToComponentsEntry - 0, // 19: dbaas.v1beta1.Matrix.MongodEntry.value:type_name -> dbaas.v1beta1.Component - 0, // 20: dbaas.v1beta1.Matrix.PxcEntry.value:type_name -> dbaas.v1beta1.Component - 0, // 21: dbaas.v1beta1.Matrix.PmmEntry.value:type_name -> dbaas.v1beta1.Component - 0, // 22: dbaas.v1beta1.Matrix.ProxysqlEntry.value:type_name -> dbaas.v1beta1.Component - 0, // 23: dbaas.v1beta1.Matrix.HaproxyEntry.value:type_name -> dbaas.v1beta1.Component - 0, // 24: dbaas.v1beta1.Matrix.BackupEntry.value:type_name -> dbaas.v1beta1.Component - 0, // 25: dbaas.v1beta1.Matrix.OperatorEntry.value:type_name -> dbaas.v1beta1.Component - 0, // 26: dbaas.v1beta1.Matrix.LogCollectorEntry.value:type_name -> dbaas.v1beta1.Component - 15, // 27: dbaas.v1beta1.ComponentsUpdateInformation.ComponentToUpdateInformationEntry.value:type_name -> dbaas.v1beta1.ComponentUpdateInformation - 16, // 28: dbaas.v1beta1.CheckForOperatorUpdateResponse.ClusterToComponentsEntry.value:type_name -> dbaas.v1beta1.ComponentsUpdateInformation - 3, // 29: dbaas.v1beta1.Components.GetPSMDBComponents:input_type -> dbaas.v1beta1.GetPSMDBComponentsRequest - 5, // 30: dbaas.v1beta1.Components.GetPXCComponents:input_type -> dbaas.v1beta1.GetPXCComponentsRequest - 8, // 31: dbaas.v1beta1.Components.ChangePSMDBComponents:input_type -> dbaas.v1beta1.ChangePSMDBComponentsRequest - 10, // 32: dbaas.v1beta1.Components.ChangePXCComponents:input_type -> dbaas.v1beta1.ChangePXCComponentsRequest - 12, // 33: dbaas.v1beta1.Components.InstallOperator:input_type -> dbaas.v1beta1.InstallOperatorRequest - 14, // 34: dbaas.v1beta1.Components.CheckForOperatorUpdate:input_type -> dbaas.v1beta1.CheckForOperatorUpdateRequest - 4, // 35: dbaas.v1beta1.Components.GetPSMDBComponents:output_type -> dbaas.v1beta1.GetPSMDBComponentsResponse - 6, // 36: dbaas.v1beta1.Components.GetPXCComponents:output_type -> dbaas.v1beta1.GetPXCComponentsResponse - 9, // 37: dbaas.v1beta1.Components.ChangePSMDBComponents:output_type -> dbaas.v1beta1.ChangePSMDBComponentsResponse - 11, // 38: dbaas.v1beta1.Components.ChangePXCComponents:output_type -> dbaas.v1beta1.ChangePXCComponentsResponse - 13, // 39: dbaas.v1beta1.Components.InstallOperator:output_type -> dbaas.v1beta1.InstallOperatorResponse - 17, // 40: dbaas.v1beta1.Components.CheckForOperatorUpdate:output_type -> dbaas.v1beta1.CheckForOperatorUpdateResponse - 35, // [35:41] is the sub-list for method output_type - 29, // [29:35] is the sub-list for method input_type - 29, // [29:29] is the sub-list for extension type_name - 29, // [29:29] is the sub-list for extension extendee - 0, // [0:29] is the sub-list for field type_name -} - -func init() { file_managementpb_dbaas_components_proto_init() } -func file_managementpb_dbaas_components_proto_init() { - if File_managementpb_dbaas_components_proto != nil { - return - } - file_managementpb_dbaas_dbaas_proto_init() - if !protoimpl.UnsafeEnabled { - file_managementpb_dbaas_components_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Component); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Matrix); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OperatorVersion); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPSMDBComponentsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPSMDBComponentsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPXCComponentsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPXCComponentsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangeComponent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangePSMDBComponentsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangePSMDBComponentsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangePXCComponentsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangePXCComponentsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InstallOperatorRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InstallOperatorResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CheckForOperatorUpdateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ComponentUpdateInformation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ComponentsUpdateInformation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CheckForOperatorUpdateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_components_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangeComponent_ComponentVersion); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_managementpb_dbaas_components_proto_rawDesc, - NumEnums: 0, - NumMessages: 29, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_managementpb_dbaas_components_proto_goTypes, - DependencyIndexes: file_managementpb_dbaas_components_proto_depIdxs, - MessageInfos: file_managementpb_dbaas_components_proto_msgTypes, - }.Build() - File_managementpb_dbaas_components_proto = out.File - file_managementpb_dbaas_components_proto_rawDesc = nil - file_managementpb_dbaas_components_proto_goTypes = nil - file_managementpb_dbaas_components_proto_depIdxs = nil -} diff --git a/api/managementpb/dbaas/components.pb.gw.go b/api/managementpb/dbaas/components.pb.gw.go deleted file mode 100644 index 84abfde921..0000000000 --- a/api/managementpb/dbaas/components.pb.gw.go +++ /dev/null @@ -1,572 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: managementpb/dbaas/components.proto - -/* -Package dbaasv1beta1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package dbaasv1beta1 - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_Components_GetPSMDBComponents_0(ctx context.Context, marshaler runtime.Marshaler, client ComponentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetPSMDBComponentsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetPSMDBComponents(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Components_GetPSMDBComponents_0(ctx context.Context, marshaler runtime.Marshaler, server ComponentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetPSMDBComponentsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetPSMDBComponents(ctx, &protoReq) - return msg, metadata, err -} - -func request_Components_GetPXCComponents_0(ctx context.Context, marshaler runtime.Marshaler, client ComponentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetPXCComponentsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetPXCComponents(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Components_GetPXCComponents_0(ctx context.Context, marshaler runtime.Marshaler, server ComponentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetPXCComponentsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetPXCComponents(ctx, &protoReq) - return msg, metadata, err -} - -func request_Components_ChangePSMDBComponents_0(ctx context.Context, marshaler runtime.Marshaler, client ComponentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ChangePSMDBComponentsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ChangePSMDBComponents(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Components_ChangePSMDBComponents_0(ctx context.Context, marshaler runtime.Marshaler, server ComponentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ChangePSMDBComponentsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ChangePSMDBComponents(ctx, &protoReq) - return msg, metadata, err -} - -func request_Components_ChangePXCComponents_0(ctx context.Context, marshaler runtime.Marshaler, client ComponentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ChangePXCComponentsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ChangePXCComponents(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Components_ChangePXCComponents_0(ctx context.Context, marshaler runtime.Marshaler, server ComponentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ChangePXCComponentsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ChangePXCComponents(ctx, &protoReq) - return msg, metadata, err -} - -func request_Components_InstallOperator_0(ctx context.Context, marshaler runtime.Marshaler, client ComponentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq InstallOperatorRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.InstallOperator(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Components_InstallOperator_0(ctx context.Context, marshaler runtime.Marshaler, server ComponentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq InstallOperatorRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.InstallOperator(ctx, &protoReq) - return msg, metadata, err -} - -func request_Components_CheckForOperatorUpdate_0(ctx context.Context, marshaler runtime.Marshaler, client ComponentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CheckForOperatorUpdateRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CheckForOperatorUpdate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Components_CheckForOperatorUpdate_0(ctx context.Context, marshaler runtime.Marshaler, server ComponentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CheckForOperatorUpdateRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CheckForOperatorUpdate(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterComponentsHandlerServer registers the http handlers for service Components to "mux". -// UnaryRPC :call ComponentsServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterComponentsHandlerFromEndpoint instead. -func RegisterComponentsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ComponentsServer) error { - mux.Handle("POST", pattern_Components_GetPSMDBComponents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.Components/GetPSMDBComponents", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Components/GetPSMDB")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Components_GetPSMDBComponents_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Components_GetPSMDBComponents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Components_GetPXCComponents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.Components/GetPXCComponents", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Components/GetPXC")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Components_GetPXCComponents_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Components_GetPXCComponents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Components_ChangePSMDBComponents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.Components/ChangePSMDBComponents", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Components/ChangePSMDB")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Components_ChangePSMDBComponents_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Components_ChangePSMDBComponents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Components_ChangePXCComponents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.Components/ChangePXCComponents", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Components/ChangePXC")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Components_ChangePXCComponents_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Components_ChangePXCComponents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Components_InstallOperator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.Components/InstallOperator", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Components/InstallOperator")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Components_InstallOperator_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Components_InstallOperator_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Components_CheckForOperatorUpdate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.Components/CheckForOperatorUpdate", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Components/CheckForOperatorUpdate")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Components_CheckForOperatorUpdate_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Components_CheckForOperatorUpdate_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterComponentsHandlerFromEndpoint is same as RegisterComponentsHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterComponentsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterComponentsHandler(ctx, mux, conn) -} - -// RegisterComponentsHandler registers the http handlers for service Components to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterComponentsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterComponentsHandlerClient(ctx, mux, NewComponentsClient(conn)) -} - -// RegisterComponentsHandlerClient registers the http handlers for service Components -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ComponentsClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ComponentsClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ComponentsClient" to call the correct interceptors. -func RegisterComponentsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ComponentsClient) error { - mux.Handle("POST", pattern_Components_GetPSMDBComponents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.Components/GetPSMDBComponents", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Components/GetPSMDB")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Components_GetPSMDBComponents_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Components_GetPSMDBComponents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Components_GetPXCComponents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.Components/GetPXCComponents", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Components/GetPXC")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Components_GetPXCComponents_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Components_GetPXCComponents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Components_ChangePSMDBComponents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.Components/ChangePSMDBComponents", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Components/ChangePSMDB")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Components_ChangePSMDBComponents_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Components_ChangePSMDBComponents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Components_ChangePXCComponents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.Components/ChangePXCComponents", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Components/ChangePXC")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Components_ChangePXCComponents_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Components_ChangePXCComponents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Components_InstallOperator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.Components/InstallOperator", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Components/InstallOperator")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Components_InstallOperator_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Components_InstallOperator_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Components_CheckForOperatorUpdate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.Components/CheckForOperatorUpdate", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Components/CheckForOperatorUpdate")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Components_CheckForOperatorUpdate_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Components_CheckForOperatorUpdate_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -var ( - pattern_Components_GetPSMDBComponents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "Components", "GetPSMDB"}, "")) - - pattern_Components_GetPXCComponents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "Components", "GetPXC"}, "")) - - pattern_Components_ChangePSMDBComponents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "Components", "ChangePSMDB"}, "")) - - pattern_Components_ChangePXCComponents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "Components", "ChangePXC"}, "")) - - pattern_Components_InstallOperator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "Components", "InstallOperator"}, "")) - - pattern_Components_CheckForOperatorUpdate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "Components", "CheckForOperatorUpdate"}, "")) -) - -var ( - forward_Components_GetPSMDBComponents_0 = runtime.ForwardResponseMessage - - forward_Components_GetPXCComponents_0 = runtime.ForwardResponseMessage - - forward_Components_ChangePSMDBComponents_0 = runtime.ForwardResponseMessage - - forward_Components_ChangePXCComponents_0 = runtime.ForwardResponseMessage - - forward_Components_InstallOperator_0 = runtime.ForwardResponseMessage - - forward_Components_CheckForOperatorUpdate_0 = runtime.ForwardResponseMessage -) diff --git a/api/managementpb/dbaas/components.pb.validate.go b/api/managementpb/dbaas/components.pb.validate.go deleted file mode 100644 index 16788ade93..0000000000 --- a/api/managementpb/dbaas/components.pb.validate.go +++ /dev/null @@ -1,2779 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: managementpb/dbaas/components.proto - -package dbaasv1beta1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on Component with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Component) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Component with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in ComponentMultiError, or nil -// if none found. -func (m *Component) ValidateAll() error { - return m.validate(true) -} - -func (m *Component) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ImagePath - - // no validation rules for ImageHash - - // no validation rules for Status - - // no validation rules for Critical - - // no validation rules for Default - - // no validation rules for Disabled - - if len(errors) > 0 { - return ComponentMultiError(errors) - } - - return nil -} - -// ComponentMultiError is an error wrapping multiple validation errors returned -// by Component.ValidateAll() if the designated constraints aren't met. -type ComponentMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ComponentMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ComponentMultiError) AllErrors() []error { return m } - -// ComponentValidationError is the validation error returned by -// Component.Validate if the designated constraints aren't met. -type ComponentValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ComponentValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ComponentValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ComponentValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ComponentValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ComponentValidationError) ErrorName() string { return "ComponentValidationError" } - -// Error satisfies the builtin error interface -func (e ComponentValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sComponent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ComponentValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ComponentValidationError{} - -// Validate checks the field values on Matrix with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Matrix) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Matrix with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in MatrixMultiError, or nil if none found. -func (m *Matrix) ValidateAll() error { - return m.validate(true) -} - -func (m *Matrix) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - { - sorted_keys := make([]string, len(m.GetMongod())) - i := 0 - for key := range m.GetMongod() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetMongod()[key] - _ = val - - // no validation rules for Mongod[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MatrixValidationError{ - field: fmt.Sprintf("Mongod[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MatrixValidationError{ - field: fmt.Sprintf("Mongod[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MatrixValidationError{ - field: fmt.Sprintf("Mongod[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - { - sorted_keys := make([]string, len(m.GetPxc())) - i := 0 - for key := range m.GetPxc() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetPxc()[key] - _ = val - - // no validation rules for Pxc[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MatrixValidationError{ - field: fmt.Sprintf("Pxc[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MatrixValidationError{ - field: fmt.Sprintf("Pxc[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MatrixValidationError{ - field: fmt.Sprintf("Pxc[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - { - sorted_keys := make([]string, len(m.GetPmm())) - i := 0 - for key := range m.GetPmm() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetPmm()[key] - _ = val - - // no validation rules for Pmm[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MatrixValidationError{ - field: fmt.Sprintf("Pmm[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MatrixValidationError{ - field: fmt.Sprintf("Pmm[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MatrixValidationError{ - field: fmt.Sprintf("Pmm[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - { - sorted_keys := make([]string, len(m.GetProxysql())) - i := 0 - for key := range m.GetProxysql() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetProxysql()[key] - _ = val - - // no validation rules for Proxysql[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MatrixValidationError{ - field: fmt.Sprintf("Proxysql[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MatrixValidationError{ - field: fmt.Sprintf("Proxysql[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MatrixValidationError{ - field: fmt.Sprintf("Proxysql[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - { - sorted_keys := make([]string, len(m.GetHaproxy())) - i := 0 - for key := range m.GetHaproxy() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetHaproxy()[key] - _ = val - - // no validation rules for Haproxy[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MatrixValidationError{ - field: fmt.Sprintf("Haproxy[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MatrixValidationError{ - field: fmt.Sprintf("Haproxy[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MatrixValidationError{ - field: fmt.Sprintf("Haproxy[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - { - sorted_keys := make([]string, len(m.GetBackup())) - i := 0 - for key := range m.GetBackup() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetBackup()[key] - _ = val - - // no validation rules for Backup[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MatrixValidationError{ - field: fmt.Sprintf("Backup[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MatrixValidationError{ - field: fmt.Sprintf("Backup[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MatrixValidationError{ - field: fmt.Sprintf("Backup[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - { - sorted_keys := make([]string, len(m.GetOperator())) - i := 0 - for key := range m.GetOperator() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetOperator()[key] - _ = val - - // no validation rules for Operator[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MatrixValidationError{ - field: fmt.Sprintf("Operator[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MatrixValidationError{ - field: fmt.Sprintf("Operator[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MatrixValidationError{ - field: fmt.Sprintf("Operator[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - { - sorted_keys := make([]string, len(m.GetLogCollector())) - i := 0 - for key := range m.GetLogCollector() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetLogCollector()[key] - _ = val - - // no validation rules for LogCollector[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, MatrixValidationError{ - field: fmt.Sprintf("LogCollector[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, MatrixValidationError{ - field: fmt.Sprintf("LogCollector[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return MatrixValidationError{ - field: fmt.Sprintf("LogCollector[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - if len(errors) > 0 { - return MatrixMultiError(errors) - } - - return nil -} - -// MatrixMultiError is an error wrapping multiple validation errors returned by -// Matrix.ValidateAll() if the designated constraints aren't met. -type MatrixMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MatrixMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m MatrixMultiError) AllErrors() []error { return m } - -// MatrixValidationError is the validation error returned by Matrix.Validate if -// the designated constraints aren't met. -type MatrixValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MatrixValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MatrixValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MatrixValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MatrixValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MatrixValidationError) ErrorName() string { return "MatrixValidationError" } - -// Error satisfies the builtin error interface -func (e MatrixValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sMatrix.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MatrixValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MatrixValidationError{} - -// Validate checks the field values on OperatorVersion with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *OperatorVersion) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on OperatorVersion with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// OperatorVersionMultiError, or nil if none found. -func (m *OperatorVersion) ValidateAll() error { - return m.validate(true) -} - -func (m *OperatorVersion) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Product - - // no validation rules for Operator - - if all { - switch v := interface{}(m.GetMatrix()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, OperatorVersionValidationError{ - field: "Matrix", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, OperatorVersionValidationError{ - field: "Matrix", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMatrix()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return OperatorVersionValidationError{ - field: "Matrix", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return OperatorVersionMultiError(errors) - } - - return nil -} - -// OperatorVersionMultiError is an error wrapping multiple validation errors -// returned by OperatorVersion.ValidateAll() if the designated constraints -// aren't met. -type OperatorVersionMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m OperatorVersionMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m OperatorVersionMultiError) AllErrors() []error { return m } - -// OperatorVersionValidationError is the validation error returned by -// OperatorVersion.Validate if the designated constraints aren't met. -type OperatorVersionValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e OperatorVersionValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e OperatorVersionValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e OperatorVersionValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e OperatorVersionValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e OperatorVersionValidationError) ErrorName() string { return "OperatorVersionValidationError" } - -// Error satisfies the builtin error interface -func (e OperatorVersionValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sOperatorVersion.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = OperatorVersionValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = OperatorVersionValidationError{} - -// Validate checks the field values on GetPSMDBComponentsRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *GetPSMDBComponentsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetPSMDBComponentsRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// GetPSMDBComponentsRequestMultiError, or nil if none found. -func (m *GetPSMDBComponentsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetPSMDBComponentsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for KubernetesClusterName - - // no validation rules for DbVersion - - if len(errors) > 0 { - return GetPSMDBComponentsRequestMultiError(errors) - } - - return nil -} - -// GetPSMDBComponentsRequestMultiError is an error wrapping multiple validation -// errors returned by GetPSMDBComponentsRequest.ValidateAll() if the -// designated constraints aren't met. -type GetPSMDBComponentsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetPSMDBComponentsRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetPSMDBComponentsRequestMultiError) AllErrors() []error { return m } - -// GetPSMDBComponentsRequestValidationError is the validation error returned by -// GetPSMDBComponentsRequest.Validate if the designated constraints aren't met. -type GetPSMDBComponentsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetPSMDBComponentsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetPSMDBComponentsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetPSMDBComponentsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetPSMDBComponentsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetPSMDBComponentsRequestValidationError) ErrorName() string { - return "GetPSMDBComponentsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetPSMDBComponentsRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetPSMDBComponentsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetPSMDBComponentsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetPSMDBComponentsRequestValidationError{} - -// Validate checks the field values on GetPSMDBComponentsResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *GetPSMDBComponentsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetPSMDBComponentsResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// GetPSMDBComponentsResponseMultiError, or nil if none found. -func (m *GetPSMDBComponentsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetPSMDBComponentsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetVersions() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetPSMDBComponentsResponseValidationError{ - field: fmt.Sprintf("Versions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetPSMDBComponentsResponseValidationError{ - field: fmt.Sprintf("Versions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetPSMDBComponentsResponseValidationError{ - field: fmt.Sprintf("Versions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return GetPSMDBComponentsResponseMultiError(errors) - } - - return nil -} - -// GetPSMDBComponentsResponseMultiError is an error wrapping multiple -// validation errors returned by GetPSMDBComponentsResponse.ValidateAll() if -// the designated constraints aren't met. -type GetPSMDBComponentsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetPSMDBComponentsResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetPSMDBComponentsResponseMultiError) AllErrors() []error { return m } - -// GetPSMDBComponentsResponseValidationError is the validation error returned -// by GetPSMDBComponentsResponse.Validate if the designated constraints aren't met. -type GetPSMDBComponentsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetPSMDBComponentsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetPSMDBComponentsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetPSMDBComponentsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetPSMDBComponentsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetPSMDBComponentsResponseValidationError) ErrorName() string { - return "GetPSMDBComponentsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetPSMDBComponentsResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetPSMDBComponentsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetPSMDBComponentsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetPSMDBComponentsResponseValidationError{} - -// Validate checks the field values on GetPXCComponentsRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *GetPXCComponentsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetPXCComponentsRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// GetPXCComponentsRequestMultiError, or nil if none found. -func (m *GetPXCComponentsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetPXCComponentsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for KubernetesClusterName - - // no validation rules for DbVersion - - if len(errors) > 0 { - return GetPXCComponentsRequestMultiError(errors) - } - - return nil -} - -// GetPXCComponentsRequestMultiError is an error wrapping multiple validation -// errors returned by GetPXCComponentsRequest.ValidateAll() if the designated -// constraints aren't met. -type GetPXCComponentsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetPXCComponentsRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetPXCComponentsRequestMultiError) AllErrors() []error { return m } - -// GetPXCComponentsRequestValidationError is the validation error returned by -// GetPXCComponentsRequest.Validate if the designated constraints aren't met. -type GetPXCComponentsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetPXCComponentsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetPXCComponentsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetPXCComponentsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetPXCComponentsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetPXCComponentsRequestValidationError) ErrorName() string { - return "GetPXCComponentsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetPXCComponentsRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetPXCComponentsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetPXCComponentsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetPXCComponentsRequestValidationError{} - -// Validate checks the field values on GetPXCComponentsResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *GetPXCComponentsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetPXCComponentsResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// GetPXCComponentsResponseMultiError, or nil if none found. -func (m *GetPXCComponentsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetPXCComponentsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetVersions() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetPXCComponentsResponseValidationError{ - field: fmt.Sprintf("Versions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetPXCComponentsResponseValidationError{ - field: fmt.Sprintf("Versions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetPXCComponentsResponseValidationError{ - field: fmt.Sprintf("Versions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return GetPXCComponentsResponseMultiError(errors) - } - - return nil -} - -// GetPXCComponentsResponseMultiError is an error wrapping multiple validation -// errors returned by GetPXCComponentsResponse.ValidateAll() if the designated -// constraints aren't met. -type GetPXCComponentsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetPXCComponentsResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetPXCComponentsResponseMultiError) AllErrors() []error { return m } - -// GetPXCComponentsResponseValidationError is the validation error returned by -// GetPXCComponentsResponse.Validate if the designated constraints aren't met. -type GetPXCComponentsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetPXCComponentsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetPXCComponentsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetPXCComponentsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetPXCComponentsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetPXCComponentsResponseValidationError) ErrorName() string { - return "GetPXCComponentsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetPXCComponentsResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetPXCComponentsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetPXCComponentsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetPXCComponentsResponseValidationError{} - -// Validate checks the field values on ChangeComponent with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *ChangeComponent) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeComponent with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ChangeComponentMultiError, or nil if none found. -func (m *ChangeComponent) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeComponent) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for DefaultVersion - - for idx, item := range m.GetVersions() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangeComponentValidationError{ - field: fmt.Sprintf("Versions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangeComponentValidationError{ - field: fmt.Sprintf("Versions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangeComponentValidationError{ - field: fmt.Sprintf("Versions[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ChangeComponentMultiError(errors) - } - - return nil -} - -// ChangeComponentMultiError is an error wrapping multiple validation errors -// returned by ChangeComponent.ValidateAll() if the designated constraints -// aren't met. -type ChangeComponentMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeComponentMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ChangeComponentMultiError) AllErrors() []error { return m } - -// ChangeComponentValidationError is the validation error returned by -// ChangeComponent.Validate if the designated constraints aren't met. -type ChangeComponentValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeComponentValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeComponentValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeComponentValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeComponentValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeComponentValidationError) ErrorName() string { return "ChangeComponentValidationError" } - -// Error satisfies the builtin error interface -func (e ChangeComponentValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sChangeComponent.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeComponentValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeComponentValidationError{} - -// Validate checks the field values on ChangePSMDBComponentsRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ChangePSMDBComponentsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangePSMDBComponentsRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ChangePSMDBComponentsRequestMultiError, or nil if none found. -func (m *ChangePSMDBComponentsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangePSMDBComponentsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := ChangePSMDBComponentsRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMongod()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangePSMDBComponentsRequestValidationError{ - field: "Mongod", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangePSMDBComponentsRequestValidationError{ - field: "Mongod", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMongod()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangePSMDBComponentsRequestValidationError{ - field: "Mongod", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ChangePSMDBComponentsRequestMultiError(errors) - } - - return nil -} - -// ChangePSMDBComponentsRequestMultiError is an error wrapping multiple -// validation errors returned by ChangePSMDBComponentsRequest.ValidateAll() if -// the designated constraints aren't met. -type ChangePSMDBComponentsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangePSMDBComponentsRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ChangePSMDBComponentsRequestMultiError) AllErrors() []error { return m } - -// ChangePSMDBComponentsRequestValidationError is the validation error returned -// by ChangePSMDBComponentsRequest.Validate if the designated constraints -// aren't met. -type ChangePSMDBComponentsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangePSMDBComponentsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangePSMDBComponentsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangePSMDBComponentsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangePSMDBComponentsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangePSMDBComponentsRequestValidationError) ErrorName() string { - return "ChangePSMDBComponentsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangePSMDBComponentsRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sChangePSMDBComponentsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangePSMDBComponentsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangePSMDBComponentsRequestValidationError{} - -// Validate checks the field values on ChangePSMDBComponentsResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ChangePSMDBComponentsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangePSMDBComponentsResponse with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// ChangePSMDBComponentsResponseMultiError, or nil if none found. -func (m *ChangePSMDBComponentsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangePSMDBComponentsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ChangePSMDBComponentsResponseMultiError(errors) - } - - return nil -} - -// ChangePSMDBComponentsResponseMultiError is an error wrapping multiple -// validation errors returned by ChangePSMDBComponentsResponse.ValidateAll() -// if the designated constraints aren't met. -type ChangePSMDBComponentsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangePSMDBComponentsResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ChangePSMDBComponentsResponseMultiError) AllErrors() []error { return m } - -// ChangePSMDBComponentsResponseValidationError is the validation error -// returned by ChangePSMDBComponentsResponse.Validate if the designated -// constraints aren't met. -type ChangePSMDBComponentsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangePSMDBComponentsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangePSMDBComponentsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangePSMDBComponentsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangePSMDBComponentsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangePSMDBComponentsResponseValidationError) ErrorName() string { - return "ChangePSMDBComponentsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangePSMDBComponentsResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sChangePSMDBComponentsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangePSMDBComponentsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangePSMDBComponentsResponseValidationError{} - -// Validate checks the field values on ChangePXCComponentsRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ChangePXCComponentsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangePXCComponentsRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ChangePXCComponentsRequestMultiError, or nil if none found. -func (m *ChangePXCComponentsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangePXCComponentsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := ChangePXCComponentsRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetPxc()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangePXCComponentsRequestValidationError{ - field: "Pxc", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangePXCComponentsRequestValidationError{ - field: "Pxc", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPxc()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangePXCComponentsRequestValidationError{ - field: "Pxc", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetProxysql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangePXCComponentsRequestValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangePXCComponentsRequestValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetProxysql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangePXCComponentsRequestValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetHaproxy()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ChangePXCComponentsRequestValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ChangePXCComponentsRequestValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetHaproxy()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ChangePXCComponentsRequestValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ChangePXCComponentsRequestMultiError(errors) - } - - return nil -} - -// ChangePXCComponentsRequestMultiError is an error wrapping multiple -// validation errors returned by ChangePXCComponentsRequest.ValidateAll() if -// the designated constraints aren't met. -type ChangePXCComponentsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangePXCComponentsRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ChangePXCComponentsRequestMultiError) AllErrors() []error { return m } - -// ChangePXCComponentsRequestValidationError is the validation error returned -// by ChangePXCComponentsRequest.Validate if the designated constraints aren't met. -type ChangePXCComponentsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangePXCComponentsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangePXCComponentsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangePXCComponentsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangePXCComponentsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangePXCComponentsRequestValidationError) ErrorName() string { - return "ChangePXCComponentsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangePXCComponentsRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sChangePXCComponentsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangePXCComponentsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangePXCComponentsRequestValidationError{} - -// Validate checks the field values on ChangePXCComponentsResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ChangePXCComponentsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangePXCComponentsResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ChangePXCComponentsResponseMultiError, or nil if none found. -func (m *ChangePXCComponentsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangePXCComponentsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ChangePXCComponentsResponseMultiError(errors) - } - - return nil -} - -// ChangePXCComponentsResponseMultiError is an error wrapping multiple -// validation errors returned by ChangePXCComponentsResponse.ValidateAll() if -// the designated constraints aren't met. -type ChangePXCComponentsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangePXCComponentsResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ChangePXCComponentsResponseMultiError) AllErrors() []error { return m } - -// ChangePXCComponentsResponseValidationError is the validation error returned -// by ChangePXCComponentsResponse.Validate if the designated constraints -// aren't met. -type ChangePXCComponentsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangePXCComponentsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangePXCComponentsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangePXCComponentsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangePXCComponentsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangePXCComponentsResponseValidationError) ErrorName() string { - return "ChangePXCComponentsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangePXCComponentsResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sChangePXCComponentsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangePXCComponentsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangePXCComponentsResponseValidationError{} - -// Validate checks the field values on InstallOperatorRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *InstallOperatorRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on InstallOperatorRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// InstallOperatorRequestMultiError, or nil if none found. -func (m *InstallOperatorRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *InstallOperatorRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := InstallOperatorRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetOperatorType()) < 1 { - err := InstallOperatorRequestValidationError{ - field: "OperatorType", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetVersion()) < 1 { - err := InstallOperatorRequestValidationError{ - field: "Version", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return InstallOperatorRequestMultiError(errors) - } - - return nil -} - -// InstallOperatorRequestMultiError is an error wrapping multiple validation -// errors returned by InstallOperatorRequest.ValidateAll() if the designated -// constraints aren't met. -type InstallOperatorRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m InstallOperatorRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m InstallOperatorRequestMultiError) AllErrors() []error { return m } - -// InstallOperatorRequestValidationError is the validation error returned by -// InstallOperatorRequest.Validate if the designated constraints aren't met. -type InstallOperatorRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e InstallOperatorRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e InstallOperatorRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e InstallOperatorRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e InstallOperatorRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e InstallOperatorRequestValidationError) ErrorName() string { - return "InstallOperatorRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e InstallOperatorRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sInstallOperatorRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = InstallOperatorRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = InstallOperatorRequestValidationError{} - -// Validate checks the field values on InstallOperatorResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *InstallOperatorResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on InstallOperatorResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// InstallOperatorResponseMultiError, or nil if none found. -func (m *InstallOperatorResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *InstallOperatorResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Status - - if len(errors) > 0 { - return InstallOperatorResponseMultiError(errors) - } - - return nil -} - -// InstallOperatorResponseMultiError is an error wrapping multiple validation -// errors returned by InstallOperatorResponse.ValidateAll() if the designated -// constraints aren't met. -type InstallOperatorResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m InstallOperatorResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m InstallOperatorResponseMultiError) AllErrors() []error { return m } - -// InstallOperatorResponseValidationError is the validation error returned by -// InstallOperatorResponse.Validate if the designated constraints aren't met. -type InstallOperatorResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e InstallOperatorResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e InstallOperatorResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e InstallOperatorResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e InstallOperatorResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e InstallOperatorResponseValidationError) ErrorName() string { - return "InstallOperatorResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e InstallOperatorResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sInstallOperatorResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = InstallOperatorResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = InstallOperatorResponseValidationError{} - -// Validate checks the field values on CheckForOperatorUpdateRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *CheckForOperatorUpdateRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CheckForOperatorUpdateRequest with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// CheckForOperatorUpdateRequestMultiError, or nil if none found. -func (m *CheckForOperatorUpdateRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *CheckForOperatorUpdateRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return CheckForOperatorUpdateRequestMultiError(errors) - } - - return nil -} - -// CheckForOperatorUpdateRequestMultiError is an error wrapping multiple -// validation errors returned by CheckForOperatorUpdateRequest.ValidateAll() -// if the designated constraints aren't met. -type CheckForOperatorUpdateRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CheckForOperatorUpdateRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m CheckForOperatorUpdateRequestMultiError) AllErrors() []error { return m } - -// CheckForOperatorUpdateRequestValidationError is the validation error -// returned by CheckForOperatorUpdateRequest.Validate if the designated -// constraints aren't met. -type CheckForOperatorUpdateRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CheckForOperatorUpdateRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CheckForOperatorUpdateRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CheckForOperatorUpdateRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CheckForOperatorUpdateRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CheckForOperatorUpdateRequestValidationError) ErrorName() string { - return "CheckForOperatorUpdateRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e CheckForOperatorUpdateRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sCheckForOperatorUpdateRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CheckForOperatorUpdateRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CheckForOperatorUpdateRequestValidationError{} - -// Validate checks the field values on ComponentUpdateInformation with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ComponentUpdateInformation) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ComponentUpdateInformation with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ComponentUpdateInformationMultiError, or nil if none found. -func (m *ComponentUpdateInformation) ValidateAll() error { - return m.validate(true) -} - -func (m *ComponentUpdateInformation) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AvailableVersion - - if len(errors) > 0 { - return ComponentUpdateInformationMultiError(errors) - } - - return nil -} - -// ComponentUpdateInformationMultiError is an error wrapping multiple -// validation errors returned by ComponentUpdateInformation.ValidateAll() if -// the designated constraints aren't met. -type ComponentUpdateInformationMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ComponentUpdateInformationMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ComponentUpdateInformationMultiError) AllErrors() []error { return m } - -// ComponentUpdateInformationValidationError is the validation error returned -// by ComponentUpdateInformation.Validate if the designated constraints aren't met. -type ComponentUpdateInformationValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ComponentUpdateInformationValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ComponentUpdateInformationValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ComponentUpdateInformationValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ComponentUpdateInformationValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ComponentUpdateInformationValidationError) ErrorName() string { - return "ComponentUpdateInformationValidationError" -} - -// Error satisfies the builtin error interface -func (e ComponentUpdateInformationValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sComponentUpdateInformation.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ComponentUpdateInformationValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ComponentUpdateInformationValidationError{} - -// Validate checks the field values on ComponentsUpdateInformation with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ComponentsUpdateInformation) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ComponentsUpdateInformation with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ComponentsUpdateInformationMultiError, or nil if none found. -func (m *ComponentsUpdateInformation) ValidateAll() error { - return m.validate(true) -} - -func (m *ComponentsUpdateInformation) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - { - sorted_keys := make([]string, len(m.GetComponentToUpdateInformation())) - i := 0 - for key := range m.GetComponentToUpdateInformation() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetComponentToUpdateInformation()[key] - _ = val - - // no validation rules for ComponentToUpdateInformation[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ComponentsUpdateInformationValidationError{ - field: fmt.Sprintf("ComponentToUpdateInformation[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ComponentsUpdateInformationValidationError{ - field: fmt.Sprintf("ComponentToUpdateInformation[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ComponentsUpdateInformationValidationError{ - field: fmt.Sprintf("ComponentToUpdateInformation[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - if len(errors) > 0 { - return ComponentsUpdateInformationMultiError(errors) - } - - return nil -} - -// ComponentsUpdateInformationMultiError is an error wrapping multiple -// validation errors returned by ComponentsUpdateInformation.ValidateAll() if -// the designated constraints aren't met. -type ComponentsUpdateInformationMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ComponentsUpdateInformationMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ComponentsUpdateInformationMultiError) AllErrors() []error { return m } - -// ComponentsUpdateInformationValidationError is the validation error returned -// by ComponentsUpdateInformation.Validate if the designated constraints -// aren't met. -type ComponentsUpdateInformationValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ComponentsUpdateInformationValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ComponentsUpdateInformationValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ComponentsUpdateInformationValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ComponentsUpdateInformationValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ComponentsUpdateInformationValidationError) ErrorName() string { - return "ComponentsUpdateInformationValidationError" -} - -// Error satisfies the builtin error interface -func (e ComponentsUpdateInformationValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sComponentsUpdateInformation.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ComponentsUpdateInformationValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ComponentsUpdateInformationValidationError{} - -// Validate checks the field values on CheckForOperatorUpdateResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *CheckForOperatorUpdateResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CheckForOperatorUpdateResponse with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// CheckForOperatorUpdateResponseMultiError, or nil if none found. -func (m *CheckForOperatorUpdateResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *CheckForOperatorUpdateResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - { - sorted_keys := make([]string, len(m.GetClusterToComponents())) - i := 0 - for key := range m.GetClusterToComponents() { - sorted_keys[i] = key - i++ - } - sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) - for _, key := range sorted_keys { - val := m.GetClusterToComponents()[key] - _ = val - - // no validation rules for ClusterToComponents[key] - - if all { - switch v := interface{}(val).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CheckForOperatorUpdateResponseValidationError{ - field: fmt.Sprintf("ClusterToComponents[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CheckForOperatorUpdateResponseValidationError{ - field: fmt.Sprintf("ClusterToComponents[%v]", key), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(val).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CheckForOperatorUpdateResponseValidationError{ - field: fmt.Sprintf("ClusterToComponents[%v]", key), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - } - - if len(errors) > 0 { - return CheckForOperatorUpdateResponseMultiError(errors) - } - - return nil -} - -// CheckForOperatorUpdateResponseMultiError is an error wrapping multiple -// validation errors returned by CheckForOperatorUpdateResponse.ValidateAll() -// if the designated constraints aren't met. -type CheckForOperatorUpdateResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CheckForOperatorUpdateResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m CheckForOperatorUpdateResponseMultiError) AllErrors() []error { return m } - -// CheckForOperatorUpdateResponseValidationError is the validation error -// returned by CheckForOperatorUpdateResponse.Validate if the designated -// constraints aren't met. -type CheckForOperatorUpdateResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CheckForOperatorUpdateResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CheckForOperatorUpdateResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CheckForOperatorUpdateResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CheckForOperatorUpdateResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CheckForOperatorUpdateResponseValidationError) ErrorName() string { - return "CheckForOperatorUpdateResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e CheckForOperatorUpdateResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sCheckForOperatorUpdateResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CheckForOperatorUpdateResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CheckForOperatorUpdateResponseValidationError{} - -// Validate checks the field values on ChangeComponent_ComponentVersion with -// the rules defined in the proto definition for this message. If any rules -// are violated, the first error encountered is returned, or nil if there are -// no violations. -func (m *ChangeComponent_ComponentVersion) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangeComponent_ComponentVersion with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// ChangeComponent_ComponentVersionMultiError, or nil if none found. -func (m *ChangeComponent_ComponentVersion) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangeComponent_ComponentVersion) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetVersion()) < 1 { - err := ChangeComponent_ComponentVersionValidationError{ - field: "Version", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Disable - - // no validation rules for Enable - - if len(errors) > 0 { - return ChangeComponent_ComponentVersionMultiError(errors) - } - - return nil -} - -// ChangeComponent_ComponentVersionMultiError is an error wrapping multiple -// validation errors returned by -// ChangeComponent_ComponentVersion.ValidateAll() if the designated -// constraints aren't met. -type ChangeComponent_ComponentVersionMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangeComponent_ComponentVersionMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ChangeComponent_ComponentVersionMultiError) AllErrors() []error { return m } - -// ChangeComponent_ComponentVersionValidationError is the validation error -// returned by ChangeComponent_ComponentVersion.Validate if the designated -// constraints aren't met. -type ChangeComponent_ComponentVersionValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangeComponent_ComponentVersionValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangeComponent_ComponentVersionValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangeComponent_ComponentVersionValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangeComponent_ComponentVersionValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangeComponent_ComponentVersionValidationError) ErrorName() string { - return "ChangeComponent_ComponentVersionValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangeComponent_ComponentVersionValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sChangeComponent_ComponentVersion.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangeComponent_ComponentVersionValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangeComponent_ComponentVersionValidationError{} diff --git a/api/managementpb/dbaas/components.proto b/api/managementpb/dbaas/components.proto deleted file mode 100644 index 4cc84c3bc9..0000000000 --- a/api/managementpb/dbaas/components.proto +++ /dev/null @@ -1,169 +0,0 @@ -syntax = "proto3"; - -package dbaas.v1beta1; - -import "google/api/annotations.proto"; -import "managementpb/dbaas/dbaas.proto"; -import "validate/validate.proto"; - -option go_package = "api/managementpb/dbaas;dbaasv1beta1"; - -// Component contains information about component. -message Component { - string image_path = 1; - string image_hash = 2; - string status = 3; - bool critical = 4; - bool default = 5; - bool disabled = 6; -} - -// Matrix contains all available components. -message Matrix { - map mongod = 1; - map pxc = 2; - map pmm = 3; - map proxysql = 4; - map haproxy = 5; - map backup = 6; - map operator = 7; - map log_collector = 8; -} - -// OperatorVersion contains information about operator and components matrix. -message OperatorVersion { - string product = 1; - string operator = 2; - Matrix matrix = 3; -} - -message GetPSMDBComponentsRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1; - // Version of DB. - string db_version = 2; -} - -message GetPSMDBComponentsResponse { - repeated OperatorVersion versions = 1; -} - -message GetPXCComponentsRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1; - // Version of DB. - string db_version = 2; -} - -message GetPXCComponentsResponse { - repeated OperatorVersion versions = 1; -} - -// ChangeComponent contains fields to manage components. -message ChangeComponent { - string default_version = 1; - // ComponentVersion contains operations which should be done with component version. - message ComponentVersion { - string version = 1 [(validate.rules).string.min_len = 1]; - bool disable = 2; - bool enable = 3; - } - repeated ComponentVersion versions = 2; -} - -message ChangePSMDBComponentsRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; - ChangeComponent mongod = 2; -} - -message ChangePSMDBComponentsResponse {} - -message ChangePXCComponentsRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; - ChangeComponent pxc = 2; - ChangeComponent proxysql = 3; - ChangeComponent haproxy = 4; -} - -message ChangePXCComponentsResponse {} - -message InstallOperatorRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; - // operator_type tells what operator we are interested in updating. - string operator_type = 2 [(validate.rules).string.min_len = 1]; - // version tells what version of the operator we should update to. - string version = 3 [(validate.rules).string.min_len = 1]; -} - -message InstallOperatorResponse { - // Status tells if installation was successfull. - OperatorsStatus status = 1; -} - -message CheckForOperatorUpdateRequest {} - -// ComponentUpdateInformation contains version we can update to for certain component. -message ComponentUpdateInformation { - string available_version = 1; -} - -// ComponentsUpdateInformation contains info about components and their available latest versions. -message ComponentsUpdateInformation { - // 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. - map component_to_update_information = 1; -} - -message CheckForOperatorUpdateResponse { - // The cluster name is used as a key for this map, value contains components and their inforamtion about update. - map cluster_to_components = 1; -} - -// Components service provides public methods for managing components. -service Components { - // GetPSMDBComponents returns list of available components for PSMDB Clusters. - rpc GetPSMDBComponents(GetPSMDBComponentsRequest) returns (GetPSMDBComponentsResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/Components/GetPSMDB" - body: "*" - }; - } - // GetPXCComponents returns list of available components for PXC Clusters. - rpc GetPXCComponents(GetPXCComponentsRequest) returns (GetPXCComponentsResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/Components/GetPXC" - body: "*" - }; - } - // ChangePSMDBComponents manages PSMDB related components. - rpc ChangePSMDBComponents(ChangePSMDBComponentsRequest) returns (ChangePSMDBComponentsResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/Components/ChangePSMDB" - body: "*" - }; - } - // ChangePXCComponents manages PXC related components. - rpc ChangePXCComponents(ChangePXCComponentsRequest) returns (ChangePXCComponentsResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/Components/ChangePXC" - body: "*" - }; - } - // InstallOperator installs given operator in given version. - rpc InstallOperator(InstallOperatorRequest) returns (InstallOperatorResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/Components/InstallOperator" - body: "*" - }; - } - // CheckForOperatorUpdate checks if a new version of an operator is available. - rpc CheckForOperatorUpdate(CheckForOperatorUpdateRequest) returns (CheckForOperatorUpdateResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/Components/CheckForOperatorUpdate" - body: "*" - }; - } -} diff --git a/api/managementpb/dbaas/components_grpc.pb.go b/api/managementpb/dbaas/components_grpc.pb.go deleted file mode 100644 index 750341cfd8..0000000000 --- a/api/managementpb/dbaas/components_grpc.pb.go +++ /dev/null @@ -1,311 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: managementpb/dbaas/components.proto - -package dbaasv1beta1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - Components_GetPSMDBComponents_FullMethodName = "/dbaas.v1beta1.Components/GetPSMDBComponents" - Components_GetPXCComponents_FullMethodName = "/dbaas.v1beta1.Components/GetPXCComponents" - Components_ChangePSMDBComponents_FullMethodName = "/dbaas.v1beta1.Components/ChangePSMDBComponents" - Components_ChangePXCComponents_FullMethodName = "/dbaas.v1beta1.Components/ChangePXCComponents" - Components_InstallOperator_FullMethodName = "/dbaas.v1beta1.Components/InstallOperator" - Components_CheckForOperatorUpdate_FullMethodName = "/dbaas.v1beta1.Components/CheckForOperatorUpdate" -) - -// ComponentsClient is the client API for Components service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type ComponentsClient interface { - // GetPSMDBComponents returns list of available components for PSMDB Clusters. - GetPSMDBComponents(ctx context.Context, in *GetPSMDBComponentsRequest, opts ...grpc.CallOption) (*GetPSMDBComponentsResponse, error) - // GetPXCComponents returns list of available components for PXC Clusters. - GetPXCComponents(ctx context.Context, in *GetPXCComponentsRequest, opts ...grpc.CallOption) (*GetPXCComponentsResponse, error) - // ChangePSMDBComponents manages PSMDB related components. - ChangePSMDBComponents(ctx context.Context, in *ChangePSMDBComponentsRequest, opts ...grpc.CallOption) (*ChangePSMDBComponentsResponse, error) - // ChangePXCComponents manages PXC related components. - ChangePXCComponents(ctx context.Context, in *ChangePXCComponentsRequest, opts ...grpc.CallOption) (*ChangePXCComponentsResponse, error) - // InstallOperator installs given operator in given version. - InstallOperator(ctx context.Context, in *InstallOperatorRequest, opts ...grpc.CallOption) (*InstallOperatorResponse, error) - // CheckForOperatorUpdate checks if a new version of an operator is available. - CheckForOperatorUpdate(ctx context.Context, in *CheckForOperatorUpdateRequest, opts ...grpc.CallOption) (*CheckForOperatorUpdateResponse, error) -} - -type componentsClient struct { - cc grpc.ClientConnInterface -} - -func NewComponentsClient(cc grpc.ClientConnInterface) ComponentsClient { - return &componentsClient{cc} -} - -func (c *componentsClient) GetPSMDBComponents(ctx context.Context, in *GetPSMDBComponentsRequest, opts ...grpc.CallOption) (*GetPSMDBComponentsResponse, error) { - out := new(GetPSMDBComponentsResponse) - err := c.cc.Invoke(ctx, Components_GetPSMDBComponents_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *componentsClient) GetPXCComponents(ctx context.Context, in *GetPXCComponentsRequest, opts ...grpc.CallOption) (*GetPXCComponentsResponse, error) { - out := new(GetPXCComponentsResponse) - err := c.cc.Invoke(ctx, Components_GetPXCComponents_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *componentsClient) ChangePSMDBComponents(ctx context.Context, in *ChangePSMDBComponentsRequest, opts ...grpc.CallOption) (*ChangePSMDBComponentsResponse, error) { - out := new(ChangePSMDBComponentsResponse) - err := c.cc.Invoke(ctx, Components_ChangePSMDBComponents_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *componentsClient) ChangePXCComponents(ctx context.Context, in *ChangePXCComponentsRequest, opts ...grpc.CallOption) (*ChangePXCComponentsResponse, error) { - out := new(ChangePXCComponentsResponse) - err := c.cc.Invoke(ctx, Components_ChangePXCComponents_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *componentsClient) InstallOperator(ctx context.Context, in *InstallOperatorRequest, opts ...grpc.CallOption) (*InstallOperatorResponse, error) { - out := new(InstallOperatorResponse) - err := c.cc.Invoke(ctx, Components_InstallOperator_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *componentsClient) CheckForOperatorUpdate(ctx context.Context, in *CheckForOperatorUpdateRequest, opts ...grpc.CallOption) (*CheckForOperatorUpdateResponse, error) { - out := new(CheckForOperatorUpdateResponse) - err := c.cc.Invoke(ctx, Components_CheckForOperatorUpdate_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ComponentsServer is the server API for Components service. -// All implementations must embed UnimplementedComponentsServer -// for forward compatibility -type ComponentsServer interface { - // GetPSMDBComponents returns list of available components for PSMDB Clusters. - GetPSMDBComponents(context.Context, *GetPSMDBComponentsRequest) (*GetPSMDBComponentsResponse, error) - // GetPXCComponents returns list of available components for PXC Clusters. - GetPXCComponents(context.Context, *GetPXCComponentsRequest) (*GetPXCComponentsResponse, error) - // ChangePSMDBComponents manages PSMDB related components. - ChangePSMDBComponents(context.Context, *ChangePSMDBComponentsRequest) (*ChangePSMDBComponentsResponse, error) - // ChangePXCComponents manages PXC related components. - ChangePXCComponents(context.Context, *ChangePXCComponentsRequest) (*ChangePXCComponentsResponse, error) - // InstallOperator installs given operator in given version. - InstallOperator(context.Context, *InstallOperatorRequest) (*InstallOperatorResponse, error) - // CheckForOperatorUpdate checks if a new version of an operator is available. - CheckForOperatorUpdate(context.Context, *CheckForOperatorUpdateRequest) (*CheckForOperatorUpdateResponse, error) - mustEmbedUnimplementedComponentsServer() -} - -// UnimplementedComponentsServer must be embedded to have forward compatible implementations. -type UnimplementedComponentsServer struct{} - -func (UnimplementedComponentsServer) GetPSMDBComponents(context.Context, *GetPSMDBComponentsRequest) (*GetPSMDBComponentsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetPSMDBComponents not implemented") -} - -func (UnimplementedComponentsServer) GetPXCComponents(context.Context, *GetPXCComponentsRequest) (*GetPXCComponentsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetPXCComponents not implemented") -} - -func (UnimplementedComponentsServer) ChangePSMDBComponents(context.Context, *ChangePSMDBComponentsRequest) (*ChangePSMDBComponentsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChangePSMDBComponents not implemented") -} - -func (UnimplementedComponentsServer) ChangePXCComponents(context.Context, *ChangePXCComponentsRequest) (*ChangePXCComponentsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChangePXCComponents not implemented") -} - -func (UnimplementedComponentsServer) InstallOperator(context.Context, *InstallOperatorRequest) (*InstallOperatorResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InstallOperator not implemented") -} - -func (UnimplementedComponentsServer) CheckForOperatorUpdate(context.Context, *CheckForOperatorUpdateRequest) (*CheckForOperatorUpdateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CheckForOperatorUpdate not implemented") -} -func (UnimplementedComponentsServer) mustEmbedUnimplementedComponentsServer() {} - -// UnsafeComponentsServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ComponentsServer will -// result in compilation errors. -type UnsafeComponentsServer interface { - mustEmbedUnimplementedComponentsServer() -} - -func RegisterComponentsServer(s grpc.ServiceRegistrar, srv ComponentsServer) { - s.RegisterService(&Components_ServiceDesc, srv) -} - -func _Components_GetPSMDBComponents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetPSMDBComponentsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ComponentsServer).GetPSMDBComponents(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Components_GetPSMDBComponents_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ComponentsServer).GetPSMDBComponents(ctx, req.(*GetPSMDBComponentsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Components_GetPXCComponents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetPXCComponentsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ComponentsServer).GetPXCComponents(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Components_GetPXCComponents_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ComponentsServer).GetPXCComponents(ctx, req.(*GetPXCComponentsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Components_ChangePSMDBComponents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangePSMDBComponentsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ComponentsServer).ChangePSMDBComponents(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Components_ChangePSMDBComponents_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ComponentsServer).ChangePSMDBComponents(ctx, req.(*ChangePSMDBComponentsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Components_ChangePXCComponents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangePXCComponentsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ComponentsServer).ChangePXCComponents(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Components_ChangePXCComponents_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ComponentsServer).ChangePXCComponents(ctx, req.(*ChangePXCComponentsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Components_InstallOperator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InstallOperatorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ComponentsServer).InstallOperator(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Components_InstallOperator_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ComponentsServer).InstallOperator(ctx, req.(*InstallOperatorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Components_CheckForOperatorUpdate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CheckForOperatorUpdateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ComponentsServer).CheckForOperatorUpdate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Components_CheckForOperatorUpdate_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ComponentsServer).CheckForOperatorUpdate(ctx, req.(*CheckForOperatorUpdateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Components_ServiceDesc is the grpc.ServiceDesc for Components service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Components_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "dbaas.v1beta1.Components", - HandlerType: (*ComponentsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetPSMDBComponents", - Handler: _Components_GetPSMDBComponents_Handler, - }, - { - MethodName: "GetPXCComponents", - Handler: _Components_GetPXCComponents_Handler, - }, - { - MethodName: "ChangePSMDBComponents", - Handler: _Components_ChangePSMDBComponents_Handler, - }, - { - MethodName: "ChangePXCComponents", - Handler: _Components_ChangePXCComponents_Handler, - }, - { - MethodName: "InstallOperator", - Handler: _Components_InstallOperator_Handler, - }, - { - MethodName: "CheckForOperatorUpdate", - Handler: _Components_CheckForOperatorUpdate_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "managementpb/dbaas/components.proto", -} diff --git a/api/managementpb/dbaas/db_clusters.pb.go b/api/managementpb/dbaas/db_clusters.pb.go deleted file mode 100644 index 2b8a099e89..0000000000 --- a/api/managementpb/dbaas/db_clusters.pb.go +++ /dev/null @@ -1,1667 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: managementpb/dbaas/db_clusters.proto - -package dbaasv1beta1 - -import ( - reflect "reflect" - sync "sync" - - _ "github.com/envoyproxy/protoc-gen-validate/validate" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// DBClusterState represents DB cluster CR state. -type DBClusterState int32 - -const ( - // DB_CLUSTER_STATE_INVALID represents unknown state. - DBClusterState_DB_CLUSTER_STATE_INVALID DBClusterState = 0 - // DB_CLUSTER_STATE_CHANGING represents a cluster being changed. - DBClusterState_DB_CLUSTER_STATE_CHANGING DBClusterState = 1 - // DB_CLUSTER_STATE_READY represents a cluster without pending changes. - DBClusterState_DB_CLUSTER_STATE_READY DBClusterState = 2 - // DB_CLUSTER_STATE_FAILED represents a failed cluster. - DBClusterState_DB_CLUSTER_STATE_FAILED DBClusterState = 3 - // DB_CLUSTER_STATE_DELETING represents a cluster being deleting. - DBClusterState_DB_CLUSTER_STATE_DELETING DBClusterState = 4 - // DB_CLUSTER_STATE_PAUSED represents a cluster is paused. - DBClusterState_DB_CLUSTER_STATE_PAUSED DBClusterState = 5 - // DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING. - // It indicates database cluster upgrade is ongoing. - DBClusterState_DB_CLUSTER_STATE_UPGRADING DBClusterState = 6 -) - -// Enum value maps for DBClusterState. -var ( - DBClusterState_name = map[int32]string{ - 0: "DB_CLUSTER_STATE_INVALID", - 1: "DB_CLUSTER_STATE_CHANGING", - 2: "DB_CLUSTER_STATE_READY", - 3: "DB_CLUSTER_STATE_FAILED", - 4: "DB_CLUSTER_STATE_DELETING", - 5: "DB_CLUSTER_STATE_PAUSED", - 6: "DB_CLUSTER_STATE_UPGRADING", - } - DBClusterState_value = map[string]int32{ - "DB_CLUSTER_STATE_INVALID": 0, - "DB_CLUSTER_STATE_CHANGING": 1, - "DB_CLUSTER_STATE_READY": 2, - "DB_CLUSTER_STATE_FAILED": 3, - "DB_CLUSTER_STATE_DELETING": 4, - "DB_CLUSTER_STATE_PAUSED": 5, - "DB_CLUSTER_STATE_UPGRADING": 6, - } -) - -func (x DBClusterState) Enum() *DBClusterState { - p := new(DBClusterState) - *p = x - return p -} - -func (x DBClusterState) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DBClusterState) Descriptor() protoreflect.EnumDescriptor { - return file_managementpb_dbaas_db_clusters_proto_enumTypes[0].Descriptor() -} - -func (DBClusterState) Type() protoreflect.EnumType { - return &file_managementpb_dbaas_db_clusters_proto_enumTypes[0] -} - -func (x DBClusterState) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DBClusterState.Descriptor instead. -func (DBClusterState) EnumDescriptor() ([]byte, []int) { - return file_managementpb_dbaas_db_clusters_proto_rawDescGZIP(), []int{0} -} - -// PSMDBCluster represents PSMDB cluster information. -type PSMDBCluster struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Cluster name. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Cluster state. - State DBClusterState `protobuf:"varint,2,opt,name=state,proto3,enum=dbaas.v1beta1.DBClusterState" json:"state,omitempty"` - // Currently running operation, if any. - Operation *RunningOperation `protobuf:"bytes,3,opt,name=operation,proto3" json:"operation,omitempty"` - // Cluster parameters. - Params *PSMDBClusterParams `protobuf:"bytes,4,opt,name=params,proto3" json:"params,omitempty"` - // DB cluster accessible outside of K8s cluster. - Exposed bool `protobuf:"varint,5,opt,name=exposed,proto3" json:"exposed,omitempty"` - // Installed PSMDB image. - InstalledImage string `protobuf:"bytes,6,opt,name=installed_image,json=installedImage,proto3" json:"installed_image,omitempty"` - // Available database version user can upgrade cluster to, returned as an image. Image tag contains the version. - // If it's empty, no upgrade is available. - AvailableImage string `protobuf:"bytes,7,opt,name=available_image,json=availableImage,proto3" json:"available_image,omitempty"` - // Is DB cluster accessible via public internet. - InternetFacing bool `protobuf:"varint,8,opt,name=internet_facing,json=internetFacing,proto3" json:"internet_facing,omitempty"` - // Backup configuration parameters. - Backup *Backup `protobuf:"bytes,9,opt,name=backup,proto3" json:"backup,omitempty"` - // Restore configuration parameters. - Restore *Restore `protobuf:"bytes,10,opt,name=restore,proto3" json:"restore,omitempty"` - // Apply IP source ranges against the cluster. - SourceRanges []string `protobuf:"bytes,12,rep,name=source_ranges,json=sourceRanges,proto3" json:"source_ranges,omitempty"` - // Configuration template. - Template *Template `protobuf:"bytes,11,opt,name=template,proto3" json:"template,omitempty"` -} - -func (x *PSMDBCluster) Reset() { - *x = PSMDBCluster{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PSMDBCluster) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PSMDBCluster) ProtoMessage() {} - -func (x *PSMDBCluster) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PSMDBCluster.ProtoReflect.Descriptor instead. -func (*PSMDBCluster) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_db_clusters_proto_rawDescGZIP(), []int{0} -} - -func (x *PSMDBCluster) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *PSMDBCluster) GetState() DBClusterState { - if x != nil { - return x.State - } - return DBClusterState_DB_CLUSTER_STATE_INVALID -} - -func (x *PSMDBCluster) GetOperation() *RunningOperation { - if x != nil { - return x.Operation - } - return nil -} - -func (x *PSMDBCluster) GetParams() *PSMDBClusterParams { - if x != nil { - return x.Params - } - return nil -} - -func (x *PSMDBCluster) GetExposed() bool { - if x != nil { - return x.Exposed - } - return false -} - -func (x *PSMDBCluster) GetInstalledImage() string { - if x != nil { - return x.InstalledImage - } - return "" -} - -func (x *PSMDBCluster) GetAvailableImage() string { - if x != nil { - return x.AvailableImage - } - return "" -} - -func (x *PSMDBCluster) GetInternetFacing() bool { - if x != nil { - return x.InternetFacing - } - return false -} - -func (x *PSMDBCluster) GetBackup() *Backup { - if x != nil { - return x.Backup - } - return nil -} - -func (x *PSMDBCluster) GetRestore() *Restore { - if x != nil { - return x.Restore - } - return nil -} - -func (x *PSMDBCluster) GetSourceRanges() []string { - if x != nil { - return x.SourceRanges - } - return nil -} - -func (x *PSMDBCluster) GetTemplate() *Template { - if x != nil { - return x.Template - } - return nil -} - -// PXCCluster represents PXC cluster information. -type PXCCluster struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Cluster name. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Cluster state. - State DBClusterState `protobuf:"varint,2,opt,name=state,proto3,enum=dbaas.v1beta1.DBClusterState" json:"state,omitempty"` - // Currently running operation, if any. - Operation *RunningOperation `protobuf:"bytes,3,opt,name=operation,proto3" json:"operation,omitempty"` - // Cluster parameters. - Params *PXCClusterParams `protobuf:"bytes,4,opt,name=params,proto3" json:"params,omitempty"` - // DB cluster accessible outside of K8s cluster. - Exposed bool `protobuf:"varint,5,opt,name=exposed,proto3" json:"exposed,omitempty"` - // Installed XtraDB image. - InstalledImage string `protobuf:"bytes,6,opt,name=installed_image,json=installedImage,proto3" json:"installed_image,omitempty"` - // Available database version user can upgrade cluster to, returned as an image. Image tag contains the version. - // If it's empty, no upgrade is available. - AvailableImage string `protobuf:"bytes,7,opt,name=available_image,json=availableImage,proto3" json:"available_image,omitempty"` - // Is DB cluster accessible via public internet. - InternetFacing bool `protobuf:"varint,8,opt,name=internet_facing,json=internetFacing,proto3" json:"internet_facing,omitempty"` - // Backup configuration parameters. - Backup *Backup `protobuf:"bytes,9,opt,name=backup,proto3" json:"backup,omitempty"` - // Restore configuration parameters. - Restore *Restore `protobuf:"bytes,10,opt,name=restore,proto3" json:"restore,omitempty"` - // Apply IP source ranges against the cluster. - SourceRanges []string `protobuf:"bytes,12,rep,name=source_ranges,json=sourceRanges,proto3" json:"source_ranges,omitempty"` - // Configuration template. - Template *Template `protobuf:"bytes,11,opt,name=template,proto3" json:"template,omitempty"` -} - -func (x *PXCCluster) Reset() { - *x = PXCCluster{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PXCCluster) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PXCCluster) ProtoMessage() {} - -func (x *PXCCluster) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PXCCluster.ProtoReflect.Descriptor instead. -func (*PXCCluster) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_db_clusters_proto_rawDescGZIP(), []int{1} -} - -func (x *PXCCluster) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *PXCCluster) GetState() DBClusterState { - if x != nil { - return x.State - } - return DBClusterState_DB_CLUSTER_STATE_INVALID -} - -func (x *PXCCluster) GetOperation() *RunningOperation { - if x != nil { - return x.Operation - } - return nil -} - -func (x *PXCCluster) GetParams() *PXCClusterParams { - if x != nil { - return x.Params - } - return nil -} - -func (x *PXCCluster) GetExposed() bool { - if x != nil { - return x.Exposed - } - return false -} - -func (x *PXCCluster) GetInstalledImage() string { - if x != nil { - return x.InstalledImage - } - return "" -} - -func (x *PXCCluster) GetAvailableImage() string { - if x != nil { - return x.AvailableImage - } - return "" -} - -func (x *PXCCluster) GetInternetFacing() bool { - if x != nil { - return x.InternetFacing - } - return false -} - -func (x *PXCCluster) GetBackup() *Backup { - if x != nil { - return x.Backup - } - return nil -} - -func (x *PXCCluster) GetRestore() *Restore { - if x != nil { - return x.Restore - } - return nil -} - -func (x *PXCCluster) GetSourceRanges() []string { - if x != nil { - return x.SourceRanges - } - return nil -} - -func (x *PXCCluster) GetTemplate() *Template { - if x != nil { - return x.Template - } - return nil -} - -type ListDBClustersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` -} - -func (x *ListDBClustersRequest) Reset() { - *x = ListDBClustersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListDBClustersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListDBClustersRequest) ProtoMessage() {} - -func (x *ListDBClustersRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListDBClustersRequest.ProtoReflect.Descriptor instead. -func (*ListDBClustersRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_db_clusters_proto_rawDescGZIP(), []int{2} -} - -func (x *ListDBClustersRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -type ListDBClustersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // PXC clusters information. - PxcClusters []*PXCCluster `protobuf:"bytes,1,rep,name=pxc_clusters,json=pxcClusters,proto3" json:"pxc_clusters,omitempty"` - // PSMDB clusters information. - PsmdbClusters []*PSMDBCluster `protobuf:"bytes,2,rep,name=psmdb_clusters,json=psmdbClusters,proto3" json:"psmdb_clusters,omitempty"` -} - -func (x *ListDBClustersResponse) Reset() { - *x = ListDBClustersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListDBClustersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListDBClustersResponse) ProtoMessage() {} - -func (x *ListDBClustersResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListDBClustersResponse.ProtoReflect.Descriptor instead. -func (*ListDBClustersResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_db_clusters_proto_rawDescGZIP(), []int{3} -} - -func (x *ListDBClustersResponse) GetPxcClusters() []*PXCCluster { - if x != nil { - return x.PxcClusters - } - return nil -} - -func (x *ListDBClustersResponse) GetPsmdbClusters() []*PSMDBCluster { - if x != nil { - return x.PsmdbClusters - } - return nil -} - -type RestartDBClusterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - // PXC cluster name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // DB cluster type. - ClusterType DBClusterType `protobuf:"varint,3,opt,name=cluster_type,json=clusterType,proto3,enum=dbaas.v1beta1.DBClusterType" json:"cluster_type,omitempty"` -} - -func (x *RestartDBClusterRequest) Reset() { - *x = RestartDBClusterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RestartDBClusterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RestartDBClusterRequest) ProtoMessage() {} - -func (x *RestartDBClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RestartDBClusterRequest.ProtoReflect.Descriptor instead. -func (*RestartDBClusterRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_db_clusters_proto_rawDescGZIP(), []int{4} -} - -func (x *RestartDBClusterRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *RestartDBClusterRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *RestartDBClusterRequest) GetClusterType() DBClusterType { - if x != nil { - return x.ClusterType - } - return DBClusterType_DB_CLUSTER_TYPE_INVALID -} - -type RestartDBClusterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RestartDBClusterResponse) Reset() { - *x = RestartDBClusterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RestartDBClusterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RestartDBClusterResponse) ProtoMessage() {} - -func (x *RestartDBClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RestartDBClusterResponse.ProtoReflect.Descriptor instead. -func (*RestartDBClusterResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_db_clusters_proto_rawDescGZIP(), []int{5} -} - -type GetDBClusterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - // DB cluster name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *GetDBClusterRequest) Reset() { - *x = GetDBClusterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDBClusterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDBClusterRequest) ProtoMessage() {} - -func (x *GetDBClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetDBClusterRequest.ProtoReflect.Descriptor instead. -func (*GetDBClusterRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_db_clusters_proto_rawDescGZIP(), []int{6} -} - -func (x *GetDBClusterRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *GetDBClusterRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type GetDBClusterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // PXC cluster information. - PxcCluster *PXCCluster `protobuf:"bytes,1,opt,name=pxc_cluster,json=pxcCluster,proto3" json:"pxc_cluster,omitempty"` - // PSMDB cluster information. - PsmdbCluster *PSMDBCluster `protobuf:"bytes,2,opt,name=psmdb_cluster,json=psmdbCluster,proto3" json:"psmdb_cluster,omitempty"` -} - -func (x *GetDBClusterResponse) Reset() { - *x = GetDBClusterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDBClusterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDBClusterResponse) ProtoMessage() {} - -func (x *GetDBClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetDBClusterResponse.ProtoReflect.Descriptor instead. -func (*GetDBClusterResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_db_clusters_proto_rawDescGZIP(), []int{7} -} - -func (x *GetDBClusterResponse) GetPxcCluster() *PXCCluster { - if x != nil { - return x.PxcCluster - } - return nil -} - -func (x *GetDBClusterResponse) GetPsmdbCluster() *PSMDBCluster { - if x != nil { - return x.PsmdbCluster - } - return nil -} - -type DeleteDBClusterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - // DB cluster name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // DB cluster type. - ClusterType DBClusterType `protobuf:"varint,3,opt,name=cluster_type,json=clusterType,proto3,enum=dbaas.v1beta1.DBClusterType" json:"cluster_type,omitempty"` -} - -func (x *DeleteDBClusterRequest) Reset() { - *x = DeleteDBClusterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteDBClusterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteDBClusterRequest) ProtoMessage() {} - -func (x *DeleteDBClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteDBClusterRequest.ProtoReflect.Descriptor instead. -func (*DeleteDBClusterRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_db_clusters_proto_rawDescGZIP(), []int{8} -} - -func (x *DeleteDBClusterRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *DeleteDBClusterRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *DeleteDBClusterRequest) GetClusterType() DBClusterType { - if x != nil { - return x.ClusterType - } - return DBClusterType_DB_CLUSTER_TYPE_INVALID -} - -type DeleteDBClusterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteDBClusterResponse) Reset() { - *x = DeleteDBClusterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteDBClusterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteDBClusterResponse) ProtoMessage() {} - -func (x *DeleteDBClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteDBClusterResponse.ProtoReflect.Descriptor instead. -func (*DeleteDBClusterResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_db_clusters_proto_rawDescGZIP(), []int{9} -} - -type S3Item struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Key of a filename on s3. - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` -} - -func (x *S3Item) Reset() { - *x = S3Item{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *S3Item) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*S3Item) ProtoMessage() {} - -func (x *S3Item) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use S3Item.ProtoReflect.Descriptor instead. -func (*S3Item) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_db_clusters_proto_rawDescGZIP(), []int{10} -} - -func (x *S3Item) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -type ListS3BackupsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Backup Location ID to list backups from - LocationId string `protobuf:"bytes,1,opt,name=location_id,json=locationId,proto3" json:"location_id,omitempty"` -} - -func (x *ListS3BackupsRequest) Reset() { - *x = ListS3BackupsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListS3BackupsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListS3BackupsRequest) ProtoMessage() {} - -func (x *ListS3BackupsRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListS3BackupsRequest.ProtoReflect.Descriptor instead. -func (*ListS3BackupsRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_db_clusters_proto_rawDescGZIP(), []int{11} -} - -func (x *ListS3BackupsRequest) GetLocationId() string { - if x != nil { - return x.LocationId - } - return "" -} - -type ListS3BackupsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Backup list. - Backups []*S3Item `protobuf:"bytes,1,rep,name=backups,proto3" json:"backups,omitempty"` -} - -func (x *ListS3BackupsResponse) Reset() { - *x = ListS3BackupsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListS3BackupsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListS3BackupsResponse) ProtoMessage() {} - -func (x *ListS3BackupsResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListS3BackupsResponse.ProtoReflect.Descriptor instead. -func (*ListS3BackupsResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_db_clusters_proto_rawDescGZIP(), []int{12} -} - -func (x *ListS3BackupsResponse) GetBackups() []*S3Item { - if x != nil { - return x.Backups - } - return nil -} - -type ListSecretsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` -} - -func (x *ListSecretsRequest) Reset() { - *x = ListSecretsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSecretsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSecretsRequest) ProtoMessage() {} - -func (x *ListSecretsRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSecretsRequest.ProtoReflect.Descriptor instead. -func (*ListSecretsRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_db_clusters_proto_rawDescGZIP(), []int{13} -} - -func (x *ListSecretsRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -type Secret struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name of a secret - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *Secret) Reset() { - *x = Secret{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Secret) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Secret) ProtoMessage() {} - -func (x *Secret) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Secret.ProtoReflect.Descriptor instead. -func (*Secret) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_db_clusters_proto_rawDescGZIP(), []int{14} -} - -func (x *Secret) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type ListSecretsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Secret list. - Secrets []*Secret `protobuf:"bytes,1,rep,name=secrets,proto3" json:"secrets,omitempty"` -} - -func (x *ListSecretsResponse) Reset() { - *x = ListSecretsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSecretsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSecretsResponse) ProtoMessage() {} - -func (x *ListSecretsResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_db_clusters_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSecretsResponse.ProtoReflect.Descriptor instead. -func (*ListSecretsResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_db_clusters_proto_rawDescGZIP(), []int{15} -} - -func (x *ListSecretsResponse) GetSecrets() []*Secret { - if x != nil { - return x.Secrets - } - return nil -} - -var File_managementpb_dbaas_db_clusters_proto protoreflect.FileDescriptor - -var file_managementpb_dbaas_db_clusters_proto_rawDesc = []byte{ - 0x0a, 0x24, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2f, 0x64, 0x62, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, - 0x62, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, - 0x62, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2f, 0x70, 0x73, 0x6d, 0x64, 0x62, 0x5f, 0x63, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x25, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, - 0x2f, 0x70, 0x78, 0x63, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, - 0x62, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xa1, 0x04, 0x0a, 0x0c, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3d, 0x0a, 0x09, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x75, - 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, - 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x06, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x64, 0x62, 0x61, 0x61, - 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x12, 0x27, - 0x0a, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x65, 0x64, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x76, 0x61, 0x69, 0x6c, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, - 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x5f, 0x66, 0x61, 0x63, - 0x69, 0x6e, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x46, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x12, 0x2d, 0x0a, 0x06, 0x62, 0x61, 0x63, - 0x6b, 0x75, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x61, 0x61, - 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, - 0x52, 0x06, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x30, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x64, 0x62, 0x61, 0x61, - 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x52, 0x07, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, - 0x33, 0x0a, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x22, 0x9d, 0x04, 0x0a, 0x0a, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3d, 0x0a, 0x09, - 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1f, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x06, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x64, 0x62, - 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x58, 0x43, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x12, 0x27, - 0x0a, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x65, 0x64, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x76, 0x61, 0x69, 0x6c, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, - 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x5f, 0x66, 0x61, 0x63, - 0x69, 0x6e, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x46, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x12, 0x2d, 0x0a, 0x06, 0x62, 0x61, 0x63, - 0x6b, 0x75, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x61, 0x61, - 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, - 0x52, 0x06, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x30, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x64, 0x62, 0x61, 0x61, - 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x52, 0x07, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, - 0x33, 0x0a, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x22, 0x58, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x42, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, - 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, - 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x15, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, - 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x9a, - 0x01, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x70, 0x78, 0x63, - 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x0b, 0x70, 0x78, 0x63, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x42, 0x0a, 0x0e, 0x70, 0x73, 0x6d, 0x64, 0x62, - 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1b, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x0d, 0x70, 0x73, - 0x6d, 0x64, 0x62, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x22, 0xc2, 0x01, 0x0a, 0x17, - 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, - 0x01, 0x52, 0x15, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x64, 0x62, - 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x42, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, - 0x02, 0x10, 0x01, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, - 0x22, 0x1a, 0x0a, 0x18, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x42, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x73, 0x0a, 0x13, - 0x47, 0x65, 0x74, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, - 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x15, 0x6b, - 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x22, 0x94, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0b, 0x70, 0x78, - 0x63, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x0a, 0x70, 0x78, 0x63, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x0d, 0x70, 0x73, 0x6d, 0x64, 0x62, 0x5f, - 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x53, - 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x0c, 0x70, 0x73, 0x6d, 0x64, - 0x62, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x22, 0xc1, 0x01, 0x0a, 0x16, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, - 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x15, 0x6b, - 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, - 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x22, 0x19, 0x0a, 0x17, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x0a, 0x06, 0x53, 0x33, 0x49, 0x74, 0x65, - 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x22, 0x37, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x33, 0x42, 0x61, 0x63, - 0x6b, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x48, 0x0a, 0x15, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x33, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x33, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x62, - 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x22, 0x55, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, - 0x63, 0x72, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x17, - 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, - 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x15, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, - 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x1c, 0x0a, - 0x06, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x46, 0x0a, 0x13, 0x4c, - 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x07, 0x73, 0x65, 0x63, 0x72, - 0x65, 0x74, 0x73, 0x2a, 0xe2, 0x01, 0x0a, 0x0e, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x44, 0x42, 0x5f, 0x43, 0x4c, 0x55, - 0x53, 0x54, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, - 0x49, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x44, 0x42, 0x5f, 0x43, 0x4c, 0x55, 0x53, 0x54, - 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x49, 0x4e, - 0x47, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x44, 0x42, 0x5f, 0x43, 0x4c, 0x55, 0x53, 0x54, 0x45, - 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x59, 0x10, 0x02, 0x12, - 0x1b, 0x0a, 0x17, 0x44, 0x42, 0x5f, 0x43, 0x4c, 0x55, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x53, 0x54, - 0x41, 0x54, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1d, 0x0a, 0x19, - 0x44, 0x42, 0x5f, 0x43, 0x4c, 0x55, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, - 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x1b, 0x0a, 0x17, 0x44, - 0x42, 0x5f, 0x43, 0x4c, 0x55, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, - 0x50, 0x41, 0x55, 0x53, 0x45, 0x44, 0x10, 0x05, 0x12, 0x1e, 0x0a, 0x1a, 0x44, 0x42, 0x5f, 0x43, - 0x4c, 0x55, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x50, 0x47, - 0x52, 0x41, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x06, 0x32, 0xe7, 0x06, 0x0a, 0x0a, 0x44, 0x42, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x8e, 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, - 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x24, 0x2e, 0x64, 0x62, 0x61, - 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, - 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x25, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, - 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, 0x2f, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x73, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x87, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, - 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x64, 0x62, 0x61, 0x61, - 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x42, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x22, 0x23, 0x2f, - 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, - 0x61, 0x61, 0x53, 0x2f, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x2f, 0x47, - 0x65, 0x74, 0x12, 0x97, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x42, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x26, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, - 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x27, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, - 0x3a, 0x01, 0x2a, 0x22, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, 0x2f, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x73, 0x2f, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x93, 0x01, 0x0a, - 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x12, 0x25, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x42, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x3a, 0x01, 0x2a, 0x22, 0x26, 0x2f, 0x76, 0x31, 0x2f, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, - 0x2f, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x2f, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x12, 0x88, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x33, 0x42, 0x61, 0x63, - 0x6b, 0x75, 0x70, 0x73, 0x12, 0x23, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x33, 0x42, 0x61, 0x63, 0x6b, 0x75, - 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x64, 0x62, 0x61, 0x61, - 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x33, - 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x76, 0x31, 0x2f, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, - 0x2f, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x82, 0x01, - 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x12, 0x21, 0x2e, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x22, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, - 0x21, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, - 0x44, 0x42, 0x61, 0x61, 0x53, 0x2f, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x2f, 0x4c, 0x69, - 0x73, 0x74, 0x42, 0xb5, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0f, 0x44, 0x62, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, - 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x3b, 0x64, 0x62, 0x61, 0x61, 0x73, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x0d, - 0x44, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x0d, - 0x44, 0x62, 0x61, 0x61, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x19, - 0x44, 0x62, 0x61, 0x61, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x44, 0x62, 0x61, 0x61, - 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_managementpb_dbaas_db_clusters_proto_rawDescOnce sync.Once - file_managementpb_dbaas_db_clusters_proto_rawDescData = file_managementpb_dbaas_db_clusters_proto_rawDesc -) - -func file_managementpb_dbaas_db_clusters_proto_rawDescGZIP() []byte { - file_managementpb_dbaas_db_clusters_proto_rawDescOnce.Do(func() { - file_managementpb_dbaas_db_clusters_proto_rawDescData = protoimpl.X.CompressGZIP(file_managementpb_dbaas_db_clusters_proto_rawDescData) - }) - return file_managementpb_dbaas_db_clusters_proto_rawDescData -} - -var ( - file_managementpb_dbaas_db_clusters_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_managementpb_dbaas_db_clusters_proto_msgTypes = make([]protoimpl.MessageInfo, 16) - file_managementpb_dbaas_db_clusters_proto_goTypes = []interface{}{ - (DBClusterState)(0), // 0: dbaas.v1beta1.DBClusterState - (*PSMDBCluster)(nil), // 1: dbaas.v1beta1.PSMDBCluster - (*PXCCluster)(nil), // 2: dbaas.v1beta1.PXCCluster - (*ListDBClustersRequest)(nil), // 3: dbaas.v1beta1.ListDBClustersRequest - (*ListDBClustersResponse)(nil), // 4: dbaas.v1beta1.ListDBClustersResponse - (*RestartDBClusterRequest)(nil), // 5: dbaas.v1beta1.RestartDBClusterRequest - (*RestartDBClusterResponse)(nil), // 6: dbaas.v1beta1.RestartDBClusterResponse - (*GetDBClusterRequest)(nil), // 7: dbaas.v1beta1.GetDBClusterRequest - (*GetDBClusterResponse)(nil), // 8: dbaas.v1beta1.GetDBClusterResponse - (*DeleteDBClusterRequest)(nil), // 9: dbaas.v1beta1.DeleteDBClusterRequest - (*DeleteDBClusterResponse)(nil), // 10: dbaas.v1beta1.DeleteDBClusterResponse - (*S3Item)(nil), // 11: dbaas.v1beta1.S3Item - (*ListS3BackupsRequest)(nil), // 12: dbaas.v1beta1.ListS3BackupsRequest - (*ListS3BackupsResponse)(nil), // 13: dbaas.v1beta1.ListS3BackupsResponse - (*ListSecretsRequest)(nil), // 14: dbaas.v1beta1.ListSecretsRequest - (*Secret)(nil), // 15: dbaas.v1beta1.Secret - (*ListSecretsResponse)(nil), // 16: dbaas.v1beta1.ListSecretsResponse - (*RunningOperation)(nil), // 17: dbaas.v1beta1.RunningOperation - (*PSMDBClusterParams)(nil), // 18: dbaas.v1beta1.PSMDBClusterParams - (*Backup)(nil), // 19: dbaas.v1beta1.Backup - (*Restore)(nil), // 20: dbaas.v1beta1.Restore - (*Template)(nil), // 21: dbaas.v1beta1.Template - (*PXCClusterParams)(nil), // 22: dbaas.v1beta1.PXCClusterParams - (DBClusterType)(0), // 23: dbaas.v1beta1.DBClusterType - } -) - -var file_managementpb_dbaas_db_clusters_proto_depIdxs = []int32{ - 0, // 0: dbaas.v1beta1.PSMDBCluster.state:type_name -> dbaas.v1beta1.DBClusterState - 17, // 1: dbaas.v1beta1.PSMDBCluster.operation:type_name -> dbaas.v1beta1.RunningOperation - 18, // 2: dbaas.v1beta1.PSMDBCluster.params:type_name -> dbaas.v1beta1.PSMDBClusterParams - 19, // 3: dbaas.v1beta1.PSMDBCluster.backup:type_name -> dbaas.v1beta1.Backup - 20, // 4: dbaas.v1beta1.PSMDBCluster.restore:type_name -> dbaas.v1beta1.Restore - 21, // 5: dbaas.v1beta1.PSMDBCluster.template:type_name -> dbaas.v1beta1.Template - 0, // 6: dbaas.v1beta1.PXCCluster.state:type_name -> dbaas.v1beta1.DBClusterState - 17, // 7: dbaas.v1beta1.PXCCluster.operation:type_name -> dbaas.v1beta1.RunningOperation - 22, // 8: dbaas.v1beta1.PXCCluster.params:type_name -> dbaas.v1beta1.PXCClusterParams - 19, // 9: dbaas.v1beta1.PXCCluster.backup:type_name -> dbaas.v1beta1.Backup - 20, // 10: dbaas.v1beta1.PXCCluster.restore:type_name -> dbaas.v1beta1.Restore - 21, // 11: dbaas.v1beta1.PXCCluster.template:type_name -> dbaas.v1beta1.Template - 2, // 12: dbaas.v1beta1.ListDBClustersResponse.pxc_clusters:type_name -> dbaas.v1beta1.PXCCluster - 1, // 13: dbaas.v1beta1.ListDBClustersResponse.psmdb_clusters:type_name -> dbaas.v1beta1.PSMDBCluster - 23, // 14: dbaas.v1beta1.RestartDBClusterRequest.cluster_type:type_name -> dbaas.v1beta1.DBClusterType - 2, // 15: dbaas.v1beta1.GetDBClusterResponse.pxc_cluster:type_name -> dbaas.v1beta1.PXCCluster - 1, // 16: dbaas.v1beta1.GetDBClusterResponse.psmdb_cluster:type_name -> dbaas.v1beta1.PSMDBCluster - 23, // 17: dbaas.v1beta1.DeleteDBClusterRequest.cluster_type:type_name -> dbaas.v1beta1.DBClusterType - 11, // 18: dbaas.v1beta1.ListS3BackupsResponse.backups:type_name -> dbaas.v1beta1.S3Item - 15, // 19: dbaas.v1beta1.ListSecretsResponse.secrets:type_name -> dbaas.v1beta1.Secret - 3, // 20: dbaas.v1beta1.DBClusters.ListDBClusters:input_type -> dbaas.v1beta1.ListDBClustersRequest - 7, // 21: dbaas.v1beta1.DBClusters.GetDBCluster:input_type -> dbaas.v1beta1.GetDBClusterRequest - 5, // 22: dbaas.v1beta1.DBClusters.RestartDBCluster:input_type -> dbaas.v1beta1.RestartDBClusterRequest - 9, // 23: dbaas.v1beta1.DBClusters.DeleteDBCluster:input_type -> dbaas.v1beta1.DeleteDBClusterRequest - 12, // 24: dbaas.v1beta1.DBClusters.ListS3Backups:input_type -> dbaas.v1beta1.ListS3BackupsRequest - 14, // 25: dbaas.v1beta1.DBClusters.ListSecrets:input_type -> dbaas.v1beta1.ListSecretsRequest - 4, // 26: dbaas.v1beta1.DBClusters.ListDBClusters:output_type -> dbaas.v1beta1.ListDBClustersResponse - 8, // 27: dbaas.v1beta1.DBClusters.GetDBCluster:output_type -> dbaas.v1beta1.GetDBClusterResponse - 6, // 28: dbaas.v1beta1.DBClusters.RestartDBCluster:output_type -> dbaas.v1beta1.RestartDBClusterResponse - 10, // 29: dbaas.v1beta1.DBClusters.DeleteDBCluster:output_type -> dbaas.v1beta1.DeleteDBClusterResponse - 13, // 30: dbaas.v1beta1.DBClusters.ListS3Backups:output_type -> dbaas.v1beta1.ListS3BackupsResponse - 16, // 31: dbaas.v1beta1.DBClusters.ListSecrets:output_type -> dbaas.v1beta1.ListSecretsResponse - 26, // [26:32] is the sub-list for method output_type - 20, // [20:26] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name -} - -func init() { file_managementpb_dbaas_db_clusters_proto_init() } -func file_managementpb_dbaas_db_clusters_proto_init() { - if File_managementpb_dbaas_db_clusters_proto != nil { - return - } - file_managementpb_dbaas_dbaas_proto_init() - file_managementpb_dbaas_psmdb_clusters_proto_init() - file_managementpb_dbaas_pxc_clusters_proto_init() - file_managementpb_dbaas_templates_proto_init() - if !protoimpl.UnsafeEnabled { - file_managementpb_dbaas_db_clusters_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PSMDBCluster); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_db_clusters_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PXCCluster); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_db_clusters_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListDBClustersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_db_clusters_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListDBClustersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_db_clusters_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RestartDBClusterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_db_clusters_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RestartDBClusterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_db_clusters_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDBClusterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_db_clusters_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDBClusterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_db_clusters_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteDBClusterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_db_clusters_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteDBClusterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_db_clusters_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*S3Item); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_db_clusters_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListS3BackupsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_db_clusters_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListS3BackupsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_db_clusters_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSecretsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_db_clusters_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Secret); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_db_clusters_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSecretsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_managementpb_dbaas_db_clusters_proto_rawDesc, - NumEnums: 1, - NumMessages: 16, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_managementpb_dbaas_db_clusters_proto_goTypes, - DependencyIndexes: file_managementpb_dbaas_db_clusters_proto_depIdxs, - EnumInfos: file_managementpb_dbaas_db_clusters_proto_enumTypes, - MessageInfos: file_managementpb_dbaas_db_clusters_proto_msgTypes, - }.Build() - File_managementpb_dbaas_db_clusters_proto = out.File - file_managementpb_dbaas_db_clusters_proto_rawDesc = nil - file_managementpb_dbaas_db_clusters_proto_goTypes = nil - file_managementpb_dbaas_db_clusters_proto_depIdxs = nil -} diff --git a/api/managementpb/dbaas/db_clusters.pb.gw.go b/api/managementpb/dbaas/db_clusters.pb.gw.go deleted file mode 100644 index db8d99ae82..0000000000 --- a/api/managementpb/dbaas/db_clusters.pb.gw.go +++ /dev/null @@ -1,572 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: managementpb/dbaas/db_clusters.proto - -/* -Package dbaasv1beta1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package dbaasv1beta1 - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_DBClusters_ListDBClusters_0(ctx context.Context, marshaler runtime.Marshaler, client DBClustersClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListDBClustersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListDBClusters(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_DBClusters_ListDBClusters_0(ctx context.Context, marshaler runtime.Marshaler, server DBClustersServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListDBClustersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListDBClusters(ctx, &protoReq) - return msg, metadata, err -} - -func request_DBClusters_GetDBCluster_0(ctx context.Context, marshaler runtime.Marshaler, client DBClustersClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetDBClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetDBCluster(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_DBClusters_GetDBCluster_0(ctx context.Context, marshaler runtime.Marshaler, server DBClustersServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetDBClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetDBCluster(ctx, &protoReq) - return msg, metadata, err -} - -func request_DBClusters_RestartDBCluster_0(ctx context.Context, marshaler runtime.Marshaler, client DBClustersClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RestartDBClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.RestartDBCluster(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_DBClusters_RestartDBCluster_0(ctx context.Context, marshaler runtime.Marshaler, server DBClustersServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RestartDBClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.RestartDBCluster(ctx, &protoReq) - return msg, metadata, err -} - -func request_DBClusters_DeleteDBCluster_0(ctx context.Context, marshaler runtime.Marshaler, client DBClustersClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteDBClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DeleteDBCluster(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_DBClusters_DeleteDBCluster_0(ctx context.Context, marshaler runtime.Marshaler, server DBClustersServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteDBClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DeleteDBCluster(ctx, &protoReq) - return msg, metadata, err -} - -func request_DBClusters_ListS3Backups_0(ctx context.Context, marshaler runtime.Marshaler, client DBClustersClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListS3BackupsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListS3Backups(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_DBClusters_ListS3Backups_0(ctx context.Context, marshaler runtime.Marshaler, server DBClustersServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListS3BackupsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListS3Backups(ctx, &protoReq) - return msg, metadata, err -} - -func request_DBClusters_ListSecrets_0(ctx context.Context, marshaler runtime.Marshaler, client DBClustersClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListSecretsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListSecrets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_DBClusters_ListSecrets_0(ctx context.Context, marshaler runtime.Marshaler, server DBClustersServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListSecretsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListSecrets(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterDBClustersHandlerServer registers the http handlers for service DBClusters to "mux". -// UnaryRPC :call DBClustersServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDBClustersHandlerFromEndpoint instead. -func RegisterDBClustersHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DBClustersServer) error { - mux.Handle("POST", pattern_DBClusters_ListDBClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.DBClusters/ListDBClusters", runtime.WithHTTPPathPattern("/v1/management/DBaaS/DBClusters/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_DBClusters_ListDBClusters_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DBClusters_ListDBClusters_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_DBClusters_GetDBCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.DBClusters/GetDBCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/DBClusters/Get")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_DBClusters_GetDBCluster_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DBClusters_GetDBCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_DBClusters_RestartDBCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.DBClusters/RestartDBCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/DBClusters/Restart")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_DBClusters_RestartDBCluster_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DBClusters_RestartDBCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_DBClusters_DeleteDBCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.DBClusters/DeleteDBCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/DBClusters/Delete")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_DBClusters_DeleteDBCluster_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DBClusters_DeleteDBCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_DBClusters_ListS3Backups_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.DBClusters/ListS3Backups", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Backups/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_DBClusters_ListS3Backups_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DBClusters_ListS3Backups_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_DBClusters_ListSecrets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.DBClusters/ListSecrets", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Secrets/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_DBClusters_ListSecrets_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DBClusters_ListSecrets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterDBClustersHandlerFromEndpoint is same as RegisterDBClustersHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterDBClustersHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterDBClustersHandler(ctx, mux, conn) -} - -// RegisterDBClustersHandler registers the http handlers for service DBClusters to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterDBClustersHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterDBClustersHandlerClient(ctx, mux, NewDBClustersClient(conn)) -} - -// RegisterDBClustersHandlerClient registers the http handlers for service DBClusters -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DBClustersClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DBClustersClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "DBClustersClient" to call the correct interceptors. -func RegisterDBClustersHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DBClustersClient) error { - mux.Handle("POST", pattern_DBClusters_ListDBClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.DBClusters/ListDBClusters", runtime.WithHTTPPathPattern("/v1/management/DBaaS/DBClusters/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DBClusters_ListDBClusters_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DBClusters_ListDBClusters_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_DBClusters_GetDBCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.DBClusters/GetDBCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/DBClusters/Get")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DBClusters_GetDBCluster_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DBClusters_GetDBCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_DBClusters_RestartDBCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.DBClusters/RestartDBCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/DBClusters/Restart")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DBClusters_RestartDBCluster_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DBClusters_RestartDBCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_DBClusters_DeleteDBCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.DBClusters/DeleteDBCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/DBClusters/Delete")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DBClusters_DeleteDBCluster_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DBClusters_DeleteDBCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_DBClusters_ListS3Backups_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.DBClusters/ListS3Backups", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Backups/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DBClusters_ListS3Backups_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DBClusters_ListS3Backups_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_DBClusters_ListSecrets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.DBClusters/ListSecrets", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Secrets/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DBClusters_ListSecrets_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DBClusters_ListSecrets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -var ( - pattern_DBClusters_ListDBClusters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "DBClusters", "List"}, "")) - - pattern_DBClusters_GetDBCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "DBClusters", "Get"}, "")) - - pattern_DBClusters_RestartDBCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "DBClusters", "Restart"}, "")) - - pattern_DBClusters_DeleteDBCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "DBClusters", "Delete"}, "")) - - pattern_DBClusters_ListS3Backups_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "Backups", "List"}, "")) - - pattern_DBClusters_ListSecrets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "Secrets", "List"}, "")) -) - -var ( - forward_DBClusters_ListDBClusters_0 = runtime.ForwardResponseMessage - - forward_DBClusters_GetDBCluster_0 = runtime.ForwardResponseMessage - - forward_DBClusters_RestartDBCluster_0 = runtime.ForwardResponseMessage - - forward_DBClusters_DeleteDBCluster_0 = runtime.ForwardResponseMessage - - forward_DBClusters_ListS3Backups_0 = runtime.ForwardResponseMessage - - forward_DBClusters_ListSecrets_0 = runtime.ForwardResponseMessage -) diff --git a/api/managementpb/dbaas/db_clusters.pb.validate.go b/api/managementpb/dbaas/db_clusters.pb.validate.go deleted file mode 100644 index 396ae83f78..0000000000 --- a/api/managementpb/dbaas/db_clusters.pb.validate.go +++ /dev/null @@ -1,2278 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: managementpb/dbaas/db_clusters.proto - -package dbaasv1beta1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on PSMDBCluster with the rules defined in -// the proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *PSMDBCluster) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PSMDBCluster with the rules defined -// in the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in PSMDBClusterMultiError, or -// nil if none found. -func (m *PSMDBCluster) ValidateAll() error { - return m.validate(true) -} - -func (m *PSMDBCluster) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Name - - // no validation rules for State - - if all { - switch v := interface{}(m.GetOperation()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PSMDBClusterValidationError{ - field: "Operation", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PSMDBClusterValidationError{ - field: "Operation", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetOperation()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PSMDBClusterValidationError{ - field: "Operation", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PSMDBClusterValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PSMDBClusterValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PSMDBClusterValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Exposed - - // no validation rules for InstalledImage - - // no validation rules for AvailableImage - - // no validation rules for InternetFacing - - if all { - switch v := interface{}(m.GetBackup()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PSMDBClusterValidationError{ - field: "Backup", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PSMDBClusterValidationError{ - field: "Backup", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetBackup()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PSMDBClusterValidationError{ - field: "Backup", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetRestore()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PSMDBClusterValidationError{ - field: "Restore", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PSMDBClusterValidationError{ - field: "Restore", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRestore()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PSMDBClusterValidationError{ - field: "Restore", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetTemplate()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PSMDBClusterValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PSMDBClusterValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTemplate()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PSMDBClusterValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return PSMDBClusterMultiError(errors) - } - - return nil -} - -// PSMDBClusterMultiError is an error wrapping multiple validation errors -// returned by PSMDBCluster.ValidateAll() if the designated constraints aren't met. -type PSMDBClusterMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PSMDBClusterMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m PSMDBClusterMultiError) AllErrors() []error { return m } - -// PSMDBClusterValidationError is the validation error returned by -// PSMDBCluster.Validate if the designated constraints aren't met. -type PSMDBClusterValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PSMDBClusterValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PSMDBClusterValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PSMDBClusterValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PSMDBClusterValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PSMDBClusterValidationError) ErrorName() string { return "PSMDBClusterValidationError" } - -// Error satisfies the builtin error interface -func (e PSMDBClusterValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sPSMDBCluster.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PSMDBClusterValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PSMDBClusterValidationError{} - -// Validate checks the field values on PXCCluster with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *PXCCluster) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PXCCluster with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in PXCClusterMultiError, or -// nil if none found. -func (m *PXCCluster) ValidateAll() error { - return m.validate(true) -} - -func (m *PXCCluster) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Name - - // no validation rules for State - - if all { - switch v := interface{}(m.GetOperation()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PXCClusterValidationError{ - field: "Operation", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PXCClusterValidationError{ - field: "Operation", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetOperation()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PXCClusterValidationError{ - field: "Operation", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PXCClusterValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PXCClusterValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PXCClusterValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Exposed - - // no validation rules for InstalledImage - - // no validation rules for AvailableImage - - // no validation rules for InternetFacing - - if all { - switch v := interface{}(m.GetBackup()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PXCClusterValidationError{ - field: "Backup", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PXCClusterValidationError{ - field: "Backup", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetBackup()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PXCClusterValidationError{ - field: "Backup", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetRestore()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PXCClusterValidationError{ - field: "Restore", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PXCClusterValidationError{ - field: "Restore", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRestore()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PXCClusterValidationError{ - field: "Restore", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetTemplate()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PXCClusterValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PXCClusterValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTemplate()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PXCClusterValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return PXCClusterMultiError(errors) - } - - return nil -} - -// PXCClusterMultiError is an error wrapping multiple validation errors -// returned by PXCCluster.ValidateAll() if the designated constraints aren't met. -type PXCClusterMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PXCClusterMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m PXCClusterMultiError) AllErrors() []error { return m } - -// PXCClusterValidationError is the validation error returned by -// PXCCluster.Validate if the designated constraints aren't met. -type PXCClusterValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PXCClusterValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PXCClusterValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PXCClusterValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PXCClusterValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PXCClusterValidationError) ErrorName() string { return "PXCClusterValidationError" } - -// Error satisfies the builtin error interface -func (e PXCClusterValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sPXCCluster.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PXCClusterValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PXCClusterValidationError{} - -// Validate checks the field values on ListDBClustersRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ListDBClustersRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListDBClustersRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ListDBClustersRequestMultiError, or nil if none found. -func (m *ListDBClustersRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListDBClustersRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := ListDBClustersRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return ListDBClustersRequestMultiError(errors) - } - - return nil -} - -// ListDBClustersRequestMultiError is an error wrapping multiple validation -// errors returned by ListDBClustersRequest.ValidateAll() if the designated -// constraints aren't met. -type ListDBClustersRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListDBClustersRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListDBClustersRequestMultiError) AllErrors() []error { return m } - -// ListDBClustersRequestValidationError is the validation error returned by -// ListDBClustersRequest.Validate if the designated constraints aren't met. -type ListDBClustersRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListDBClustersRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListDBClustersRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListDBClustersRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListDBClustersRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListDBClustersRequestValidationError) ErrorName() string { - return "ListDBClustersRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListDBClustersRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListDBClustersRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListDBClustersRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListDBClustersRequestValidationError{} - -// Validate checks the field values on ListDBClustersResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ListDBClustersResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListDBClustersResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ListDBClustersResponseMultiError, or nil if none found. -func (m *ListDBClustersResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListDBClustersResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetPxcClusters() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListDBClustersResponseValidationError{ - field: fmt.Sprintf("PxcClusters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListDBClustersResponseValidationError{ - field: fmt.Sprintf("PxcClusters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListDBClustersResponseValidationError{ - field: fmt.Sprintf("PxcClusters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - for idx, item := range m.GetPsmdbClusters() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListDBClustersResponseValidationError{ - field: fmt.Sprintf("PsmdbClusters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListDBClustersResponseValidationError{ - field: fmt.Sprintf("PsmdbClusters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListDBClustersResponseValidationError{ - field: fmt.Sprintf("PsmdbClusters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListDBClustersResponseMultiError(errors) - } - - return nil -} - -// ListDBClustersResponseMultiError is an error wrapping multiple validation -// errors returned by ListDBClustersResponse.ValidateAll() if the designated -// constraints aren't met. -type ListDBClustersResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListDBClustersResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListDBClustersResponseMultiError) AllErrors() []error { return m } - -// ListDBClustersResponseValidationError is the validation error returned by -// ListDBClustersResponse.Validate if the designated constraints aren't met. -type ListDBClustersResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListDBClustersResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListDBClustersResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListDBClustersResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListDBClustersResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListDBClustersResponseValidationError) ErrorName() string { - return "ListDBClustersResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListDBClustersResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListDBClustersResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListDBClustersResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListDBClustersResponseValidationError{} - -// Validate checks the field values on RestartDBClusterRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *RestartDBClusterRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RestartDBClusterRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// RestartDBClusterRequestMultiError, or nil if none found. -func (m *RestartDBClusterRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *RestartDBClusterRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := RestartDBClusterRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetName()) < 1 { - err := RestartDBClusterRequestValidationError{ - field: "Name", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if _, ok := DBClusterType_name[int32(m.GetClusterType())]; !ok { - err := RestartDBClusterRequestValidationError{ - field: "ClusterType", - reason: "value must be one of the defined enum values", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return RestartDBClusterRequestMultiError(errors) - } - - return nil -} - -// RestartDBClusterRequestMultiError is an error wrapping multiple validation -// errors returned by RestartDBClusterRequest.ValidateAll() if the designated -// constraints aren't met. -type RestartDBClusterRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RestartDBClusterRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m RestartDBClusterRequestMultiError) AllErrors() []error { return m } - -// RestartDBClusterRequestValidationError is the validation error returned by -// RestartDBClusterRequest.Validate if the designated constraints aren't met. -type RestartDBClusterRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RestartDBClusterRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RestartDBClusterRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RestartDBClusterRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RestartDBClusterRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RestartDBClusterRequestValidationError) ErrorName() string { - return "RestartDBClusterRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e RestartDBClusterRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sRestartDBClusterRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RestartDBClusterRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RestartDBClusterRequestValidationError{} - -// Validate checks the field values on RestartDBClusterResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *RestartDBClusterResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RestartDBClusterResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// RestartDBClusterResponseMultiError, or nil if none found. -func (m *RestartDBClusterResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *RestartDBClusterResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return RestartDBClusterResponseMultiError(errors) - } - - return nil -} - -// RestartDBClusterResponseMultiError is an error wrapping multiple validation -// errors returned by RestartDBClusterResponse.ValidateAll() if the designated -// constraints aren't met. -type RestartDBClusterResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RestartDBClusterResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m RestartDBClusterResponseMultiError) AllErrors() []error { return m } - -// RestartDBClusterResponseValidationError is the validation error returned by -// RestartDBClusterResponse.Validate if the designated constraints aren't met. -type RestartDBClusterResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RestartDBClusterResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RestartDBClusterResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RestartDBClusterResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RestartDBClusterResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RestartDBClusterResponseValidationError) ErrorName() string { - return "RestartDBClusterResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e RestartDBClusterResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sRestartDBClusterResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RestartDBClusterResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RestartDBClusterResponseValidationError{} - -// Validate checks the field values on GetDBClusterRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *GetDBClusterRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetDBClusterRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// GetDBClusterRequestMultiError, or nil if none found. -func (m *GetDBClusterRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetDBClusterRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := GetDBClusterRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetName()) < 1 { - err := GetDBClusterRequestValidationError{ - field: "Name", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return GetDBClusterRequestMultiError(errors) - } - - return nil -} - -// GetDBClusterRequestMultiError is an error wrapping multiple validation -// errors returned by GetDBClusterRequest.ValidateAll() if the designated -// constraints aren't met. -type GetDBClusterRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetDBClusterRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetDBClusterRequestMultiError) AllErrors() []error { return m } - -// GetDBClusterRequestValidationError is the validation error returned by -// GetDBClusterRequest.Validate if the designated constraints aren't met. -type GetDBClusterRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetDBClusterRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetDBClusterRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetDBClusterRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetDBClusterRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetDBClusterRequestValidationError) ErrorName() string { - return "GetDBClusterRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetDBClusterRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetDBClusterRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetDBClusterRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetDBClusterRequestValidationError{} - -// Validate checks the field values on GetDBClusterResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *GetDBClusterResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetDBClusterResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// GetDBClusterResponseMultiError, or nil if none found. -func (m *GetDBClusterResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetDBClusterResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetPxcCluster()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetDBClusterResponseValidationError{ - field: "PxcCluster", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetDBClusterResponseValidationError{ - field: "PxcCluster", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPxcCluster()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetDBClusterResponseValidationError{ - field: "PxcCluster", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPsmdbCluster()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetDBClusterResponseValidationError{ - field: "PsmdbCluster", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetDBClusterResponseValidationError{ - field: "PsmdbCluster", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPsmdbCluster()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetDBClusterResponseValidationError{ - field: "PsmdbCluster", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return GetDBClusterResponseMultiError(errors) - } - - return nil -} - -// GetDBClusterResponseMultiError is an error wrapping multiple validation -// errors returned by GetDBClusterResponse.ValidateAll() if the designated -// constraints aren't met. -type GetDBClusterResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetDBClusterResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetDBClusterResponseMultiError) AllErrors() []error { return m } - -// GetDBClusterResponseValidationError is the validation error returned by -// GetDBClusterResponse.Validate if the designated constraints aren't met. -type GetDBClusterResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetDBClusterResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetDBClusterResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetDBClusterResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetDBClusterResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetDBClusterResponseValidationError) ErrorName() string { - return "GetDBClusterResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetDBClusterResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetDBClusterResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetDBClusterResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetDBClusterResponseValidationError{} - -// Validate checks the field values on DeleteDBClusterRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *DeleteDBClusterRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DeleteDBClusterRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// DeleteDBClusterRequestMultiError, or nil if none found. -func (m *DeleteDBClusterRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *DeleteDBClusterRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := DeleteDBClusterRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetName()) < 1 { - err := DeleteDBClusterRequestValidationError{ - field: "Name", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if _, ok := DBClusterType_name[int32(m.GetClusterType())]; !ok { - err := DeleteDBClusterRequestValidationError{ - field: "ClusterType", - reason: "value must be one of the defined enum values", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return DeleteDBClusterRequestMultiError(errors) - } - - return nil -} - -// DeleteDBClusterRequestMultiError is an error wrapping multiple validation -// errors returned by DeleteDBClusterRequest.ValidateAll() if the designated -// constraints aren't met. -type DeleteDBClusterRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DeleteDBClusterRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m DeleteDBClusterRequestMultiError) AllErrors() []error { return m } - -// DeleteDBClusterRequestValidationError is the validation error returned by -// DeleteDBClusterRequest.Validate if the designated constraints aren't met. -type DeleteDBClusterRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DeleteDBClusterRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DeleteDBClusterRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DeleteDBClusterRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DeleteDBClusterRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DeleteDBClusterRequestValidationError) ErrorName() string { - return "DeleteDBClusterRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e DeleteDBClusterRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sDeleteDBClusterRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DeleteDBClusterRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DeleteDBClusterRequestValidationError{} - -// Validate checks the field values on DeleteDBClusterResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *DeleteDBClusterResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DeleteDBClusterResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// DeleteDBClusterResponseMultiError, or nil if none found. -func (m *DeleteDBClusterResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *DeleteDBClusterResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return DeleteDBClusterResponseMultiError(errors) - } - - return nil -} - -// DeleteDBClusterResponseMultiError is an error wrapping multiple validation -// errors returned by DeleteDBClusterResponse.ValidateAll() if the designated -// constraints aren't met. -type DeleteDBClusterResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DeleteDBClusterResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m DeleteDBClusterResponseMultiError) AllErrors() []error { return m } - -// DeleteDBClusterResponseValidationError is the validation error returned by -// DeleteDBClusterResponse.Validate if the designated constraints aren't met. -type DeleteDBClusterResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DeleteDBClusterResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DeleteDBClusterResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DeleteDBClusterResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DeleteDBClusterResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DeleteDBClusterResponseValidationError) ErrorName() string { - return "DeleteDBClusterResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e DeleteDBClusterResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sDeleteDBClusterResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DeleteDBClusterResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DeleteDBClusterResponseValidationError{} - -// Validate checks the field values on S3Item with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *S3Item) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on S3Item with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in S3ItemMultiError, or nil if none found. -func (m *S3Item) ValidateAll() error { - return m.validate(true) -} - -func (m *S3Item) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Key - - if len(errors) > 0 { - return S3ItemMultiError(errors) - } - - return nil -} - -// S3ItemMultiError is an error wrapping multiple validation errors returned by -// S3Item.ValidateAll() if the designated constraints aren't met. -type S3ItemMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m S3ItemMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m S3ItemMultiError) AllErrors() []error { return m } - -// S3ItemValidationError is the validation error returned by S3Item.Validate if -// the designated constraints aren't met. -type S3ItemValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e S3ItemValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e S3ItemValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e S3ItemValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e S3ItemValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e S3ItemValidationError) ErrorName() string { return "S3ItemValidationError" } - -// Error satisfies the builtin error interface -func (e S3ItemValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sS3Item.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = S3ItemValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = S3ItemValidationError{} - -// Validate checks the field values on ListS3BackupsRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ListS3BackupsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListS3BackupsRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ListS3BackupsRequestMultiError, or nil if none found. -func (m *ListS3BackupsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListS3BackupsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for LocationId - - if len(errors) > 0 { - return ListS3BackupsRequestMultiError(errors) - } - - return nil -} - -// ListS3BackupsRequestMultiError is an error wrapping multiple validation -// errors returned by ListS3BackupsRequest.ValidateAll() if the designated -// constraints aren't met. -type ListS3BackupsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListS3BackupsRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListS3BackupsRequestMultiError) AllErrors() []error { return m } - -// ListS3BackupsRequestValidationError is the validation error returned by -// ListS3BackupsRequest.Validate if the designated constraints aren't met. -type ListS3BackupsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListS3BackupsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListS3BackupsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListS3BackupsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListS3BackupsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListS3BackupsRequestValidationError) ErrorName() string { - return "ListS3BackupsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListS3BackupsRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListS3BackupsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListS3BackupsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListS3BackupsRequestValidationError{} - -// Validate checks the field values on ListS3BackupsResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ListS3BackupsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListS3BackupsResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ListS3BackupsResponseMultiError, or nil if none found. -func (m *ListS3BackupsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListS3BackupsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetBackups() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListS3BackupsResponseValidationError{ - field: fmt.Sprintf("Backups[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListS3BackupsResponseValidationError{ - field: fmt.Sprintf("Backups[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListS3BackupsResponseValidationError{ - field: fmt.Sprintf("Backups[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListS3BackupsResponseMultiError(errors) - } - - return nil -} - -// ListS3BackupsResponseMultiError is an error wrapping multiple validation -// errors returned by ListS3BackupsResponse.ValidateAll() if the designated -// constraints aren't met. -type ListS3BackupsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListS3BackupsResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListS3BackupsResponseMultiError) AllErrors() []error { return m } - -// ListS3BackupsResponseValidationError is the validation error returned by -// ListS3BackupsResponse.Validate if the designated constraints aren't met. -type ListS3BackupsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListS3BackupsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListS3BackupsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListS3BackupsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListS3BackupsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListS3BackupsResponseValidationError) ErrorName() string { - return "ListS3BackupsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListS3BackupsResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListS3BackupsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListS3BackupsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListS3BackupsResponseValidationError{} - -// Validate checks the field values on ListSecretsRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ListSecretsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListSecretsRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ListSecretsRequestMultiError, or nil if none found. -func (m *ListSecretsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListSecretsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := ListSecretsRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return ListSecretsRequestMultiError(errors) - } - - return nil -} - -// ListSecretsRequestMultiError is an error wrapping multiple validation errors -// returned by ListSecretsRequest.ValidateAll() if the designated constraints -// aren't met. -type ListSecretsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListSecretsRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListSecretsRequestMultiError) AllErrors() []error { return m } - -// ListSecretsRequestValidationError is the validation error returned by -// ListSecretsRequest.Validate if the designated constraints aren't met. -type ListSecretsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListSecretsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListSecretsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListSecretsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListSecretsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListSecretsRequestValidationError) ErrorName() string { - return "ListSecretsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListSecretsRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListSecretsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListSecretsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListSecretsRequestValidationError{} - -// Validate checks the field values on Secret with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Secret) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Secret with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in SecretMultiError, or nil if none found. -func (m *Secret) ValidateAll() error { - return m.validate(true) -} - -func (m *Secret) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Name - - if len(errors) > 0 { - return SecretMultiError(errors) - } - - return nil -} - -// SecretMultiError is an error wrapping multiple validation errors returned by -// Secret.ValidateAll() if the designated constraints aren't met. -type SecretMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SecretMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m SecretMultiError) AllErrors() []error { return m } - -// SecretValidationError is the validation error returned by Secret.Validate if -// the designated constraints aren't met. -type SecretValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SecretValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SecretValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SecretValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SecretValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SecretValidationError) ErrorName() string { return "SecretValidationError" } - -// Error satisfies the builtin error interface -func (e SecretValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sSecret.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SecretValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SecretValidationError{} - -// Validate checks the field values on ListSecretsResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ListSecretsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListSecretsResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ListSecretsResponseMultiError, or nil if none found. -func (m *ListSecretsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListSecretsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetSecrets() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListSecretsResponseValidationError{ - field: fmt.Sprintf("Secrets[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListSecretsResponseValidationError{ - field: fmt.Sprintf("Secrets[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListSecretsResponseValidationError{ - field: fmt.Sprintf("Secrets[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListSecretsResponseMultiError(errors) - } - - return nil -} - -// ListSecretsResponseMultiError is an error wrapping multiple validation -// errors returned by ListSecretsResponse.ValidateAll() if the designated -// constraints aren't met. -type ListSecretsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListSecretsResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListSecretsResponseMultiError) AllErrors() []error { return m } - -// ListSecretsResponseValidationError is the validation error returned by -// ListSecretsResponse.Validate if the designated constraints aren't met. -type ListSecretsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListSecretsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListSecretsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListSecretsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListSecretsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListSecretsResponseValidationError) ErrorName() string { - return "ListSecretsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListSecretsResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListSecretsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListSecretsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListSecretsResponseValidationError{} diff --git a/api/managementpb/dbaas/db_clusters.proto b/api/managementpb/dbaas/db_clusters.proto deleted file mode 100644 index a30e6de4f2..0000000000 --- a/api/managementpb/dbaas/db_clusters.proto +++ /dev/null @@ -1,211 +0,0 @@ -syntax = "proto3"; - -package dbaas.v1beta1; - -import "google/api/annotations.proto"; -import "managementpb/dbaas/dbaas.proto"; -import "managementpb/dbaas/psmdb_clusters.proto"; -import "managementpb/dbaas/pxc_clusters.proto"; -import "managementpb/dbaas/templates.proto"; -import "validate/validate.proto"; - -option go_package = "api/managementpb/dbaas;dbaasv1beta1"; - -// DBClusterState represents DB cluster CR state. -enum DBClusterState { - // DB_CLUSTER_STATE_INVALID represents unknown state. - DB_CLUSTER_STATE_INVALID = 0; - // DB_CLUSTER_STATE_CHANGING represents a cluster being changed. - DB_CLUSTER_STATE_CHANGING = 1; - // DB_CLUSTER_STATE_READY represents a cluster without pending changes. - DB_CLUSTER_STATE_READY = 2; - // DB_CLUSTER_STATE_FAILED represents a failed cluster. - DB_CLUSTER_STATE_FAILED = 3; - // DB_CLUSTER_STATE_DELETING represents a cluster being deleting. - DB_CLUSTER_STATE_DELETING = 4; - // DB_CLUSTER_STATE_PAUSED represents a cluster is paused. - DB_CLUSTER_STATE_PAUSED = 5; - // DB_CLUSTER_STATE_UPGRADING is a special case of DB_CLUSTER_STATE_CHANGING. - // It indicates database cluster upgrade is ongoing. - DB_CLUSTER_STATE_UPGRADING = 6; -} - -// PSMDBCluster represents PSMDB cluster information. -message PSMDBCluster { - // Cluster name. - string name = 1; - // Cluster state. - DBClusterState state = 2; - // Currently running operation, if any. - RunningOperation operation = 3; - // Cluster parameters. - PSMDBClusterParams params = 4; - // DB cluster accessible outside of K8s cluster. - bool exposed = 5; - // Installed PSMDB image. - string installed_image = 6; - // Available database version user can upgrade cluster to, returned as an image. Image tag contains the version. - // If it's empty, no upgrade is available. - string available_image = 7; - // Is DB cluster accessible via public internet. - bool internet_facing = 8; - // Backup configuration parameters. - Backup backup = 9; - // Restore configuration parameters. - Restore restore = 10; - // Apply IP source ranges against the cluster. - repeated string source_ranges = 12; - // Configuration template. - Template template = 11; -} - -// PXCCluster represents PXC cluster information. -message PXCCluster { - // Cluster name. - string name = 1; - // Cluster state. - DBClusterState state = 2; - // Currently running operation, if any. - RunningOperation operation = 3; - // Cluster parameters. - PXCClusterParams params = 4; - // DB cluster accessible outside of K8s cluster. - bool exposed = 5; - // Installed XtraDB image. - string installed_image = 6; - // Available database version user can upgrade cluster to, returned as an image. Image tag contains the version. - // If it's empty, no upgrade is available. - string available_image = 7; - // Is DB cluster accessible via public internet. - bool internet_facing = 8; - // Backup configuration parameters. - Backup backup = 9; - // Restore configuration parameters. - Restore restore = 10; - // Apply IP source ranges against the cluster. - repeated string source_ranges = 12; - // Configuration template. - Template template = 11; -} - -message ListDBClustersRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; -} - -message ListDBClustersResponse { - // PXC clusters information. - repeated PXCCluster pxc_clusters = 1; - // PSMDB clusters information. - repeated PSMDBCluster psmdb_clusters = 2; -} - -message RestartDBClusterRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; - // PXC cluster name. - string name = 2 [(validate.rules).string.min_len = 1]; - // DB cluster type. - DBClusterType cluster_type = 3 [(validate.rules).enum.defined_only = true]; -} - -message RestartDBClusterResponse {} - -message GetDBClusterRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; - // DB cluster name. - string name = 2 [(validate.rules).string.min_len = 1]; -} - -message GetDBClusterResponse { - // PXC cluster information. - PXCCluster pxc_cluster = 1; - // PSMDB cluster information. - PSMDBCluster psmdb_cluster = 2; -} - -message DeleteDBClusterRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; - // DB cluster name. - string name = 2 [(validate.rules).string.min_len = 1]; - // DB cluster type. - DBClusterType cluster_type = 3 [(validate.rules).enum.defined_only = true]; -} - -message DeleteDBClusterResponse {} - -message S3Item { - // Key of a filename on s3. - string key = 1; -} -message ListS3BackupsRequest { - // Backup Location ID to list backups from - string location_id = 1; -} -message ListS3BackupsResponse { - // Backup list. - repeated S3Item backups = 1; -} - -message ListSecretsRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; -} -message Secret { - // Name of a secret - string name = 1; -} -message ListSecretsResponse { - // Secret list. - repeated Secret secrets = 1; -} - -// DBClusters service provides public methods for managing db clusters. -service DBClusters { - // ListDBClusters returns a list of DB clusters. - rpc ListDBClusters(ListDBClustersRequest) returns (ListDBClustersResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/DBClusters/List" - body: "*" - }; - } - // GetDBCluster returns parameters used to create a database cluster - rpc GetDBCluster(GetDBClusterRequest) returns (GetDBClusterResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/DBClusters/Get" - body: "*" - }; - } - // RestartDBCluster restarts DB cluster. - rpc RestartDBCluster(RestartDBClusterRequest) returns (RestartDBClusterResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/DBClusters/Restart" - body: "*" - }; - } - // DeleteDBCluster deletes DB cluster. - rpc DeleteDBCluster(DeleteDBClusterRequest) returns (DeleteDBClusterResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/DBClusters/Delete" - body: "*" - }; - } - - // ListS3Backups lists backups stored on s3. - rpc ListS3Backups(ListS3BackupsRequest) returns (ListS3BackupsResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/Backups/List" - body: "*" - }; - } - - // ListSecrets returns a list of secrets from k8s - rpc ListSecrets(ListSecretsRequest) returns (ListSecretsResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/Secrets/List" - body: "*" - }; - } -} diff --git a/api/managementpb/dbaas/db_clusters_grpc.pb.go b/api/managementpb/dbaas/db_clusters_grpc.pb.go deleted file mode 100644 index 20e41e1630..0000000000 --- a/api/managementpb/dbaas/db_clusters_grpc.pb.go +++ /dev/null @@ -1,311 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: managementpb/dbaas/db_clusters.proto - -package dbaasv1beta1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - DBClusters_ListDBClusters_FullMethodName = "/dbaas.v1beta1.DBClusters/ListDBClusters" - DBClusters_GetDBCluster_FullMethodName = "/dbaas.v1beta1.DBClusters/GetDBCluster" - DBClusters_RestartDBCluster_FullMethodName = "/dbaas.v1beta1.DBClusters/RestartDBCluster" - DBClusters_DeleteDBCluster_FullMethodName = "/dbaas.v1beta1.DBClusters/DeleteDBCluster" - DBClusters_ListS3Backups_FullMethodName = "/dbaas.v1beta1.DBClusters/ListS3Backups" - DBClusters_ListSecrets_FullMethodName = "/dbaas.v1beta1.DBClusters/ListSecrets" -) - -// DBClustersClient is the client API for DBClusters service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type DBClustersClient interface { - // ListDBClusters returns a list of DB clusters. - ListDBClusters(ctx context.Context, in *ListDBClustersRequest, opts ...grpc.CallOption) (*ListDBClustersResponse, error) - // GetDBCluster returns parameters used to create a database cluster - GetDBCluster(ctx context.Context, in *GetDBClusterRequest, opts ...grpc.CallOption) (*GetDBClusterResponse, error) - // RestartDBCluster restarts DB cluster. - RestartDBCluster(ctx context.Context, in *RestartDBClusterRequest, opts ...grpc.CallOption) (*RestartDBClusterResponse, error) - // DeleteDBCluster deletes DB cluster. - DeleteDBCluster(ctx context.Context, in *DeleteDBClusterRequest, opts ...grpc.CallOption) (*DeleteDBClusterResponse, error) - // ListS3Backups lists backups stored on s3. - ListS3Backups(ctx context.Context, in *ListS3BackupsRequest, opts ...grpc.CallOption) (*ListS3BackupsResponse, error) - // ListSecrets returns a list of secrets from k8s - ListSecrets(ctx context.Context, in *ListSecretsRequest, opts ...grpc.CallOption) (*ListSecretsResponse, error) -} - -type dBClustersClient struct { - cc grpc.ClientConnInterface -} - -func NewDBClustersClient(cc grpc.ClientConnInterface) DBClustersClient { - return &dBClustersClient{cc} -} - -func (c *dBClustersClient) ListDBClusters(ctx context.Context, in *ListDBClustersRequest, opts ...grpc.CallOption) (*ListDBClustersResponse, error) { - out := new(ListDBClustersResponse) - err := c.cc.Invoke(ctx, DBClusters_ListDBClusters_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dBClustersClient) GetDBCluster(ctx context.Context, in *GetDBClusterRequest, opts ...grpc.CallOption) (*GetDBClusterResponse, error) { - out := new(GetDBClusterResponse) - err := c.cc.Invoke(ctx, DBClusters_GetDBCluster_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dBClustersClient) RestartDBCluster(ctx context.Context, in *RestartDBClusterRequest, opts ...grpc.CallOption) (*RestartDBClusterResponse, error) { - out := new(RestartDBClusterResponse) - err := c.cc.Invoke(ctx, DBClusters_RestartDBCluster_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dBClustersClient) DeleteDBCluster(ctx context.Context, in *DeleteDBClusterRequest, opts ...grpc.CallOption) (*DeleteDBClusterResponse, error) { - out := new(DeleteDBClusterResponse) - err := c.cc.Invoke(ctx, DBClusters_DeleteDBCluster_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dBClustersClient) ListS3Backups(ctx context.Context, in *ListS3BackupsRequest, opts ...grpc.CallOption) (*ListS3BackupsResponse, error) { - out := new(ListS3BackupsResponse) - err := c.cc.Invoke(ctx, DBClusters_ListS3Backups_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dBClustersClient) ListSecrets(ctx context.Context, in *ListSecretsRequest, opts ...grpc.CallOption) (*ListSecretsResponse, error) { - out := new(ListSecretsResponse) - err := c.cc.Invoke(ctx, DBClusters_ListSecrets_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// DBClustersServer is the server API for DBClusters service. -// All implementations must embed UnimplementedDBClustersServer -// for forward compatibility -type DBClustersServer interface { - // ListDBClusters returns a list of DB clusters. - ListDBClusters(context.Context, *ListDBClustersRequest) (*ListDBClustersResponse, error) - // GetDBCluster returns parameters used to create a database cluster - GetDBCluster(context.Context, *GetDBClusterRequest) (*GetDBClusterResponse, error) - // RestartDBCluster restarts DB cluster. - RestartDBCluster(context.Context, *RestartDBClusterRequest) (*RestartDBClusterResponse, error) - // DeleteDBCluster deletes DB cluster. - DeleteDBCluster(context.Context, *DeleteDBClusterRequest) (*DeleteDBClusterResponse, error) - // ListS3Backups lists backups stored on s3. - ListS3Backups(context.Context, *ListS3BackupsRequest) (*ListS3BackupsResponse, error) - // ListSecrets returns a list of secrets from k8s - ListSecrets(context.Context, *ListSecretsRequest) (*ListSecretsResponse, error) - mustEmbedUnimplementedDBClustersServer() -} - -// UnimplementedDBClustersServer must be embedded to have forward compatible implementations. -type UnimplementedDBClustersServer struct{} - -func (UnimplementedDBClustersServer) ListDBClusters(context.Context, *ListDBClustersRequest) (*ListDBClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListDBClusters not implemented") -} - -func (UnimplementedDBClustersServer) GetDBCluster(context.Context, *GetDBClusterRequest) (*GetDBClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetDBCluster not implemented") -} - -func (UnimplementedDBClustersServer) RestartDBCluster(context.Context, *RestartDBClusterRequest) (*RestartDBClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RestartDBCluster not implemented") -} - -func (UnimplementedDBClustersServer) DeleteDBCluster(context.Context, *DeleteDBClusterRequest) (*DeleteDBClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteDBCluster not implemented") -} - -func (UnimplementedDBClustersServer) ListS3Backups(context.Context, *ListS3BackupsRequest) (*ListS3BackupsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListS3Backups not implemented") -} - -func (UnimplementedDBClustersServer) ListSecrets(context.Context, *ListSecretsRequest) (*ListSecretsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListSecrets not implemented") -} -func (UnimplementedDBClustersServer) mustEmbedUnimplementedDBClustersServer() {} - -// UnsafeDBClustersServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to DBClustersServer will -// result in compilation errors. -type UnsafeDBClustersServer interface { - mustEmbedUnimplementedDBClustersServer() -} - -func RegisterDBClustersServer(s grpc.ServiceRegistrar, srv DBClustersServer) { - s.RegisterService(&DBClusters_ServiceDesc, srv) -} - -func _DBClusters_ListDBClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListDBClustersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DBClustersServer).ListDBClusters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: DBClusters_ListDBClusters_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DBClustersServer).ListDBClusters(ctx, req.(*ListDBClustersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _DBClusters_GetDBCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDBClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DBClustersServer).GetDBCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: DBClusters_GetDBCluster_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DBClustersServer).GetDBCluster(ctx, req.(*GetDBClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _DBClusters_RestartDBCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RestartDBClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DBClustersServer).RestartDBCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: DBClusters_RestartDBCluster_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DBClustersServer).RestartDBCluster(ctx, req.(*RestartDBClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _DBClusters_DeleteDBCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteDBClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DBClustersServer).DeleteDBCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: DBClusters_DeleteDBCluster_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DBClustersServer).DeleteDBCluster(ctx, req.(*DeleteDBClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _DBClusters_ListS3Backups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListS3BackupsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DBClustersServer).ListS3Backups(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: DBClusters_ListS3Backups_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DBClustersServer).ListS3Backups(ctx, req.(*ListS3BackupsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _DBClusters_ListSecrets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListSecretsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DBClustersServer).ListSecrets(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: DBClusters_ListSecrets_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DBClustersServer).ListSecrets(ctx, req.(*ListSecretsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// DBClusters_ServiceDesc is the grpc.ServiceDesc for DBClusters service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var DBClusters_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "dbaas.v1beta1.DBClusters", - HandlerType: (*DBClustersServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListDBClusters", - Handler: _DBClusters_ListDBClusters_Handler, - }, - { - MethodName: "GetDBCluster", - Handler: _DBClusters_GetDBCluster_Handler, - }, - { - MethodName: "RestartDBCluster", - Handler: _DBClusters_RestartDBCluster_Handler, - }, - { - MethodName: "DeleteDBCluster", - Handler: _DBClusters_DeleteDBCluster_Handler, - }, - { - MethodName: "ListS3Backups", - Handler: _DBClusters_ListS3Backups_Handler, - }, - { - MethodName: "ListSecrets", - Handler: _DBClusters_ListSecrets_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "managementpb/dbaas/db_clusters.proto", -} diff --git a/api/managementpb/dbaas/dbaas.pb.go b/api/managementpb/dbaas/dbaas.pb.go deleted file mode 100644 index 52cb9f53ea..0000000000 --- a/api/managementpb/dbaas/dbaas.pb.go +++ /dev/null @@ -1,661 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: managementpb/dbaas/dbaas.proto - -package dbaasv1beta1 - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// DBClusterType represents database cluster type. -type DBClusterType int32 - -const ( - // DB_CLUSTER_TYPE_INVALID represents unknown cluster type. - DBClusterType_DB_CLUSTER_TYPE_INVALID DBClusterType = 0 - // DB_CLUSTER_TYPE_PXC represents pxc cluster type. - DBClusterType_DB_CLUSTER_TYPE_PXC DBClusterType = 1 - // DB_CLUSTER_TYPE_PSMDB represents psmdb cluster type. - DBClusterType_DB_CLUSTER_TYPE_PSMDB DBClusterType = 2 -) - -// Enum value maps for DBClusterType. -var ( - DBClusterType_name = map[int32]string{ - 0: "DB_CLUSTER_TYPE_INVALID", - 1: "DB_CLUSTER_TYPE_PXC", - 2: "DB_CLUSTER_TYPE_PSMDB", - } - DBClusterType_value = map[string]int32{ - "DB_CLUSTER_TYPE_INVALID": 0, - "DB_CLUSTER_TYPE_PXC": 1, - "DB_CLUSTER_TYPE_PSMDB": 2, - } -) - -func (x DBClusterType) Enum() *DBClusterType { - p := new(DBClusterType) - *p = x - return p -} - -func (x DBClusterType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DBClusterType) Descriptor() protoreflect.EnumDescriptor { - return file_managementpb_dbaas_dbaas_proto_enumTypes[0].Descriptor() -} - -func (DBClusterType) Type() protoreflect.EnumType { - return &file_managementpb_dbaas_dbaas_proto_enumTypes[0] -} - -func (x DBClusterType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DBClusterType.Descriptor instead. -func (DBClusterType) EnumDescriptor() ([]byte, []int) { - return file_managementpb_dbaas_dbaas_proto_rawDescGZIP(), []int{0} -} - -// OperatorsStatus defines status of operators installed in Kubernetes cluster. -type OperatorsStatus int32 - -const ( - // OPERATORS_STATUS_INVALID represents unknown state. - OperatorsStatus_OPERATORS_STATUS_INVALID OperatorsStatus = 0 - // OPERATORS_STATUS_OK represents that operators are installed and have supported API version. - OperatorsStatus_OPERATORS_STATUS_OK OperatorsStatus = 1 - // OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version. - OperatorsStatus_OPERATORS_STATUS_UNSUPPORTED OperatorsStatus = 2 - // OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed. - OperatorsStatus_OPERATORS_STATUS_NOT_INSTALLED OperatorsStatus = 3 -) - -// Enum value maps for OperatorsStatus. -var ( - OperatorsStatus_name = map[int32]string{ - 0: "OPERATORS_STATUS_INVALID", - 1: "OPERATORS_STATUS_OK", - 2: "OPERATORS_STATUS_UNSUPPORTED", - 3: "OPERATORS_STATUS_NOT_INSTALLED", - } - OperatorsStatus_value = map[string]int32{ - "OPERATORS_STATUS_INVALID": 0, - "OPERATORS_STATUS_OK": 1, - "OPERATORS_STATUS_UNSUPPORTED": 2, - "OPERATORS_STATUS_NOT_INSTALLED": 3, - } -) - -func (x OperatorsStatus) Enum() *OperatorsStatus { - p := new(OperatorsStatus) - *p = x - return p -} - -func (x OperatorsStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (OperatorsStatus) Descriptor() protoreflect.EnumDescriptor { - return file_managementpb_dbaas_dbaas_proto_enumTypes[1].Descriptor() -} - -func (OperatorsStatus) Type() protoreflect.EnumType { - return &file_managementpb_dbaas_dbaas_proto_enumTypes[1] -} - -func (x OperatorsStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use OperatorsStatus.Descriptor instead. -func (OperatorsStatus) EnumDescriptor() ([]byte, []int) { - return file_managementpb_dbaas_dbaas_proto_rawDescGZIP(), []int{1} -} - -// RunningOperation respresents a long-running operation. -type RunningOperation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Finished steps of the operaion; can decrease or increase compared to the previous value. - FinishedSteps int32 `protobuf:"varint,1,opt,name=finished_steps,json=finishedSteps,proto3" json:"finished_steps,omitempty"` - // Text describing the current operation progress step. - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - // Total steps needed to finish the operation; can decrease or increase compared to the previous value. - TotalSteps int32 `protobuf:"varint,3,opt,name=total_steps,json=totalSteps,proto3" json:"total_steps,omitempty"` -} - -func (x *RunningOperation) Reset() { - *x = RunningOperation{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_dbaas_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RunningOperation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RunningOperation) ProtoMessage() {} - -func (x *RunningOperation) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_dbaas_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RunningOperation.ProtoReflect.Descriptor instead. -func (*RunningOperation) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_dbaas_proto_rawDescGZIP(), []int{0} -} - -func (x *RunningOperation) GetFinishedSteps() int32 { - if x != nil { - return x.FinishedSteps - } - return 0 -} - -func (x *RunningOperation) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *RunningOperation) GetTotalSteps() int32 { - if x != nil { - return x.TotalSteps - } - return 0 -} - -// ComputeResources represents container computer resources requests or limits. -type ComputeResources struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // CPUs in milliCPUs; 1000m = 1 vCPU. - CpuM int32 `protobuf:"varint,1,opt,name=cpu_m,json=cpuM,proto3" json:"cpu_m,omitempty"` - // Memory in bytes. - MemoryBytes int64 `protobuf:"varint,2,opt,name=memory_bytes,json=memoryBytes,proto3" json:"memory_bytes,omitempty"` -} - -func (x *ComputeResources) Reset() { - *x = ComputeResources{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_dbaas_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ComputeResources) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ComputeResources) ProtoMessage() {} - -func (x *ComputeResources) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_dbaas_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ComputeResources.ProtoReflect.Descriptor instead. -func (*ComputeResources) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_dbaas_proto_rawDescGZIP(), []int{1} -} - -func (x *ComputeResources) GetCpuM() int32 { - if x != nil { - return x.CpuM - } - return 0 -} - -func (x *ComputeResources) GetMemoryBytes() int64 { - if x != nil { - return x.MemoryBytes - } - return 0 -} - -// Backup configuration for a database cluster -type Backup struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Backup Location id of stored backup location in PMM. - LocationId string `protobuf:"bytes,1,opt,name=location_id,json=locationId,proto3" json:"location_id,omitempty"` - // Keep copies represents how many copies should retain. - KeepCopies int32 `protobuf:"varint,2,opt,name=keep_copies,json=keepCopies,proto3" json:"keep_copies,omitempty"` - // Cron expression represents cron expression - CronExpression string `protobuf:"bytes,3,opt,name=cron_expression,json=cronExpression,proto3" json:"cron_expression,omitempty"` - // Service acccount used for backups - ServiceAccount string `protobuf:"bytes,4,opt,name=service_account,json=serviceAccount,proto3" json:"service_account,omitempty"` -} - -func (x *Backup) Reset() { - *x = Backup{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_dbaas_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Backup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Backup) ProtoMessage() {} - -func (x *Backup) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_dbaas_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Backup.ProtoReflect.Descriptor instead. -func (*Backup) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_dbaas_proto_rawDescGZIP(), []int{2} -} - -func (x *Backup) GetLocationId() string { - if x != nil { - return x.LocationId - } - return "" -} - -func (x *Backup) GetKeepCopies() int32 { - if x != nil { - return x.KeepCopies - } - return 0 -} - -func (x *Backup) GetCronExpression() string { - if x != nil { - return x.CronExpression - } - return "" -} - -func (x *Backup) GetServiceAccount() string { - if x != nil { - return x.ServiceAccount - } - return "" -} - -// Restore represents restoration payload to restore a database cluster from backup -type Restore struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Backup location in PMM. - LocationId string `protobuf:"bytes,1,opt,name=location_id,json=locationId,proto3" json:"location_id,omitempty"` - // Destination filename. - Destination string `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"` - // K8s Secrets name. - SecretsName string `protobuf:"bytes,3,opt,name=secrets_name,json=secretsName,proto3" json:"secrets_name,omitempty"` -} - -func (x *Restore) Reset() { - *x = Restore{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_dbaas_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Restore) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Restore) ProtoMessage() {} - -func (x *Restore) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_dbaas_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Restore.ProtoReflect.Descriptor instead. -func (*Restore) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_dbaas_proto_rawDescGZIP(), []int{3} -} - -func (x *Restore) GetLocationId() string { - if x != nil { - return x.LocationId - } - return "" -} - -func (x *Restore) GetDestination() string { - if x != nil { - return x.Destination - } - return "" -} - -func (x *Restore) GetSecretsName() string { - if x != nil { - return x.SecretsName - } - return "" -} - -// Resources contains Kubernetes cluster resources. -type Resources struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Memory in bytes. - MemoryBytes uint64 `protobuf:"varint,1,opt,name=memory_bytes,json=memoryBytes,proto3" json:"memory_bytes,omitempty"` - // CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus. - // See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu. - CpuM uint64 `protobuf:"varint,2,opt,name=cpu_m,json=cpuM,proto3" json:"cpu_m,omitempty"` - // Disk size in bytes. - DiskSize uint64 `protobuf:"varint,3,opt,name=disk_size,json=diskSize,proto3" json:"disk_size,omitempty"` -} - -func (x *Resources) Reset() { - *x = Resources{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_dbaas_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Resources) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Resources) ProtoMessage() {} - -func (x *Resources) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_dbaas_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Resources.ProtoReflect.Descriptor instead. -func (*Resources) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_dbaas_proto_rawDescGZIP(), []int{4} -} - -func (x *Resources) GetMemoryBytes() uint64 { - if x != nil { - return x.MemoryBytes - } - return 0 -} - -func (x *Resources) GetCpuM() uint64 { - if x != nil { - return x.CpuM - } - return 0 -} - -func (x *Resources) GetDiskSize() uint64 { - if x != nil { - return x.DiskSize - } - return 0 -} - -var File_managementpb_dbaas_dbaas_proto protoreflect.FileDescriptor - -var file_managementpb_dbaas_dbaas_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x0d, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x22, - 0x74, 0x0a, 0x10, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x5f, - 0x73, 0x74, 0x65, 0x70, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x66, 0x69, 0x6e, - 0x69, 0x73, 0x68, 0x65, 0x64, 0x53, 0x74, 0x65, 0x70, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, - 0x65, 0x70, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x53, 0x74, 0x65, 0x70, 0x73, 0x22, 0x4a, 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x13, 0x0a, 0x05, 0x63, 0x70, 0x75, - 0x5f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x70, 0x75, 0x4d, 0x12, 0x21, - 0x0a, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x42, 0x79, 0x74, 0x65, - 0x73, 0x22, 0x9c, 0x01, 0x0a, 0x06, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x1f, 0x0a, 0x0b, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, - 0x0b, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0a, 0x6b, 0x65, 0x65, 0x70, 0x43, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x12, 0x27, - 0x0a, 0x0f, 0x63, 0x72, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x72, 0x6f, 0x6e, 0x45, 0x78, 0x70, - 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x22, 0x6f, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, - 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, - 0x0a, 0x0c, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x4e, 0x61, 0x6d, - 0x65, 0x22, 0x60, 0x0a, 0x09, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x21, - 0x0a, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x42, 0x79, 0x74, 0x65, - 0x73, 0x12, 0x13, 0x0a, 0x05, 0x63, 0x70, 0x75, 0x5f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x04, 0x63, 0x70, 0x75, 0x4d, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x73, - 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x69, 0x73, 0x6b, 0x53, - 0x69, 0x7a, 0x65, 0x2a, 0x60, 0x0a, 0x0d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x44, 0x42, 0x5f, 0x43, 0x4c, 0x55, 0x53, 0x54, - 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, - 0x00, 0x12, 0x17, 0x0a, 0x13, 0x44, 0x42, 0x5f, 0x43, 0x4c, 0x55, 0x53, 0x54, 0x45, 0x52, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x58, 0x43, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x44, 0x42, - 0x5f, 0x43, 0x4c, 0x55, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x53, - 0x4d, 0x44, 0x42, 0x10, 0x02, 0x2a, 0x8e, 0x01, 0x0a, 0x0f, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x6f, 0x72, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x18, 0x4f, 0x50, 0x45, - 0x52, 0x41, 0x54, 0x4f, 0x52, 0x53, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x49, 0x4e, - 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x4f, 0x50, 0x45, 0x52, 0x41, - 0x54, 0x4f, 0x52, 0x53, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, 0x4b, 0x10, 0x01, - 0x12, 0x20, 0x0a, 0x1c, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x53, 0x5f, 0x53, 0x54, - 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x44, - 0x10, 0x02, 0x12, 0x22, 0x0a, 0x1e, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x53, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x49, 0x4e, 0x53, 0x54, 0x41, - 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x03, 0x42, 0xb0, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x44, 0x62, - 0x61, 0x61, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, - 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x70, 0x62, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x3b, 0x64, 0x62, 0x61, 0x61, 0x73, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x44, - 0x62, 0x61, 0x61, 0x73, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x0d, 0x44, - 0x62, 0x61, 0x61, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x19, 0x44, - 0x62, 0x61, 0x61, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x44, 0x62, 0x61, 0x61, 0x73, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_managementpb_dbaas_dbaas_proto_rawDescOnce sync.Once - file_managementpb_dbaas_dbaas_proto_rawDescData = file_managementpb_dbaas_dbaas_proto_rawDesc -) - -func file_managementpb_dbaas_dbaas_proto_rawDescGZIP() []byte { - file_managementpb_dbaas_dbaas_proto_rawDescOnce.Do(func() { - file_managementpb_dbaas_dbaas_proto_rawDescData = protoimpl.X.CompressGZIP(file_managementpb_dbaas_dbaas_proto_rawDescData) - }) - return file_managementpb_dbaas_dbaas_proto_rawDescData -} - -var ( - file_managementpb_dbaas_dbaas_proto_enumTypes = make([]protoimpl.EnumInfo, 2) - file_managementpb_dbaas_dbaas_proto_msgTypes = make([]protoimpl.MessageInfo, 5) - file_managementpb_dbaas_dbaas_proto_goTypes = []interface{}{ - (DBClusterType)(0), // 0: dbaas.v1beta1.DBClusterType - (OperatorsStatus)(0), // 1: dbaas.v1beta1.OperatorsStatus - (*RunningOperation)(nil), // 2: dbaas.v1beta1.RunningOperation - (*ComputeResources)(nil), // 3: dbaas.v1beta1.ComputeResources - (*Backup)(nil), // 4: dbaas.v1beta1.Backup - (*Restore)(nil), // 5: dbaas.v1beta1.Restore - (*Resources)(nil), // 6: dbaas.v1beta1.Resources - } -) - -var file_managementpb_dbaas_dbaas_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_managementpb_dbaas_dbaas_proto_init() } -func file_managementpb_dbaas_dbaas_proto_init() { - if File_managementpb_dbaas_dbaas_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_managementpb_dbaas_dbaas_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RunningOperation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_dbaas_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ComputeResources); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_dbaas_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Backup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_dbaas_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Restore); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_dbaas_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Resources); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_managementpb_dbaas_dbaas_proto_rawDesc, - NumEnums: 2, - NumMessages: 5, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_managementpb_dbaas_dbaas_proto_goTypes, - DependencyIndexes: file_managementpb_dbaas_dbaas_proto_depIdxs, - EnumInfos: file_managementpb_dbaas_dbaas_proto_enumTypes, - MessageInfos: file_managementpb_dbaas_dbaas_proto_msgTypes, - }.Build() - File_managementpb_dbaas_dbaas_proto = out.File - file_managementpb_dbaas_dbaas_proto_rawDesc = nil - file_managementpb_dbaas_dbaas_proto_goTypes = nil - file_managementpb_dbaas_dbaas_proto_depIdxs = nil -} diff --git a/api/managementpb/dbaas/dbaas.pb.validate.go b/api/managementpb/dbaas/dbaas.pb.validate.go deleted file mode 100644 index 90c57b121a..0000000000 --- a/api/managementpb/dbaas/dbaas.pb.validate.go +++ /dev/null @@ -1,561 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: managementpb/dbaas/dbaas.proto - -package dbaasv1beta1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on RunningOperation with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *RunningOperation) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RunningOperation with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// RunningOperationMultiError, or nil if none found. -func (m *RunningOperation) ValidateAll() error { - return m.validate(true) -} - -func (m *RunningOperation) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for FinishedSteps - - // no validation rules for Message - - // no validation rules for TotalSteps - - if len(errors) > 0 { - return RunningOperationMultiError(errors) - } - - return nil -} - -// RunningOperationMultiError is an error wrapping multiple validation errors -// returned by RunningOperation.ValidateAll() if the designated constraints -// aren't met. -type RunningOperationMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RunningOperationMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m RunningOperationMultiError) AllErrors() []error { return m } - -// RunningOperationValidationError is the validation error returned by -// RunningOperation.Validate if the designated constraints aren't met. -type RunningOperationValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RunningOperationValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RunningOperationValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RunningOperationValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RunningOperationValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RunningOperationValidationError) ErrorName() string { return "RunningOperationValidationError" } - -// Error satisfies the builtin error interface -func (e RunningOperationValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sRunningOperation.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RunningOperationValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RunningOperationValidationError{} - -// Validate checks the field values on ComputeResources with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *ComputeResources) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ComputeResources with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ComputeResourcesMultiError, or nil if none found. -func (m *ComputeResources) ValidateAll() error { - return m.validate(true) -} - -func (m *ComputeResources) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for CpuM - - // no validation rules for MemoryBytes - - if len(errors) > 0 { - return ComputeResourcesMultiError(errors) - } - - return nil -} - -// ComputeResourcesMultiError is an error wrapping multiple validation errors -// returned by ComputeResources.ValidateAll() if the designated constraints -// aren't met. -type ComputeResourcesMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ComputeResourcesMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ComputeResourcesMultiError) AllErrors() []error { return m } - -// ComputeResourcesValidationError is the validation error returned by -// ComputeResources.Validate if the designated constraints aren't met. -type ComputeResourcesValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ComputeResourcesValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ComputeResourcesValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ComputeResourcesValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ComputeResourcesValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ComputeResourcesValidationError) ErrorName() string { return "ComputeResourcesValidationError" } - -// Error satisfies the builtin error interface -func (e ComputeResourcesValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sComputeResources.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ComputeResourcesValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ComputeResourcesValidationError{} - -// Validate checks the field values on Backup with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Backup) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Backup with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in BackupMultiError, or nil if none found. -func (m *Backup) ValidateAll() error { - return m.validate(true) -} - -func (m *Backup) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for LocationId - - // no validation rules for KeepCopies - - // no validation rules for CronExpression - - // no validation rules for ServiceAccount - - if len(errors) > 0 { - return BackupMultiError(errors) - } - - return nil -} - -// BackupMultiError is an error wrapping multiple validation errors returned by -// Backup.ValidateAll() if the designated constraints aren't met. -type BackupMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m BackupMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m BackupMultiError) AllErrors() []error { return m } - -// BackupValidationError is the validation error returned by Backup.Validate if -// the designated constraints aren't met. -type BackupValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e BackupValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e BackupValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e BackupValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e BackupValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e BackupValidationError) ErrorName() string { return "BackupValidationError" } - -// Error satisfies the builtin error interface -func (e BackupValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sBackup.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = BackupValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = BackupValidationError{} - -// Validate checks the field values on Restore with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Restore) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Restore with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in RestoreMultiError, or nil if none found. -func (m *Restore) ValidateAll() error { - return m.validate(true) -} - -func (m *Restore) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for LocationId - - // no validation rules for Destination - - // no validation rules for SecretsName - - if len(errors) > 0 { - return RestoreMultiError(errors) - } - - return nil -} - -// RestoreMultiError is an error wrapping multiple validation errors returned -// by Restore.ValidateAll() if the designated constraints aren't met. -type RestoreMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RestoreMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m RestoreMultiError) AllErrors() []error { return m } - -// RestoreValidationError is the validation error returned by Restore.Validate -// if the designated constraints aren't met. -type RestoreValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RestoreValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RestoreValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RestoreValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RestoreValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RestoreValidationError) ErrorName() string { return "RestoreValidationError" } - -// Error satisfies the builtin error interface -func (e RestoreValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sRestore.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RestoreValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RestoreValidationError{} - -// Validate checks the field values on Resources with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Resources) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Resources with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in ResourcesMultiError, or nil -// if none found. -func (m *Resources) ValidateAll() error { - return m.validate(true) -} - -func (m *Resources) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for MemoryBytes - - // no validation rules for CpuM - - // no validation rules for DiskSize - - if len(errors) > 0 { - return ResourcesMultiError(errors) - } - - return nil -} - -// ResourcesMultiError is an error wrapping multiple validation errors returned -// by Resources.ValidateAll() if the designated constraints aren't met. -type ResourcesMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ResourcesMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ResourcesMultiError) AllErrors() []error { return m } - -// ResourcesValidationError is the validation error returned by -// Resources.Validate if the designated constraints aren't met. -type ResourcesValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ResourcesValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ResourcesValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ResourcesValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ResourcesValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ResourcesValidationError) ErrorName() string { return "ResourcesValidationError" } - -// Error satisfies the builtin error interface -func (e ResourcesValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sResources.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ResourcesValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ResourcesValidationError{} diff --git a/api/managementpb/dbaas/dbaas.proto b/api/managementpb/dbaas/dbaas.proto deleted file mode 100644 index 6bdb981bfa..0000000000 --- a/api/managementpb/dbaas/dbaas.proto +++ /dev/null @@ -1,78 +0,0 @@ -syntax = "proto3"; - -package dbaas.v1beta1; - -option go_package = "api/managementpb/dbaas;dbaasv1beta1"; - -// RunningOperation respresents a long-running operation. -message RunningOperation { - // Finished steps of the operaion; can decrease or increase compared to the previous value. - int32 finished_steps = 1; - // Text describing the current operation progress step. - string message = 2; - // Total steps needed to finish the operation; can decrease or increase compared to the previous value. - int32 total_steps = 3; -} - -// ComputeResources represents container computer resources requests or limits. -message ComputeResources { - // CPUs in milliCPUs; 1000m = 1 vCPU. - int32 cpu_m = 1; - // Memory in bytes. - int64 memory_bytes = 2; -} - -// Backup configuration for a database cluster -message Backup { - // Backup Location id of stored backup location in PMM. - string location_id = 1; - // Keep copies represents how many copies should retain. - int32 keep_copies = 2; - // Cron expression represents cron expression - string cron_expression = 3; - // Service acccount used for backups - string service_account = 4; -} - -// Restore represents restoration payload to restore a database cluster from backup -message Restore { - // Backup location in PMM. - string location_id = 1; - // Destination filename. - string destination = 2; - // K8s Secrets name. - string secrets_name = 3; -} - -// Resources contains Kubernetes cluster resources. -message Resources { - // Memory in bytes. - uint64 memory_bytes = 1; - // CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus. - // See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu. - uint64 cpu_m = 2; - // Disk size in bytes. - uint64 disk_size = 3; -} - -// DBClusterType represents database cluster type. -enum DBClusterType { - // DB_CLUSTER_TYPE_INVALID represents unknown cluster type. - DB_CLUSTER_TYPE_INVALID = 0; - // DB_CLUSTER_TYPE_PXC represents pxc cluster type. - DB_CLUSTER_TYPE_PXC = 1; - // DB_CLUSTER_TYPE_PSMDB represents psmdb cluster type. - DB_CLUSTER_TYPE_PSMDB = 2; -} - -// OperatorsStatus defines status of operators installed in Kubernetes cluster. -enum OperatorsStatus { - // OPERATORS_STATUS_INVALID represents unknown state. - OPERATORS_STATUS_INVALID = 0; - // OPERATORS_STATUS_OK represents that operators are installed and have supported API version. - OPERATORS_STATUS_OK = 1; - // OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version. - OPERATORS_STATUS_UNSUPPORTED = 2; - // OPERATORS_STATUS_NOT_INSTALLED represents that operators are not installed. - OPERATORS_STATUS_NOT_INSTALLED = 3; -} 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 deleted file mode 100644 index 994b10c916..0000000000 --- a/api/managementpb/dbaas/json/client/components/change_psmdb_components_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package components - -// 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" -) - -// 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 { - return &ChangePSMDBComponentsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewChangePSMDBComponentsParamsWithTimeout creates a new ChangePSMDBComponentsParams object -// with the ability to set a timeout on a request. -func NewChangePSMDBComponentsParamsWithTimeout(timeout time.Duration) *ChangePSMDBComponentsParams { - return &ChangePSMDBComponentsParams{ - timeout: timeout, - } -} - -// NewChangePSMDBComponentsParamsWithContext creates a new ChangePSMDBComponentsParams object -// with the ability to set a context for a request. -func NewChangePSMDBComponentsParamsWithContext(ctx context.Context) *ChangePSMDBComponentsParams { - return &ChangePSMDBComponentsParams{ - Context: ctx, - } -} - -// NewChangePSMDBComponentsParamsWithHTTPClient creates a new ChangePSMDBComponentsParams object -// with the ability to set a custom HTTPClient for a request. -func NewChangePSMDBComponentsParamsWithHTTPClient(client *http.Client) *ChangePSMDBComponentsParams { - 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. -*/ -type ChangePSMDBComponentsParams struct { - // Body. - Body ChangePSMDBComponentsBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the change PSMDB components params -func (o *ChangePSMDBComponentsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the change PSMDB components params -func (o *ChangePSMDBComponentsParams) WithContext(ctx context.Context) *ChangePSMDBComponentsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the change PSMDB components params -func (o *ChangePSMDBComponentsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the change PSMDB components params -func (o *ChangePSMDBComponentsParams) WithHTTPClient(client *http.Client) *ChangePSMDBComponentsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the change PSMDB components params -func (o *ChangePSMDBComponentsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the change PSMDB components params -func (o *ChangePSMDBComponentsParams) WithBody(body ChangePSMDBComponentsBody) *ChangePSMDBComponentsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the change PSMDB components params -func (o *ChangePSMDBComponentsParams) SetBody(body ChangePSMDBComponentsBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ChangePSMDBComponentsParams) 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/managementpb/dbaas/json/client/components/change_psmdb_components_responses.go b/api/managementpb/dbaas/json/client/components/change_psmdb_components_responses.go deleted file mode 100644 index e0109e186b..0000000000 --- a/api/managementpb/dbaas/json/client/components/change_psmdb_components_responses.go +++ /dev/null @@ -1,494 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package components - -// 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" -) - -// ChangePSMDBComponentsReader is a Reader for the ChangePSMDBComponents structure. -type ChangePSMDBComponentsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ChangePSMDBComponentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewChangePSMDBComponentsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewChangePSMDBComponentsDefault(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 - } -} - -// NewChangePSMDBComponentsOK creates a ChangePSMDBComponentsOK with default headers values -func NewChangePSMDBComponentsOK() *ChangePSMDBComponentsOK { - return &ChangePSMDBComponentsOK{} -} - -/* -ChangePSMDBComponentsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ChangePSMDBComponentsOK struct { - Payload interface{} -} - -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 -} - -func (o *ChangePSMDBComponentsOK) 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 -} - -// NewChangePSMDBComponentsDefault creates a ChangePSMDBComponentsDefault with default headers values -func NewChangePSMDBComponentsDefault(code int) *ChangePSMDBComponentsDefault { - return &ChangePSMDBComponentsDefault{ - _statusCode: code, - } -} - -/* -ChangePSMDBComponentsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ChangePSMDBComponentsDefault struct { - _statusCode int - - Payload *ChangePSMDBComponentsDefaultBody -} - -// Code gets the status code for the change PSMDB components default response -func (o *ChangePSMDBComponentsDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *ChangePSMDBComponentsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ChangePSMDBComponentsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ChangePSMDBComponentsBody change PSMDB components body -swagger:model ChangePSMDBComponentsBody -*/ -type ChangePSMDBComponentsBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // mongod - Mongod *ChangePSMDBComponentsParamsBodyMongod `json:"mongod,omitempty"` -} - -// Validate validates this change PSMDB components body -func (o *ChangePSMDBComponentsBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateMongod(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangePSMDBComponentsBody) validateMongod(formats strfmt.Registry) error { - if swag.IsZero(o.Mongod) { // not required - return nil - } - - if o.Mongod != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangePSMDBComponentsBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangePSMDBComponentsBody) UnmarshalBinary(b []byte) error { - var res ChangePSMDBComponentsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangePSMDBComponentsDefaultBody change PSMDB components default body -swagger:model ChangePSMDBComponentsDefaultBody -*/ -type ChangePSMDBComponentsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ChangePSMDBComponentsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this change PSMDB components default body -func (o *ChangePSMDBComponentsDefaultBody) 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 *ChangePSMDBComponentsDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangePSMDBComponentsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangePSMDBComponentsDefaultBody) UnmarshalBinary(b []byte) error { - var res ChangePSMDBComponentsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangePSMDBComponentsDefaultBodyDetailsItems0 change PSMDB components default body details items0 -swagger:model ChangePSMDBComponentsDefaultBodyDetailsItems0 -*/ -type ChangePSMDBComponentsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 -*/ -type ChangePSMDBComponentsParamsBodyMongod struct { - // default version - DefaultVersion string `json:"default_version,omitempty"` - - // versions - Versions []*ChangePSMDBComponentsParamsBodyMongodVersionsItems0 `json:"versions"` -} - -// Validate validates this change PSMDB components params body mongod -func (o *ChangePSMDBComponentsParamsBodyMongod) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateVersions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangePSMDBComponentsParamsBodyMongod) validateVersions(formats strfmt.Registry) error { - if swag.IsZero(o.Versions) { // not required - return nil - } - - for i := 0; i < len(o.Versions); i++ { - if swag.IsZero(o.Versions[i]) { // not required - continue - } - - if o.Versions[i] != nil { - 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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangePSMDBComponentsParamsBodyMongod) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangePSMDBComponentsParamsBodyMongod) UnmarshalBinary(b []byte) error { - var res ChangePSMDBComponentsParamsBodyMongod - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangePSMDBComponentsParamsBodyMongodVersionsItems0 ComponentVersion contains operations which should be done with component version. -swagger:model ChangePSMDBComponentsParamsBodyMongodVersionsItems0 -*/ -type ChangePSMDBComponentsParamsBodyMongodVersionsItems0 struct { - // version - Version string `json:"version,omitempty"` - - // disable - Disable bool `json:"disable,omitempty"` - - // enable - Enable bool `json:"enable,omitempty"` -} - -// Validate validates this change PSMDB components params body mongod versions items0 -func (o *ChangePSMDBComponentsParamsBodyMongodVersionsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// 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 *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 -} 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 deleted file mode 100644 index 70fe656ec4..0000000000 --- a/api/managementpb/dbaas/json/client/components/change_pxc_components_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package components - -// 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" -) - -// 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 { - return &ChangePXCComponentsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewChangePXCComponentsParamsWithTimeout creates a new ChangePXCComponentsParams object -// with the ability to set a timeout on a request. -func NewChangePXCComponentsParamsWithTimeout(timeout time.Duration) *ChangePXCComponentsParams { - return &ChangePXCComponentsParams{ - timeout: timeout, - } -} - -// NewChangePXCComponentsParamsWithContext creates a new ChangePXCComponentsParams object -// with the ability to set a context for a request. -func NewChangePXCComponentsParamsWithContext(ctx context.Context) *ChangePXCComponentsParams { - return &ChangePXCComponentsParams{ - Context: ctx, - } -} - -// NewChangePXCComponentsParamsWithHTTPClient creates a new ChangePXCComponentsParams object -// with the ability to set a custom HTTPClient for a request. -func NewChangePXCComponentsParamsWithHTTPClient(client *http.Client) *ChangePXCComponentsParams { - 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. -*/ -type ChangePXCComponentsParams struct { - // Body. - Body ChangePXCComponentsBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the change PXC components params -func (o *ChangePXCComponentsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the change PXC components params -func (o *ChangePXCComponentsParams) WithContext(ctx context.Context) *ChangePXCComponentsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the change PXC components params -func (o *ChangePXCComponentsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the change PXC components params -func (o *ChangePXCComponentsParams) WithHTTPClient(client *http.Client) *ChangePXCComponentsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the change PXC components params -func (o *ChangePXCComponentsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the change PXC components params -func (o *ChangePXCComponentsParams) WithBody(body ChangePXCComponentsBody) *ChangePXCComponentsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the change PXC components params -func (o *ChangePXCComponentsParams) SetBody(body ChangePXCComponentsBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ChangePXCComponentsParams) 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/managementpb/dbaas/json/client/components/change_pxc_components_responses.go b/api/managementpb/dbaas/json/client/components/change_pxc_components_responses.go deleted file mode 100644 index 859e985218..0000000000 --- a/api/managementpb/dbaas/json/client/components/change_pxc_components_responses.go +++ /dev/null @@ -1,872 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package components - -// 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" -) - -// ChangePXCComponentsReader is a Reader for the ChangePXCComponents structure. -type ChangePXCComponentsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ChangePXCComponentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewChangePXCComponentsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewChangePXCComponentsDefault(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 - } -} - -// NewChangePXCComponentsOK creates a ChangePXCComponentsOK with default headers values -func NewChangePXCComponentsOK() *ChangePXCComponentsOK { - return &ChangePXCComponentsOK{} -} - -/* -ChangePXCComponentsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ChangePXCComponentsOK struct { - Payload interface{} -} - -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 -} - -func (o *ChangePXCComponentsOK) 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 -} - -// NewChangePXCComponentsDefault creates a ChangePXCComponentsDefault with default headers values -func NewChangePXCComponentsDefault(code int) *ChangePXCComponentsDefault { - return &ChangePXCComponentsDefault{ - _statusCode: code, - } -} - -/* -ChangePXCComponentsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ChangePXCComponentsDefault struct { - _statusCode int - - Payload *ChangePXCComponentsDefaultBody -} - -// Code gets the status code for the change PXC components default response -func (o *ChangePXCComponentsDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *ChangePXCComponentsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ChangePXCComponentsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ChangePXCComponentsBody change PXC components body -swagger:model ChangePXCComponentsBody -*/ -type ChangePXCComponentsBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // haproxy - Haproxy *ChangePXCComponentsParamsBodyHaproxy `json:"haproxy,omitempty"` - - // proxysql - Proxysql *ChangePXCComponentsParamsBodyProxysql `json:"proxysql,omitempty"` - - // pxc - PXC *ChangePXCComponentsParamsBodyPXC `json:"pxc,omitempty"` -} - -// Validate validates this change PXC components body -func (o *ChangePXCComponentsBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateHaproxy(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePXC(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangePXCComponentsBody) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if o.Haproxy != nil { - if err := o.Haproxy.Validate(formats); err != nil { - 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) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if o.Proxysql != nil { - if err := o.Proxysql.Validate(formats); err != nil { - 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) validatePXC(formats strfmt.Registry) error { - if swag.IsZero(o.PXC) { // not required - return nil - } - - if o.PXC != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangePXCComponentsBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangePXCComponentsBody) UnmarshalBinary(b []byte) error { - var res ChangePXCComponentsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangePXCComponentsDefaultBody change PXC components default body -swagger:model ChangePXCComponentsDefaultBody -*/ -type ChangePXCComponentsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ChangePXCComponentsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this change PXC components default body -func (o *ChangePXCComponentsDefaultBody) 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 *ChangePXCComponentsDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangePXCComponentsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangePXCComponentsDefaultBody) UnmarshalBinary(b []byte) error { - var res ChangePXCComponentsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangePXCComponentsDefaultBodyDetailsItems0 change PXC components default body details items0 -swagger:model ChangePXCComponentsDefaultBodyDetailsItems0 -*/ -type ChangePXCComponentsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 -*/ -type ChangePXCComponentsParamsBodyHaproxy struct { - // default version - DefaultVersion string `json:"default_version,omitempty"` - - // versions - Versions []*ChangePXCComponentsParamsBodyHaproxyVersionsItems0 `json:"versions"` -} - -// Validate validates this change PXC components params body haproxy -func (o *ChangePXCComponentsParamsBodyHaproxy) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateVersions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangePXCComponentsParamsBodyHaproxy) validateVersions(formats strfmt.Registry) error { - if swag.IsZero(o.Versions) { // not required - return nil - } - - for i := 0; i < len(o.Versions); i++ { - if swag.IsZero(o.Versions[i]) { // not required - continue - } - - if o.Versions[i] != nil { - 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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangePXCComponentsParamsBodyHaproxy) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangePXCComponentsParamsBodyHaproxy) UnmarshalBinary(b []byte) error { - var res ChangePXCComponentsParamsBodyHaproxy - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangePXCComponentsParamsBodyHaproxyVersionsItems0 ComponentVersion contains operations which should be done with component version. -swagger:model ChangePXCComponentsParamsBodyHaproxyVersionsItems0 -*/ -type ChangePXCComponentsParamsBodyHaproxyVersionsItems0 struct { - // version - Version string `json:"version,omitempty"` - - // disable - Disable bool `json:"disable,omitempty"` - - // enable - Enable bool `json:"enable,omitempty"` -} - -// Validate validates this change PXC components params body haproxy versions items0 -func (o *ChangePXCComponentsParamsBodyHaproxyVersionsItems0) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangePXCComponentsParamsBodyHaproxyVersionsItems0) UnmarshalBinary(b []byte) error { - var res ChangePXCComponentsParamsBodyHaproxyVersionsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangePXCComponentsParamsBodyPXC ChangeComponent contains fields to manage components. -swagger:model ChangePXCComponentsParamsBodyPXC -*/ -type ChangePXCComponentsParamsBodyPXC struct { - // default version - DefaultVersion string `json:"default_version,omitempty"` - - // versions - Versions []*ChangePXCComponentsParamsBodyPXCVersionsItems0 `json:"versions"` -} - -// Validate validates this change PXC components params body PXC -func (o *ChangePXCComponentsParamsBodyPXC) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateVersions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangePXCComponentsParamsBodyPXC) validateVersions(formats strfmt.Registry) error { - if swag.IsZero(o.Versions) { // not required - return nil - } - - for i := 0; i < len(o.Versions); i++ { - if swag.IsZero(o.Versions[i]) { // not required - continue - } - - if o.Versions[i] != nil { - 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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangePXCComponentsParamsBodyPXC) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangePXCComponentsParamsBodyPXC) UnmarshalBinary(b []byte) error { - var res ChangePXCComponentsParamsBodyPXC - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangePXCComponentsParamsBodyPXCVersionsItems0 ComponentVersion contains operations which should be done with component version. -swagger:model ChangePXCComponentsParamsBodyPXCVersionsItems0 -*/ -type ChangePXCComponentsParamsBodyPXCVersionsItems0 struct { - // version - Version string `json:"version,omitempty"` - - // disable - Disable bool `json:"disable,omitempty"` - - // enable - Enable bool `json:"enable,omitempty"` -} - -// Validate validates this change PXC components params body PXC versions items0 -func (o *ChangePXCComponentsParamsBodyPXCVersionsItems0) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangePXCComponentsParamsBodyPXCVersionsItems0) UnmarshalBinary(b []byte) error { - var res ChangePXCComponentsParamsBodyPXCVersionsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangePXCComponentsParamsBodyProxysql ChangeComponent contains fields to manage components. -swagger:model ChangePXCComponentsParamsBodyProxysql -*/ -type ChangePXCComponentsParamsBodyProxysql struct { - // default version - DefaultVersion string `json:"default_version,omitempty"` - - // versions - Versions []*ChangePXCComponentsParamsBodyProxysqlVersionsItems0 `json:"versions"` -} - -// Validate validates this change PXC components params body proxysql -func (o *ChangePXCComponentsParamsBodyProxysql) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateVersions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ChangePXCComponentsParamsBodyProxysql) validateVersions(formats strfmt.Registry) error { - if swag.IsZero(o.Versions) { // not required - return nil - } - - for i := 0; i < len(o.Versions); i++ { - if swag.IsZero(o.Versions[i]) { // not required - continue - } - - if o.Versions[i] != nil { - 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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ChangePXCComponentsParamsBodyProxysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangePXCComponentsParamsBodyProxysql) UnmarshalBinary(b []byte) error { - var res ChangePXCComponentsParamsBodyProxysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ChangePXCComponentsParamsBodyProxysqlVersionsItems0 ComponentVersion contains operations which should be done with component version. -swagger:model ChangePXCComponentsParamsBodyProxysqlVersionsItems0 -*/ -type ChangePXCComponentsParamsBodyProxysqlVersionsItems0 struct { - // version - Version string `json:"version,omitempty"` - - // disable - Disable bool `json:"disable,omitempty"` - - // enable - Enable bool `json:"enable,omitempty"` -} - -// Validate validates this change PXC components params body proxysql versions items0 -func (o *ChangePXCComponentsParamsBodyProxysqlVersionsItems0) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ChangePXCComponentsParamsBodyProxysqlVersionsItems0) UnmarshalBinary(b []byte) error { - var res ChangePXCComponentsParamsBodyProxysqlVersionsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return 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 deleted file mode 100644 index dab12d01aa..0000000000 --- a/api/managementpb/dbaas/json/client/components/check_for_operator_update_parameters.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package components - -// 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" -) - -// 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 { - return &CheckForOperatorUpdateParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCheckForOperatorUpdateParamsWithTimeout creates a new CheckForOperatorUpdateParams object -// with the ability to set a timeout on a request. -func NewCheckForOperatorUpdateParamsWithTimeout(timeout time.Duration) *CheckForOperatorUpdateParams { - return &CheckForOperatorUpdateParams{ - timeout: timeout, - } -} - -// NewCheckForOperatorUpdateParamsWithContext creates a new CheckForOperatorUpdateParams object -// with the ability to set a context for a request. -func NewCheckForOperatorUpdateParamsWithContext(ctx context.Context) *CheckForOperatorUpdateParams { - return &CheckForOperatorUpdateParams{ - Context: ctx, - } -} - -// NewCheckForOperatorUpdateParamsWithHTTPClient creates a new CheckForOperatorUpdateParams object -// with the ability to set a custom HTTPClient for a request. -func NewCheckForOperatorUpdateParamsWithHTTPClient(client *http.Client) *CheckForOperatorUpdateParams { - 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. -*/ -type CheckForOperatorUpdateParams struct { - // Body. - Body interface{} - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the check for operator update params -func (o *CheckForOperatorUpdateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the check for operator update params -func (o *CheckForOperatorUpdateParams) WithContext(ctx context.Context) *CheckForOperatorUpdateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the check for operator update params -func (o *CheckForOperatorUpdateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the check for operator update params -func (o *CheckForOperatorUpdateParams) WithHTTPClient(client *http.Client) *CheckForOperatorUpdateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the check for operator update params -func (o *CheckForOperatorUpdateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the check for operator update params -func (o *CheckForOperatorUpdateParams) WithBody(body interface{}) *CheckForOperatorUpdateParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the check for operator update params -func (o *CheckForOperatorUpdateParams) SetBody(body interface{}) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CheckForOperatorUpdateParams) 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/managementpb/dbaas/json/client/components/check_for_operator_update_responses.go b/api/managementpb/dbaas/json/client/components/check_for_operator_update_responses.go deleted file mode 100644 index 796a42c153..0000000000 --- a/api/managementpb/dbaas/json/client/components/check_for_operator_update_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package components - -// 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" -) - -// CheckForOperatorUpdateReader is a Reader for the CheckForOperatorUpdate structure. -type CheckForOperatorUpdateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CheckForOperatorUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCheckForOperatorUpdateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewCheckForOperatorUpdateDefault(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 - } -} - -// NewCheckForOperatorUpdateOK creates a CheckForOperatorUpdateOK with default headers values -func NewCheckForOperatorUpdateOK() *CheckForOperatorUpdateOK { - return &CheckForOperatorUpdateOK{} -} - -/* -CheckForOperatorUpdateOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type CheckForOperatorUpdateOK struct { - Payload *CheckForOperatorUpdateOKBody -} - -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 -} - -func (o *CheckForOperatorUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(CheckForOperatorUpdateOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCheckForOperatorUpdateDefault creates a CheckForOperatorUpdateDefault with default headers values -func NewCheckForOperatorUpdateDefault(code int) *CheckForOperatorUpdateDefault { - return &CheckForOperatorUpdateDefault{ - _statusCode: code, - } -} - -/* -CheckForOperatorUpdateDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type CheckForOperatorUpdateDefault struct { - _statusCode int - - Payload *CheckForOperatorUpdateDefaultBody -} - -// Code gets the status code for the check for operator update default response -func (o *CheckForOperatorUpdateDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *CheckForOperatorUpdateDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(CheckForOperatorUpdateDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -CheckForOperatorUpdateDefaultBody check for operator update default body -swagger:model CheckForOperatorUpdateDefaultBody -*/ -type CheckForOperatorUpdateDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*CheckForOperatorUpdateDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this check for operator update default body -func (o *CheckForOperatorUpdateDefaultBody) 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 *CheckForOperatorUpdateDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CheckForOperatorUpdateDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CheckForOperatorUpdateDefaultBody) UnmarshalBinary(b []byte) error { - var res CheckForOperatorUpdateDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CheckForOperatorUpdateDefaultBodyDetailsItems0 check for operator update default body details items0 -swagger:model CheckForOperatorUpdateDefaultBodyDetailsItems0 -*/ -type CheckForOperatorUpdateDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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]CheckForOperatorUpdateOKBodyClusterToComponentsAnon `json:"cluster_to_components,omitempty"` -} - -// Validate validates this check for operator update OK body -func (o *CheckForOperatorUpdateOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateClusterToComponents(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CheckForOperatorUpdateOKBody) validateClusterToComponents(formats strfmt.Registry) error { - if swag.IsZero(o.ClusterToComponents) { // not required - return nil - } - - for k := range o.ClusterToComponents { - - if swag.IsZero(o.ClusterToComponents[k]) { // not required - continue - } - 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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CheckForOperatorUpdateOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CheckForOperatorUpdateOKBody) UnmarshalBinary(b []byte) error { - var res CheckForOperatorUpdateOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CheckForOperatorUpdateOKBodyClusterToComponentsAnon ComponentsUpdateInformation contains info about components and their available latest versions. -swagger:model CheckForOperatorUpdateOKBodyClusterToComponentsAnon -*/ -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]CheckForOperatorUpdateOKBodyClusterToComponentsAnonComponentToUpdateInformationAnon `json:"component_to_update_information,omitempty"` -} - -// 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 { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CheckForOperatorUpdateOKBodyClusterToComponentsAnon) validateComponentToUpdateInformation(formats strfmt.Registry) error { - if swag.IsZero(o.ComponentToUpdateInformation) { // not required - return nil - } - - for k := range o.ComponentToUpdateInformation { - - if swag.IsZero(o.ComponentToUpdateInformation[k]) { // not required - continue - } - 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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CheckForOperatorUpdateOKBodyClusterToComponentsAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CheckForOperatorUpdateOKBodyClusterToComponentsAnon) UnmarshalBinary(b []byte) error { - var res CheckForOperatorUpdateOKBodyClusterToComponentsAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CheckForOperatorUpdateOKBodyClusterToComponentsAnonComponentToUpdateInformationAnon ComponentUpdateInformation contains version we can update to for certain component. -swagger:model CheckForOperatorUpdateOKBodyClusterToComponentsAnonComponentToUpdateInformationAnon -*/ -type CheckForOperatorUpdateOKBodyClusterToComponentsAnonComponentToUpdateInformationAnon struct { - // available version - AvailableVersion string `json:"available_version,omitempty"` -} - -// 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 *CheckForOperatorUpdateOKBodyClusterToComponentsAnonComponentToUpdateInformationAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CheckForOperatorUpdateOKBodyClusterToComponentsAnonComponentToUpdateInformationAnon) UnmarshalBinary(b []byte) error { - var res CheckForOperatorUpdateOKBodyClusterToComponentsAnonComponentToUpdateInformationAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/dbaas/json/client/components/components_client.go b/api/managementpb/dbaas/json/client/components/components_client.go deleted file mode 100644 index f8e2158d82..0000000000 --- a/api/managementpb/dbaas/json/client/components/components_client.go +++ /dev/null @@ -1,271 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package components - -// 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 components API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for components 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 { - ChangePSMDBComponents(params *ChangePSMDBComponentsParams, opts ...ClientOption) (*ChangePSMDBComponentsOK, error) - - ChangePXCComponents(params *ChangePXCComponentsParams, opts ...ClientOption) (*ChangePXCComponentsOK, error) - - CheckForOperatorUpdate(params *CheckForOperatorUpdateParams, opts ...ClientOption) (*CheckForOperatorUpdateOK, error) - - GetPSMDBComponents(params *GetPSMDBComponentsParams, opts ...ClientOption) (*GetPSMDBComponentsOK, error) - - GetPXCComponents(params *GetPXCComponentsParams, opts ...ClientOption) (*GetPXCComponentsOK, error) - - InstallOperator(params *InstallOperatorParams, opts ...ClientOption) (*InstallOperatorOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -ChangePSMDBComponents changes PSMDB components manages PSMDB related components -*/ -func (a *Client) ChangePSMDBComponents(params *ChangePSMDBComponentsParams, opts ...ClientOption) (*ChangePSMDBComponentsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewChangePSMDBComponentsParams() - } - op := &runtime.ClientOperation{ - ID: "ChangePSMDBComponents", - Method: "POST", - PathPattern: "/v1/management/DBaaS/Components/ChangePSMDB", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*ChangePSMDBComponentsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*ChangePSMDBComponentsDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ChangePXCComponents changes PXC components manages PXC related components -*/ -func (a *Client) ChangePXCComponents(params *ChangePXCComponentsParams, opts ...ClientOption) (*ChangePXCComponentsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewChangePXCComponentsParams() - } - op := &runtime.ClientOperation{ - ID: "ChangePXCComponents", - Method: "POST", - PathPattern: "/v1/management/DBaaS/Components/ChangePXC", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*ChangePXCComponentsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*ChangePXCComponentsDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -CheckForOperatorUpdate checks for operator update checks if a new version of an operator is available -*/ -func (a *Client) CheckForOperatorUpdate(params *CheckForOperatorUpdateParams, opts ...ClientOption) (*CheckForOperatorUpdateOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCheckForOperatorUpdateParams() - } - op := &runtime.ClientOperation{ - ID: "CheckForOperatorUpdate", - Method: "POST", - PathPattern: "/v1/management/DBaaS/Components/CheckForOperatorUpdate", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*CheckForOperatorUpdateOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*CheckForOperatorUpdateDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetPSMDBComponents gets PSMDB components returns list of available components for PSMDB clusters -*/ -func (a *Client) GetPSMDBComponents(params *GetPSMDBComponentsParams, opts ...ClientOption) (*GetPSMDBComponentsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetPSMDBComponentsParams() - } - op := &runtime.ClientOperation{ - ID: "GetPSMDBComponents", - Method: "POST", - PathPattern: "/v1/management/DBaaS/Components/GetPSMDB", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*GetPSMDBComponentsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetPSMDBComponentsDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetPXCComponents gets PXC components returns list of available components for PXC clusters -*/ -func (a *Client) GetPXCComponents(params *GetPXCComponentsParams, opts ...ClientOption) (*GetPXCComponentsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetPXCComponentsParams() - } - op := &runtime.ClientOperation{ - ID: "GetPXCComponents", - Method: "POST", - PathPattern: "/v1/management/DBaaS/Components/GetPXC", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*GetPXCComponentsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetPXCComponentsDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -InstallOperator installs operator installs given operator in given version -*/ -func (a *Client) InstallOperator(params *InstallOperatorParams, opts ...ClientOption) (*InstallOperatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewInstallOperatorParams() - } - op := &runtime.ClientOperation{ - ID: "InstallOperator", - Method: "POST", - PathPattern: "/v1/management/DBaaS/Components/InstallOperator", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*InstallOperatorOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*InstallOperatorDefault) - 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/managementpb/dbaas/json/client/components/get_psmdb_components_parameters.go b/api/managementpb/dbaas/json/client/components/get_psmdb_components_parameters.go deleted file mode 100644 index 0aab5f9ce7..0000000000 --- a/api/managementpb/dbaas/json/client/components/get_psmdb_components_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package components - -// 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" -) - -// 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 { - return &GetPSMDBComponentsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetPSMDBComponentsParamsWithTimeout creates a new GetPSMDBComponentsParams object -// with the ability to set a timeout on a request. -func NewGetPSMDBComponentsParamsWithTimeout(timeout time.Duration) *GetPSMDBComponentsParams { - return &GetPSMDBComponentsParams{ - timeout: timeout, - } -} - -// NewGetPSMDBComponentsParamsWithContext creates a new GetPSMDBComponentsParams object -// with the ability to set a context for a request. -func NewGetPSMDBComponentsParamsWithContext(ctx context.Context) *GetPSMDBComponentsParams { - return &GetPSMDBComponentsParams{ - Context: ctx, - } -} - -// NewGetPSMDBComponentsParamsWithHTTPClient creates a new GetPSMDBComponentsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetPSMDBComponentsParamsWithHTTPClient(client *http.Client) *GetPSMDBComponentsParams { - 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. -*/ -type GetPSMDBComponentsParams struct { - // Body. - Body GetPSMDBComponentsBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the get PSMDB components params -func (o *GetPSMDBComponentsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get PSMDB components params -func (o *GetPSMDBComponentsParams) WithContext(ctx context.Context) *GetPSMDBComponentsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get PSMDB components params -func (o *GetPSMDBComponentsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get PSMDB components params -func (o *GetPSMDBComponentsParams) WithHTTPClient(client *http.Client) *GetPSMDBComponentsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get PSMDB components params -func (o *GetPSMDBComponentsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get PSMDB components params -func (o *GetPSMDBComponentsParams) WithBody(body GetPSMDBComponentsBody) *GetPSMDBComponentsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get PSMDB components params -func (o *GetPSMDBComponentsParams) SetBody(body GetPSMDBComponentsBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetPSMDBComponentsParams) 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/managementpb/dbaas/json/client/components/get_psmdb_components_responses.go b/api/managementpb/dbaas/json/client/components/get_psmdb_components_responses.go deleted file mode 100644 index 5af5569de2..0000000000 --- a/api/managementpb/dbaas/json/client/components/get_psmdb_components_responses.go +++ /dev/null @@ -1,1345 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package components - -// 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" -) - -// GetPSMDBComponentsReader is a Reader for the GetPSMDBComponents structure. -type GetPSMDBComponentsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetPSMDBComponentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetPSMDBComponentsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetPSMDBComponentsDefault(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 - } -} - -// NewGetPSMDBComponentsOK creates a GetPSMDBComponentsOK with default headers values -func NewGetPSMDBComponentsOK() *GetPSMDBComponentsOK { - return &GetPSMDBComponentsOK{} -} - -/* -GetPSMDBComponentsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetPSMDBComponentsOK struct { - Payload *GetPSMDBComponentsOKBody -} - -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 -} - -func (o *GetPSMDBComponentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetPSMDBComponentsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetPSMDBComponentsDefault creates a GetPSMDBComponentsDefault with default headers values -func NewGetPSMDBComponentsDefault(code int) *GetPSMDBComponentsDefault { - return &GetPSMDBComponentsDefault{ - _statusCode: code, - } -} - -/* -GetPSMDBComponentsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetPSMDBComponentsDefault struct { - _statusCode int - - Payload *GetPSMDBComponentsDefaultBody -} - -// Code gets the status code for the get PSMDB components default response -func (o *GetPSMDBComponentsDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *GetPSMDBComponentsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetPSMDBComponentsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -GetPSMDBComponentsBody get PSMDB components body -swagger:model GetPSMDBComponentsBody -*/ -type GetPSMDBComponentsBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // Version of DB. - DBVersion string `json:"db_version,omitempty"` -} - -// Validate validates this get PSMDB components body -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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBComponentsBody) UnmarshalBinary(b []byte) error { - var res GetPSMDBComponentsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBComponentsDefaultBody get PSMDB components default body -swagger:model GetPSMDBComponentsDefaultBody -*/ -type GetPSMDBComponentsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetPSMDBComponentsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get PSMDB components default body -func (o *GetPSMDBComponentsDefaultBody) 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 *GetPSMDBComponentsDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPSMDBComponentsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBComponentsDefaultBody) UnmarshalBinary(b []byte) error { - var res GetPSMDBComponentsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBComponentsDefaultBodyDetailsItems0 get PSMDB components default body details items0 -swagger:model GetPSMDBComponentsDefaultBodyDetailsItems0 -*/ -type GetPSMDBComponentsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 []*GetPSMDBComponentsOKBodyVersionsItems0 `json:"versions"` -} - -// Validate validates this get PSMDB components OK body -func (o *GetPSMDBComponentsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateVersions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetPSMDBComponentsOKBody) validateVersions(formats strfmt.Registry) error { - if swag.IsZero(o.Versions) { // not required - return nil - } - - for i := 0; i < len(o.Versions); i++ { - if swag.IsZero(o.Versions[i]) { // not required - continue - } - - if o.Versions[i] != nil { - 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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPSMDBComponentsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBComponentsOKBody) UnmarshalBinary(b []byte) error { - var res GetPSMDBComponentsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBComponentsOKBodyVersionsItems0 OperatorVersion contains information about operator and components matrix. -swagger:model GetPSMDBComponentsOKBodyVersionsItems0 -*/ -type GetPSMDBComponentsOKBodyVersionsItems0 struct { - // product - Product string `json:"product,omitempty"` - - // operator - Operator string `json:"operator,omitempty"` - - // matrix - Matrix *GetPSMDBComponentsOKBodyVersionsItems0Matrix `json:"matrix,omitempty"` -} - -// 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 { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetPSMDBComponentsOKBodyVersionsItems0) 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 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPSMDBComponentsOKBodyVersionsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBComponentsOKBodyVersionsItems0) UnmarshalBinary(b []byte) error { - var res GetPSMDBComponentsOKBodyVersionsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBComponentsOKBodyVersionsItems0Matrix Matrix contains all available components. -swagger:model GetPSMDBComponentsOKBodyVersionsItems0Matrix -*/ -type GetPSMDBComponentsOKBodyVersionsItems0Matrix struct { - // mongod - Mongod map[string]GetPSMDBComponentsOKBodyVersionsItems0MatrixMongodAnon `json:"mongod,omitempty"` - - // pxc - PXC map[string]GetPSMDBComponentsOKBodyVersionsItems0MatrixPXCAnon `json:"pxc,omitempty"` - - // pmm - PMM map[string]GetPSMDBComponentsOKBodyVersionsItems0MatrixPMMAnon `json:"pmm,omitempty"` - - // proxysql - Proxysql map[string]GetPSMDBComponentsOKBodyVersionsItems0MatrixProxysqlAnon `json:"proxysql,omitempty"` - - // haproxy - Haproxy map[string]GetPSMDBComponentsOKBodyVersionsItems0MatrixHaproxyAnon `json:"haproxy,omitempty"` - - // backup - Backup map[string]GetPSMDBComponentsOKBodyVersionsItems0MatrixBackupAnon `json:"backup,omitempty"` - - // operator - Operator map[string]GetPSMDBComponentsOKBodyVersionsItems0MatrixOperatorAnon `json:"operator,omitempty"` - - // log collector - LogCollector map[string]GetPSMDBComponentsOKBodyVersionsItems0MatrixLogCollectorAnon `json:"log_collector,omitempty"` -} - -// 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 { - 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 *GetPSMDBComponentsOKBodyVersionsItems0Matrix) 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 *GetPSMDBComponentsOKBodyVersionsItems0Matrix) 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 *GetPSMDBComponentsOKBodyVersionsItems0Matrix) 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 *GetPSMDBComponentsOKBodyVersionsItems0Matrix) 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 *GetPSMDBComponentsOKBodyVersionsItems0Matrix) 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 *GetPSMDBComponentsOKBodyVersionsItems0Matrix) 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 *GetPSMDBComponentsOKBodyVersionsItems0Matrix) 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 *GetPSMDBComponentsOKBodyVersionsItems0Matrix) 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 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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBComponentsOKBodyVersionsItems0Matrix) UnmarshalBinary(b []byte) error { - var res GetPSMDBComponentsOKBodyVersionsItems0Matrix - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBComponentsOKBodyVersionsItems0MatrixBackupAnon Component contains information about component. -swagger:model GetPSMDBComponentsOKBodyVersionsItems0MatrixBackupAnon -*/ -type GetPSMDBComponentsOKBodyVersionsItems0MatrixBackupAnon 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 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 *GetPSMDBComponentsOKBodyVersionsItems0MatrixBackupAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixBackupAnon) UnmarshalBinary(b []byte) error { - var res GetPSMDBComponentsOKBodyVersionsItems0MatrixBackupAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBComponentsOKBodyVersionsItems0MatrixHaproxyAnon Component contains information about component. -swagger:model GetPSMDBComponentsOKBodyVersionsItems0MatrixHaproxyAnon -*/ -type GetPSMDBComponentsOKBodyVersionsItems0MatrixHaproxyAnon 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 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 *GetPSMDBComponentsOKBodyVersionsItems0MatrixHaproxyAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixHaproxyAnon) UnmarshalBinary(b []byte) error { - var res GetPSMDBComponentsOKBodyVersionsItems0MatrixHaproxyAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBComponentsOKBodyVersionsItems0MatrixLogCollectorAnon Component contains information about component. -swagger:model GetPSMDBComponentsOKBodyVersionsItems0MatrixLogCollectorAnon -*/ -type GetPSMDBComponentsOKBodyVersionsItems0MatrixLogCollectorAnon 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 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 *GetPSMDBComponentsOKBodyVersionsItems0MatrixLogCollectorAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixLogCollectorAnon) UnmarshalBinary(b []byte) error { - var res GetPSMDBComponentsOKBodyVersionsItems0MatrixLogCollectorAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBComponentsOKBodyVersionsItems0MatrixMongodAnon Component contains information about component. -swagger:model GetPSMDBComponentsOKBodyVersionsItems0MatrixMongodAnon -*/ -type GetPSMDBComponentsOKBodyVersionsItems0MatrixMongodAnon 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 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 *GetPSMDBComponentsOKBodyVersionsItems0MatrixMongodAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixMongodAnon) UnmarshalBinary(b []byte) error { - var res GetPSMDBComponentsOKBodyVersionsItems0MatrixMongodAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBComponentsOKBodyVersionsItems0MatrixOperatorAnon Component contains information about component. -swagger:model GetPSMDBComponentsOKBodyVersionsItems0MatrixOperatorAnon -*/ -type GetPSMDBComponentsOKBodyVersionsItems0MatrixOperatorAnon 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 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 *GetPSMDBComponentsOKBodyVersionsItems0MatrixOperatorAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixOperatorAnon) UnmarshalBinary(b []byte) error { - var res GetPSMDBComponentsOKBodyVersionsItems0MatrixOperatorAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBComponentsOKBodyVersionsItems0MatrixPMMAnon Component contains information about component. -swagger:model GetPSMDBComponentsOKBodyVersionsItems0MatrixPMMAnon -*/ -type GetPSMDBComponentsOKBodyVersionsItems0MatrixPMMAnon 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 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 *GetPSMDBComponentsOKBodyVersionsItems0MatrixPMMAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixPMMAnon) UnmarshalBinary(b []byte) error { - var res GetPSMDBComponentsOKBodyVersionsItems0MatrixPMMAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBComponentsOKBodyVersionsItems0MatrixPXCAnon Component contains information about component. -swagger:model GetPSMDBComponentsOKBodyVersionsItems0MatrixPXCAnon -*/ -type GetPSMDBComponentsOKBodyVersionsItems0MatrixPXCAnon 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 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 *GetPSMDBComponentsOKBodyVersionsItems0MatrixPXCAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixPXCAnon) UnmarshalBinary(b []byte) error { - var res GetPSMDBComponentsOKBodyVersionsItems0MatrixPXCAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBComponentsOKBodyVersionsItems0MatrixProxysqlAnon Component contains information about component. -swagger:model GetPSMDBComponentsOKBodyVersionsItems0MatrixProxysqlAnon -*/ -type GetPSMDBComponentsOKBodyVersionsItems0MatrixProxysqlAnon 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 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 *GetPSMDBComponentsOKBodyVersionsItems0MatrixProxysqlAnon) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBComponentsOKBodyVersionsItems0MatrixProxysqlAnon) UnmarshalBinary(b []byte) error { - var res GetPSMDBComponentsOKBodyVersionsItems0MatrixProxysqlAnon - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} 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 deleted file mode 100644 index ee70826a03..0000000000 --- a/api/managementpb/dbaas/json/client/components/get_pxc_components_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package components - -// 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" -) - -// 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 { - return &GetPXCComponentsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetPXCComponentsParamsWithTimeout creates a new GetPXCComponentsParams object -// with the ability to set a timeout on a request. -func NewGetPXCComponentsParamsWithTimeout(timeout time.Duration) *GetPXCComponentsParams { - return &GetPXCComponentsParams{ - timeout: timeout, - } -} - -// NewGetPXCComponentsParamsWithContext creates a new GetPXCComponentsParams object -// with the ability to set a context for a request. -func NewGetPXCComponentsParamsWithContext(ctx context.Context) *GetPXCComponentsParams { - return &GetPXCComponentsParams{ - Context: ctx, - } -} - -// NewGetPXCComponentsParamsWithHTTPClient creates a new GetPXCComponentsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetPXCComponentsParamsWithHTTPClient(client *http.Client) *GetPXCComponentsParams { - 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. -*/ -type GetPXCComponentsParams struct { - // Body. - Body GetPXCComponentsBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the get PXC components params -func (o *GetPXCComponentsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get PXC components params -func (o *GetPXCComponentsParams) WithContext(ctx context.Context) *GetPXCComponentsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get PXC components params -func (o *GetPXCComponentsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get PXC components params -func (o *GetPXCComponentsParams) WithHTTPClient(client *http.Client) *GetPXCComponentsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get PXC components params -func (o *GetPXCComponentsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get PXC components params -func (o *GetPXCComponentsParams) WithBody(body GetPXCComponentsBody) *GetPXCComponentsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get PXC components params -func (o *GetPXCComponentsParams) SetBody(body GetPXCComponentsBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetPXCComponentsParams) 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/managementpb/dbaas/json/client/components/get_pxc_components_responses.go b/api/managementpb/dbaas/json/client/components/get_pxc_components_responses.go deleted file mode 100644 index cd2e68f28c..0000000000 --- a/api/managementpb/dbaas/json/client/components/get_pxc_components_responses.go +++ /dev/null @@ -1,1345 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package components - -// 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" -) - -// GetPXCComponentsReader is a Reader for the GetPXCComponents structure. -type GetPXCComponentsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetPXCComponentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetPXCComponentsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetPXCComponentsDefault(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 - } -} - -// NewGetPXCComponentsOK creates a GetPXCComponentsOK with default headers values -func NewGetPXCComponentsOK() *GetPXCComponentsOK { - return &GetPXCComponentsOK{} -} - -/* -GetPXCComponentsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetPXCComponentsOK struct { - Payload *GetPXCComponentsOKBody -} - -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 -} - -func (o *GetPXCComponentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetPXCComponentsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetPXCComponentsDefault creates a GetPXCComponentsDefault with default headers values -func NewGetPXCComponentsDefault(code int) *GetPXCComponentsDefault { - return &GetPXCComponentsDefault{ - _statusCode: code, - } -} - -/* -GetPXCComponentsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetPXCComponentsDefault struct { - _statusCode int - - Payload *GetPXCComponentsDefaultBody -} - -// Code gets the status code for the get PXC components default response -func (o *GetPXCComponentsDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *GetPXCComponentsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetPXCComponentsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -GetPXCComponentsBody get PXC components body -swagger:model GetPXCComponentsBody -*/ -type GetPXCComponentsBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // Version of DB. - DBVersion string `json:"db_version,omitempty"` -} - -// Validate validates this get PXC components body -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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCComponentsBody) UnmarshalBinary(b []byte) error { - var res GetPXCComponentsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPXCComponentsDefaultBody get PXC components default body -swagger:model GetPXCComponentsDefaultBody -*/ -type GetPXCComponentsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetPXCComponentsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get PXC components default body -func (o *GetPXCComponentsDefaultBody) 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 *GetPXCComponentsDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPXCComponentsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCComponentsDefaultBody) UnmarshalBinary(b []byte) error { - var res GetPXCComponentsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPXCComponentsDefaultBodyDetailsItems0 get PXC components default body details items0 -swagger:model GetPXCComponentsDefaultBodyDetailsItems0 -*/ -type GetPXCComponentsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 []*GetPXCComponentsOKBodyVersionsItems0 `json:"versions"` -} - -// Validate validates this get PXC components OK body -func (o *GetPXCComponentsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateVersions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetPXCComponentsOKBody) validateVersions(formats strfmt.Registry) error { - if swag.IsZero(o.Versions) { // not required - return nil - } - - for i := 0; i < len(o.Versions); i++ { - if swag.IsZero(o.Versions[i]) { // not required - continue - } - - if o.Versions[i] != nil { - 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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPXCComponentsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCComponentsOKBody) UnmarshalBinary(b []byte) error { - var res GetPXCComponentsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *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 deleted file mode 100644 index 87b1582722..0000000000 --- a/api/managementpb/dbaas/json/client/components/install_operator_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package components - -// 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" -) - -// 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 { - return &InstallOperatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewInstallOperatorParamsWithTimeout creates a new InstallOperatorParams object -// with the ability to set a timeout on a request. -func NewInstallOperatorParamsWithTimeout(timeout time.Duration) *InstallOperatorParams { - return &InstallOperatorParams{ - timeout: timeout, - } -} - -// NewInstallOperatorParamsWithContext creates a new InstallOperatorParams object -// with the ability to set a context for a request. -func NewInstallOperatorParamsWithContext(ctx context.Context) *InstallOperatorParams { - return &InstallOperatorParams{ - Context: ctx, - } -} - -// NewInstallOperatorParamsWithHTTPClient creates a new InstallOperatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewInstallOperatorParamsWithHTTPClient(client *http.Client) *InstallOperatorParams { - 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. -*/ -type InstallOperatorParams struct { - // Body. - Body InstallOperatorBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the install operator params -func (o *InstallOperatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the install operator params -func (o *InstallOperatorParams) WithContext(ctx context.Context) *InstallOperatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the install operator params -func (o *InstallOperatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the install operator params -func (o *InstallOperatorParams) WithHTTPClient(client *http.Client) *InstallOperatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the install operator params -func (o *InstallOperatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the install operator params -func (o *InstallOperatorParams) WithBody(body InstallOperatorBody) *InstallOperatorParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the install operator params -func (o *InstallOperatorParams) SetBody(body InstallOperatorBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *InstallOperatorParams) 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/managementpb/dbaas/json/client/components/install_operator_responses.go b/api/managementpb/dbaas/json/client/components/install_operator_responses.go deleted file mode 100644 index b9bb44b457..0000000000 --- a/api/managementpb/dbaas/json/client/components/install_operator_responses.go +++ /dev/null @@ -1,405 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package components - -// 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" -) - -// InstallOperatorReader is a Reader for the InstallOperator structure. -type InstallOperatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *InstallOperatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewInstallOperatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewInstallOperatorDefault(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 - } -} - -// NewInstallOperatorOK creates a InstallOperatorOK with default headers values -func NewInstallOperatorOK() *InstallOperatorOK { - return &InstallOperatorOK{} -} - -/* -InstallOperatorOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type InstallOperatorOK struct { - Payload *InstallOperatorOKBody -} - -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 -} - -func (o *InstallOperatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(InstallOperatorOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewInstallOperatorDefault creates a InstallOperatorDefault with default headers values -func NewInstallOperatorDefault(code int) *InstallOperatorDefault { - return &InstallOperatorDefault{ - _statusCode: code, - } -} - -/* -InstallOperatorDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type InstallOperatorDefault struct { - _statusCode int - - Payload *InstallOperatorDefaultBody -} - -// Code gets the status code for the install operator default response -func (o *InstallOperatorDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *InstallOperatorDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(InstallOperatorDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -InstallOperatorBody install operator body -swagger:model InstallOperatorBody -*/ -type InstallOperatorBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // operator_type tells what operator we are interested in updating. - OperatorType string `json:"operator_type,omitempty"` - - // version tells what version of the operator we should update to. - Version string `json:"version,omitempty"` -} - -// Validate validates this install operator body -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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *InstallOperatorBody) UnmarshalBinary(b []byte) error { - var res InstallOperatorBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -InstallOperatorDefaultBody install operator default body -swagger:model InstallOperatorDefaultBody -*/ -type InstallOperatorDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*InstallOperatorDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this install operator default body -func (o *InstallOperatorDefaultBody) 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 *InstallOperatorDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *InstallOperatorDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *InstallOperatorDefaultBody) UnmarshalBinary(b []byte) error { - var res InstallOperatorDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -InstallOperatorDefaultBodyDetailsItems0 install operator default body details items0 -swagger:model InstallOperatorDefaultBodyDetailsItems0 -*/ -type InstallOperatorDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 -*/ -type InstallOperatorOKBody struct { - // OperatorsStatus defines status of operators installed in Kubernetes cluster. - // - // - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state. - // - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version. - // - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version. - // - 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"` -} - -// Validate validates this install operator OK body -func (o *InstallOperatorOKBody) 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 installOperatorOkBodyTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["OPERATORS_STATUS_INVALID","OPERATORS_STATUS_OK","OPERATORS_STATUS_UNSUPPORTED","OPERATORS_STATUS_NOT_INSTALLED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - installOperatorOkBodyTypeStatusPropEnum = append(installOperatorOkBodyTypeStatusPropEnum, v) - } -} - -const ( - - // InstallOperatorOKBodyStatusOPERATORSSTATUSINVALID captures enum value "OPERATORS_STATUS_INVALID" - InstallOperatorOKBodyStatusOPERATORSSTATUSINVALID string = "OPERATORS_STATUS_INVALID" - - // InstallOperatorOKBodyStatusOPERATORSSTATUSOK captures enum value "OPERATORS_STATUS_OK" - InstallOperatorOKBodyStatusOPERATORSSTATUSOK string = "OPERATORS_STATUS_OK" - - // InstallOperatorOKBodyStatusOPERATORSSTATUSUNSUPPORTED captures enum value "OPERATORS_STATUS_UNSUPPORTED" - InstallOperatorOKBodyStatusOPERATORSSTATUSUNSUPPORTED string = "OPERATORS_STATUS_UNSUPPORTED" - - // InstallOperatorOKBodyStatusOPERATORSSTATUSNOTINSTALLED captures enum value "OPERATORS_STATUS_NOT_INSTALLED" - InstallOperatorOKBodyStatusOPERATORSSTATUSNOTINSTALLED string = "OPERATORS_STATUS_NOT_INSTALLED" -) - -// prop value enum -func (o *InstallOperatorOKBody) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, installOperatorOkBodyTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *InstallOperatorOKBody) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("installOperatorOk"+"."+"status", "body", *o.Status); err != nil { - return err - } - - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *InstallOperatorOKBody) UnmarshalBinary(b []byte) error { - var res InstallOperatorOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return 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 deleted file mode 100644 index e00472a1d3..0000000000 --- a/api/managementpb/dbaas/json/client/db_clusters/db_clusters_client.go +++ /dev/null @@ -1,271 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package db_clusters - -// 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 db clusters API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for db clusters 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 { - DeleteDBCluster(params *DeleteDBClusterParams, opts ...ClientOption) (*DeleteDBClusterOK, error) - - GetDBCluster(params *GetDBClusterParams, opts ...ClientOption) (*GetDBClusterOK, error) - - ListDBClusters(params *ListDBClustersParams, opts ...ClientOption) (*ListDBClustersOK, error) - - ListS3Backups(params *ListS3BackupsParams, opts ...ClientOption) (*ListS3BackupsOK, error) - - ListSecrets(params *ListSecretsParams, opts ...ClientOption) (*ListSecretsOK, error) - - RestartDBCluster(params *RestartDBClusterParams, opts ...ClientOption) (*RestartDBClusterOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -DeleteDBCluster deletes DB cluster deletes DB cluster -*/ -func (a *Client) DeleteDBCluster(params *DeleteDBClusterParams, opts ...ClientOption) (*DeleteDBClusterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteDBClusterParams() - } - op := &runtime.ClientOperation{ - ID: "DeleteDBCluster", - Method: "POST", - PathPattern: "/v1/management/DBaaS/DBClusters/Delete", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*DeleteDBClusterOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*DeleteDBClusterDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetDBCluster gets DB cluster returns parameters used to create a database cluster -*/ -func (a *Client) GetDBCluster(params *GetDBClusterParams, opts ...ClientOption) (*GetDBClusterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetDBClusterParams() - } - op := &runtime.ClientOperation{ - ID: "GetDBCluster", - Method: "POST", - PathPattern: "/v1/management/DBaaS/DBClusters/Get", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetDBClusterReader{formats: a.formats}, - 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.(*GetDBClusterOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetDBClusterDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListDBClusters lists DB clusters returns a list of DB clusters -*/ -func (a *Client) ListDBClusters(params *ListDBClustersParams, opts ...ClientOption) (*ListDBClustersOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListDBClustersParams() - } - op := &runtime.ClientOperation{ - ID: "ListDBClusters", - Method: "POST", - PathPattern: "/v1/management/DBaaS/DBClusters/List", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*ListDBClustersOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*ListDBClustersDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListS3Backups lists s3 backups lists backups stored on s3 -*/ -func (a *Client) ListS3Backups(params *ListS3BackupsParams, opts ...ClientOption) (*ListS3BackupsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListS3BackupsParams() - } - op := &runtime.ClientOperation{ - ID: "ListS3Backups", - Method: "POST", - PathPattern: "/v1/management/DBaaS/Backups/List", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListS3BackupsReader{formats: a.formats}, - 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.(*ListS3BackupsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*ListS3BackupsDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListSecrets lists secrets returns a list of secrets from k8s -*/ -func (a *Client) ListSecrets(params *ListSecretsParams, opts ...ClientOption) (*ListSecretsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListSecretsParams() - } - op := &runtime.ClientOperation{ - ID: "ListSecrets", - Method: "POST", - PathPattern: "/v1/management/DBaaS/Secrets/List", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListSecretsReader{formats: a.formats}, - 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.(*ListSecretsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*ListSecretsDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -RestartDBCluster restarts DB cluster restarts DB cluster -*/ -func (a *Client) RestartDBCluster(params *RestartDBClusterParams, opts ...ClientOption) (*RestartDBClusterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewRestartDBClusterParams() - } - op := &runtime.ClientOperation{ - ID: "RestartDBCluster", - Method: "POST", - PathPattern: "/v1/management/DBaaS/DBClusters/Restart", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*RestartDBClusterOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*RestartDBClusterDefault) - 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/managementpb/dbaas/json/client/db_clusters/delete_db_cluster_parameters.go b/api/managementpb/dbaas/json/client/db_clusters/delete_db_cluster_parameters.go deleted file mode 100644 index 0f817bf42e..0000000000 --- a/api/managementpb/dbaas/json/client/db_clusters/delete_db_cluster_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package db_clusters - -// 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" -) - -// 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 { - return &DeleteDBClusterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteDBClusterParamsWithTimeout creates a new DeleteDBClusterParams object -// with the ability to set a timeout on a request. -func NewDeleteDBClusterParamsWithTimeout(timeout time.Duration) *DeleteDBClusterParams { - return &DeleteDBClusterParams{ - timeout: timeout, - } -} - -// NewDeleteDBClusterParamsWithContext creates a new DeleteDBClusterParams object -// with the ability to set a context for a request. -func NewDeleteDBClusterParamsWithContext(ctx context.Context) *DeleteDBClusterParams { - return &DeleteDBClusterParams{ - Context: ctx, - } -} - -// NewDeleteDBClusterParamsWithHTTPClient creates a new DeleteDBClusterParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteDBClusterParamsWithHTTPClient(client *http.Client) *DeleteDBClusterParams { - 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. -*/ -type DeleteDBClusterParams struct { - // Body. - Body DeleteDBClusterBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the delete DB cluster params -func (o *DeleteDBClusterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete DB cluster params -func (o *DeleteDBClusterParams) WithContext(ctx context.Context) *DeleteDBClusterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete DB cluster params -func (o *DeleteDBClusterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete DB cluster params -func (o *DeleteDBClusterParams) WithHTTPClient(client *http.Client) *DeleteDBClusterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete DB cluster params -func (o *DeleteDBClusterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the delete DB cluster params -func (o *DeleteDBClusterParams) WithBody(body DeleteDBClusterBody) *DeleteDBClusterParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the delete DB cluster params -func (o *DeleteDBClusterParams) SetBody(body DeleteDBClusterBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteDBClusterParams) 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/managementpb/dbaas/json/client/db_clusters/delete_db_cluster_responses.go b/api/managementpb/dbaas/json/client/db_clusters/delete_db_cluster_responses.go deleted file mode 100644 index dded2a9a91..0000000000 --- a/api/managementpb/dbaas/json/client/db_clusters/delete_db_cluster_responses.go +++ /dev/null @@ -1,362 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package db_clusters - -// 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" -) - -// DeleteDBClusterReader is a Reader for the DeleteDBCluster structure. -type DeleteDBClusterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteDBClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteDBClusterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewDeleteDBClusterDefault(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 - } -} - -// NewDeleteDBClusterOK creates a DeleteDBClusterOK with default headers values -func NewDeleteDBClusterOK() *DeleteDBClusterOK { - return &DeleteDBClusterOK{} -} - -/* -DeleteDBClusterOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type DeleteDBClusterOK struct { - Payload interface{} -} - -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 -} - -func (o *DeleteDBClusterOK) 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 -} - -// NewDeleteDBClusterDefault creates a DeleteDBClusterDefault with default headers values -func NewDeleteDBClusterDefault(code int) *DeleteDBClusterDefault { - return &DeleteDBClusterDefault{ - _statusCode: code, - } -} - -/* -DeleteDBClusterDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type DeleteDBClusterDefault struct { - _statusCode int - - Payload *DeleteDBClusterDefaultBody -} - -// Code gets the status code for the delete DB cluster default response -func (o *DeleteDBClusterDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *DeleteDBClusterDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(DeleteDBClusterDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -DeleteDBClusterBody delete DB cluster body -swagger:model DeleteDBClusterBody -*/ -type DeleteDBClusterBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // DB cluster name. - Name string `json:"name,omitempty"` - - // DBClusterType represents database cluster type. - // - // - DB_CLUSTER_TYPE_INVALID: DB_CLUSTER_TYPE_INVALID represents unknown cluster type. - // - DB_CLUSTER_TYPE_PXC: DB_CLUSTER_TYPE_PXC represents pxc cluster type. - // - DB_CLUSTER_TYPE_PSMDB: DB_CLUSTER_TYPE_PSMDB represents psmdb cluster type. - // Enum: [DB_CLUSTER_TYPE_INVALID DB_CLUSTER_TYPE_PXC DB_CLUSTER_TYPE_PSMDB] - ClusterType *string `json:"cluster_type,omitempty"` -} - -// Validate validates this delete DB cluster body -func (o *DeleteDBClusterBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateClusterType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var deleteDbClusterBodyTypeClusterTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DB_CLUSTER_TYPE_INVALID","DB_CLUSTER_TYPE_PXC","DB_CLUSTER_TYPE_PSMDB"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - deleteDbClusterBodyTypeClusterTypePropEnum = append(deleteDbClusterBodyTypeClusterTypePropEnum, v) - } -} - -const ( - - // DeleteDBClusterBodyClusterTypeDBCLUSTERTYPEINVALID captures enum value "DB_CLUSTER_TYPE_INVALID" - DeleteDBClusterBodyClusterTypeDBCLUSTERTYPEINVALID string = "DB_CLUSTER_TYPE_INVALID" - - // DeleteDBClusterBodyClusterTypeDBCLUSTERTYPEPXC captures enum value "DB_CLUSTER_TYPE_PXC" - DeleteDBClusterBodyClusterTypeDBCLUSTERTYPEPXC string = "DB_CLUSTER_TYPE_PXC" - - // DeleteDBClusterBodyClusterTypeDBCLUSTERTYPEPSMDB captures enum value "DB_CLUSTER_TYPE_PSMDB" - DeleteDBClusterBodyClusterTypeDBCLUSTERTYPEPSMDB string = "DB_CLUSTER_TYPE_PSMDB" -) - -// prop value enum -func (o *DeleteDBClusterBody) validateClusterTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, deleteDbClusterBodyTypeClusterTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *DeleteDBClusterBody) validateClusterType(formats strfmt.Registry) error { - if swag.IsZero(o.ClusterType) { // not required - return nil - } - - // value enum - if err := o.validateClusterTypeEnum("body"+"."+"cluster_type", "body", *o.ClusterType); err != nil { - return err - } - - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DeleteDBClusterBody) UnmarshalBinary(b []byte) error { - var res DeleteDBClusterBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DeleteDBClusterDefaultBody delete DB cluster default body -swagger:model DeleteDBClusterDefaultBody -*/ -type DeleteDBClusterDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*DeleteDBClusterDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this delete DB cluster default body -func (o *DeleteDBClusterDefaultBody) 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 *DeleteDBClusterDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *DeleteDBClusterDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DeleteDBClusterDefaultBody) UnmarshalBinary(b []byte) error { - var res DeleteDBClusterDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -DeleteDBClusterDefaultBodyDetailsItems0 delete DB cluster default body details items0 -swagger:model DeleteDBClusterDefaultBodyDetailsItems0 -*/ -type DeleteDBClusterDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// 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 *DeleteDBClusterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DeleteDBClusterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res DeleteDBClusterDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/dbaas/json/client/db_clusters/get_db_cluster_parameters.go b/api/managementpb/dbaas/json/client/db_clusters/get_db_cluster_parameters.go deleted file mode 100644 index dc4945c493..0000000000 --- a/api/managementpb/dbaas/json/client/db_clusters/get_db_cluster_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package db_clusters - -// 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" -) - -// NewGetDBClusterParams creates a new GetDBClusterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetDBClusterParams() *GetDBClusterParams { - return &GetDBClusterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetDBClusterParamsWithTimeout creates a new GetDBClusterParams object -// with the ability to set a timeout on a request. -func NewGetDBClusterParamsWithTimeout(timeout time.Duration) *GetDBClusterParams { - return &GetDBClusterParams{ - timeout: timeout, - } -} - -// NewGetDBClusterParamsWithContext creates a new GetDBClusterParams object -// with the ability to set a context for a request. -func NewGetDBClusterParamsWithContext(ctx context.Context) *GetDBClusterParams { - return &GetDBClusterParams{ - Context: ctx, - } -} - -// NewGetDBClusterParamsWithHTTPClient creates a new GetDBClusterParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetDBClusterParamsWithHTTPClient(client *http.Client) *GetDBClusterParams { - return &GetDBClusterParams{ - HTTPClient: client, - } -} - -/* -GetDBClusterParams contains all the parameters to send to the API endpoint - - for the get DB cluster operation. - - Typically these are written to a http.Request. -*/ -type GetDBClusterParams struct { - // Body. - Body GetDBClusterBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get DB cluster params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetDBClusterParams) WithDefaults() *GetDBClusterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get DB cluster params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetDBClusterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get DB cluster params -func (o *GetDBClusterParams) WithTimeout(timeout time.Duration) *GetDBClusterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get DB cluster params -func (o *GetDBClusterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get DB cluster params -func (o *GetDBClusterParams) WithContext(ctx context.Context) *GetDBClusterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get DB cluster params -func (o *GetDBClusterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get DB cluster params -func (o *GetDBClusterParams) WithHTTPClient(client *http.Client) *GetDBClusterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get DB cluster params -func (o *GetDBClusterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get DB cluster params -func (o *GetDBClusterParams) WithBody(body GetDBClusterBody) *GetDBClusterParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get DB cluster params -func (o *GetDBClusterParams) SetBody(body GetDBClusterBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetDBClusterParams) 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/managementpb/dbaas/json/client/db_clusters/get_db_cluster_responses.go b/api/managementpb/dbaas/json/client/db_clusters/get_db_cluster_responses.go deleted file mode 100644 index 866499f794..0000000000 --- a/api/managementpb/dbaas/json/client/db_clusters/get_db_cluster_responses.go +++ /dev/null @@ -1,2689 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package db_clusters - -// 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" -) - -// GetDBClusterReader is a Reader for the GetDBCluster structure. -type GetDBClusterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetDBClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetDBClusterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetDBClusterDefault(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 - } -} - -// NewGetDBClusterOK creates a GetDBClusterOK with default headers values -func NewGetDBClusterOK() *GetDBClusterOK { - return &GetDBClusterOK{} -} - -/* -GetDBClusterOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetDBClusterOK struct { - Payload *GetDBClusterOKBody -} - -func (o *GetDBClusterOK) Error() string { - return fmt.Sprintf("[POST /v1/management/DBaaS/DBClusters/Get][%d] getDbClusterOk %+v", 200, o.Payload) -} - -func (o *GetDBClusterOK) GetPayload() *GetDBClusterOKBody { - return o.Payload -} - -func (o *GetDBClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetDBClusterOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetDBClusterDefault creates a GetDBClusterDefault with default headers values -func NewGetDBClusterDefault(code int) *GetDBClusterDefault { - return &GetDBClusterDefault{ - _statusCode: code, - } -} - -/* -GetDBClusterDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetDBClusterDefault struct { - _statusCode int - - Payload *GetDBClusterDefaultBody -} - -// Code gets the status code for the get DB cluster default response -func (o *GetDBClusterDefault) Code() int { - return o._statusCode -} - -func (o *GetDBClusterDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/DBaaS/DBClusters/Get][%d] GetDBCluster default %+v", o._statusCode, o.Payload) -} - -func (o *GetDBClusterDefault) GetPayload() *GetDBClusterDefaultBody { - return o.Payload -} - -func (o *GetDBClusterDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetDBClusterDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -GetDBClusterBody get DB cluster body -swagger:model GetDBClusterBody -*/ -type GetDBClusterBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // DB cluster name. - Name string `json:"name,omitempty"` -} - -// Validate validates this get DB cluster body -func (o *GetDBClusterBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster body based on context it is used -func (o *GetDBClusterBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterBody) UnmarshalBinary(b []byte) error { - var res GetDBClusterBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterDefaultBody get DB cluster default body -swagger:model GetDBClusterDefaultBody -*/ -type GetDBClusterDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetDBClusterDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get DB cluster default body -func (o *GetDBClusterDefaultBody) 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 *GetDBClusterDefaultBody) 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("GetDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("GetDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this get DB cluster default body based on the context it is used -func (o *GetDBClusterDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetDBClusterDefaultBody) 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("GetDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("GetDBCluster default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterDefaultBody) UnmarshalBinary(b []byte) error { - var res GetDBClusterDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterDefaultBodyDetailsItems0 get DB cluster default body details items0 -swagger:model GetDBClusterDefaultBodyDetailsItems0 -*/ -type GetDBClusterDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// Validate validates this get DB cluster default body details items0 -func (o *GetDBClusterDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster default body details items0 based on context it is used -func (o *GetDBClusterDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res GetDBClusterDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBody get DB cluster OK body -swagger:model GetDBClusterOKBody -*/ -type GetDBClusterOKBody struct { - // psmdb cluster - PSMDBCluster *GetDBClusterOKBodyPSMDBCluster `json:"psmdb_cluster,omitempty"` - - // pxc cluster - PXCCluster *GetDBClusterOKBodyPXCCluster `json:"pxc_cluster,omitempty"` -} - -// Validate validates this get DB cluster OK body -func (o *GetDBClusterOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validatePSMDBCluster(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePXCCluster(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetDBClusterOKBody) validatePSMDBCluster(formats strfmt.Registry) error { - if swag.IsZero(o.PSMDBCluster) { // not required - return nil - } - - if o.PSMDBCluster != nil { - if err := o.PSMDBCluster.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "psmdb_cluster") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBody) validatePXCCluster(formats strfmt.Registry) error { - if swag.IsZero(o.PXCCluster) { // not required - return nil - } - - if o.PXCCluster != nil { - if err := o.PXCCluster.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster") - } - return err - } - } - - return nil -} - -// ContextValidate validate this get DB cluster OK body based on the context it is used -func (o *GetDBClusterOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidatePSMDBCluster(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidatePXCCluster(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetDBClusterOKBody) contextValidatePSMDBCluster(ctx context.Context, formats strfmt.Registry) error { - if o.PSMDBCluster != nil { - if err := o.PSMDBCluster.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "psmdb_cluster") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBody) contextValidatePXCCluster(ctx context.Context, formats strfmt.Registry) error { - if o.PXCCluster != nil { - if err := o.PXCCluster.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBody) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPSMDBCluster PSMDBCluster represents PSMDB cluster information. -swagger:model GetDBClusterOKBodyPSMDBCluster -*/ -type GetDBClusterOKBodyPSMDBCluster 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"` - - // Installed PSMDB image. - InstalledImage string `json:"installed_image,omitempty"` - - // Available database version user can upgrade cluster to, returned as an image. Image tag contains the version. - // If it's empty, no upgrade is available. - AvailableImage string `json:"available_image,omitempty"` - - // Is DB cluster accessible via public internet. - InternetFacing bool `json:"internet_facing,omitempty"` - - // Apply IP source ranges against the cluster. - SourceRanges []string `json:"source_ranges"` - - // backup - Backup *GetDBClusterOKBodyPSMDBClusterBackup `json:"backup,omitempty"` - - // operation - Operation *GetDBClusterOKBodyPSMDBClusterOperation `json:"operation,omitempty"` - - // params - Params *GetDBClusterOKBodyPSMDBClusterParams `json:"params,omitempty"` - - // restore - Restore *GetDBClusterOKBodyPSMDBClusterRestore `json:"restore,omitempty"` - - // template - Template *GetDBClusterOKBodyPSMDBClusterTemplate `json:"template,omitempty"` -} - -// Validate validates this get DB cluster OK body PSMDB cluster -func (o *GetDBClusterOKBodyPSMDBCluster) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateState(formats); err != nil { - res = append(res, err) - } - - if err := o.validateBackup(formats); err != nil { - res = append(res, err) - } - - if err := o.validateOperation(formats); err != nil { - res = append(res, err) - } - - if err := o.validateParams(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRestore(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTemplate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var getDbClusterOkBodyPsmdbClusterTypeStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["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"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - getDbClusterOkBodyPsmdbClusterTypeStatePropEnum = append(getDbClusterOkBodyPsmdbClusterTypeStatePropEnum, v) - } -} - -const ( - - // GetDBClusterOKBodyPSMDBClusterStateDBCLUSTERSTATEINVALID captures enum value "DB_CLUSTER_STATE_INVALID" - GetDBClusterOKBodyPSMDBClusterStateDBCLUSTERSTATEINVALID string = "DB_CLUSTER_STATE_INVALID" - - // GetDBClusterOKBodyPSMDBClusterStateDBCLUSTERSTATECHANGING captures enum value "DB_CLUSTER_STATE_CHANGING" - GetDBClusterOKBodyPSMDBClusterStateDBCLUSTERSTATECHANGING string = "DB_CLUSTER_STATE_CHANGING" - - // GetDBClusterOKBodyPSMDBClusterStateDBCLUSTERSTATEREADY captures enum value "DB_CLUSTER_STATE_READY" - GetDBClusterOKBodyPSMDBClusterStateDBCLUSTERSTATEREADY string = "DB_CLUSTER_STATE_READY" - - // GetDBClusterOKBodyPSMDBClusterStateDBCLUSTERSTATEFAILED captures enum value "DB_CLUSTER_STATE_FAILED" - GetDBClusterOKBodyPSMDBClusterStateDBCLUSTERSTATEFAILED string = "DB_CLUSTER_STATE_FAILED" - - // GetDBClusterOKBodyPSMDBClusterStateDBCLUSTERSTATEDELETING captures enum value "DB_CLUSTER_STATE_DELETING" - GetDBClusterOKBodyPSMDBClusterStateDBCLUSTERSTATEDELETING string = "DB_CLUSTER_STATE_DELETING" - - // GetDBClusterOKBodyPSMDBClusterStateDBCLUSTERSTATEPAUSED captures enum value "DB_CLUSTER_STATE_PAUSED" - GetDBClusterOKBodyPSMDBClusterStateDBCLUSTERSTATEPAUSED string = "DB_CLUSTER_STATE_PAUSED" - - // GetDBClusterOKBodyPSMDBClusterStateDBCLUSTERSTATEUPGRADING captures enum value "DB_CLUSTER_STATE_UPGRADING" - GetDBClusterOKBodyPSMDBClusterStateDBCLUSTERSTATEUPGRADING string = "DB_CLUSTER_STATE_UPGRADING" -) - -// prop value enum -func (o *GetDBClusterOKBodyPSMDBCluster) validateStateEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getDbClusterOkBodyPsmdbClusterTypeStatePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetDBClusterOKBodyPSMDBCluster) validateState(formats strfmt.Registry) error { - if swag.IsZero(o.State) { // not required - return nil - } - - // value enum - if err := o.validateStateEnum("getDbClusterOk"+"."+"psmdb_cluster"+"."+"state", "body", *o.State); err != nil { - return err - } - - return nil -} - -func (o *GetDBClusterOKBodyPSMDBCluster) validateBackup(formats strfmt.Registry) error { - if swag.IsZero(o.Backup) { // not required - return nil - } - - if o.Backup != nil { - if err := o.Backup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "backup") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPSMDBCluster) 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("getDbClusterOk" + "." + "psmdb_cluster" + "." + "operation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "operation") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPSMDBCluster) 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("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPSMDBCluster) validateRestore(formats strfmt.Registry) error { - if swag.IsZero(o.Restore) { // not required - return nil - } - - if o.Restore != nil { - if err := o.Restore.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "restore") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPSMDBCluster) validateTemplate(formats strfmt.Registry) error { - if swag.IsZero(o.Template) { // not required - return nil - } - - if o.Template != nil { - if err := o.Template.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "template") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "template") - } - return err - } - } - - return nil -} - -// ContextValidate validate this get DB cluster OK body PSMDB cluster based on the context it is used -func (o *GetDBClusterOKBodyPSMDBCluster) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateBackup(ctx, formats); err != nil { - res = append(res, err) - } - - 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 err := o.contextValidateRestore(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateTemplate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetDBClusterOKBodyPSMDBCluster) contextValidateBackup(ctx context.Context, formats strfmt.Registry) error { - if o.Backup != nil { - if err := o.Backup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "backup") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPSMDBCluster) contextValidateOperation(ctx context.Context, formats strfmt.Registry) error { - if o.Operation != nil { - if err := o.Operation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "operation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "operation") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPSMDBCluster) 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("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPSMDBCluster) contextValidateRestore(ctx context.Context, formats strfmt.Registry) error { - if o.Restore != nil { - if err := o.Restore.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "restore") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPSMDBCluster) contextValidateTemplate(ctx context.Context, formats strfmt.Registry) error { - if o.Template != nil { - if err := o.Template.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "template") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "template") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBCluster) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBCluster) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPSMDBCluster - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPSMDBClusterBackup Backup configuration for a database cluster -swagger:model GetDBClusterOKBodyPSMDBClusterBackup -*/ -type GetDBClusterOKBodyPSMDBClusterBackup struct { - // Backup Location id of stored backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Keep copies represents how many copies should retain. - KeepCopies int32 `json:"keep_copies,omitempty"` - - // Cron expression represents cron expression - CronExpression string `json:"cron_expression,omitempty"` - - // Service acccount used for backups - ServiceAccount string `json:"service_account,omitempty"` -} - -// Validate validates this get DB cluster OK body PSMDB cluster backup -func (o *GetDBClusterOKBodyPSMDBClusterBackup) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster OK body PSMDB cluster backup based on context it is used -func (o *GetDBClusterOKBodyPSMDBClusterBackup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterBackup) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterBackup) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPSMDBClusterBackup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPSMDBClusterOperation RunningOperation respresents a long-running operation. -swagger:model GetDBClusterOKBodyPSMDBClusterOperation -*/ -type GetDBClusterOKBodyPSMDBClusterOperation struct { - // Finished steps of the operaion; can decrease or increase compared to the previous value. - FinishedSteps int32 `json:"finished_steps,omitempty"` - - // Text describing the current operation progress step. - Message string `json:"message,omitempty"` - - // Total steps needed to finish the operation; can decrease or increase compared to the previous value. - TotalSteps int32 `json:"total_steps,omitempty"` -} - -// Validate validates this get DB cluster OK body PSMDB cluster operation -func (o *GetDBClusterOKBodyPSMDBClusterOperation) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster OK body PSMDB cluster operation based on context it is used -func (o *GetDBClusterOKBodyPSMDBClusterOperation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterOperation) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterOperation) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPSMDBClusterOperation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPSMDBClusterParams PSMDBClusterParams represents PSMDB cluster parameters that can be updated. -swagger:model GetDBClusterOKBodyPSMDBClusterParams -*/ -type GetDBClusterOKBodyPSMDBClusterParams struct { - // Cluster size. - ClusterSize int32 `json:"cluster_size,omitempty"` - - // Docker image used for PSMDB. - Image string `json:"image,omitempty"` - - // backup - Backup *GetDBClusterOKBodyPSMDBClusterParamsBackup `json:"backup,omitempty"` - - // replicaset - Replicaset *GetDBClusterOKBodyPSMDBClusterParamsReplicaset `json:"replicaset,omitempty"` - - // restore - Restore *GetDBClusterOKBodyPSMDBClusterParamsRestore `json:"restore,omitempty"` -} - -// Validate validates this get DB cluster OK body PSMDB cluster params -func (o *GetDBClusterOKBodyPSMDBClusterParams) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateBackup(formats); err != nil { - res = append(res, err) - } - - if err := o.validateReplicaset(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRestore(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetDBClusterOKBodyPSMDBClusterParams) validateBackup(formats strfmt.Registry) error { - if swag.IsZero(o.Backup) { // not required - return nil - } - - if o.Backup != nil { - if err := o.Backup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params" + "." + "backup") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPSMDBClusterParams) validateReplicaset(formats strfmt.Registry) error { - if swag.IsZero(o.Replicaset) { // not required - return nil - } - - if o.Replicaset != nil { - if err := o.Replicaset.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params" + "." + "replicaset") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params" + "." + "replicaset") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPSMDBClusterParams) validateRestore(formats strfmt.Registry) error { - if swag.IsZero(o.Restore) { // not required - return nil - } - - if o.Restore != nil { - if err := o.Restore.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params" + "." + "restore") - } - return err - } - } - - return nil -} - -// ContextValidate validate this get DB cluster OK body PSMDB cluster params based on the context it is used -func (o *GetDBClusterOKBodyPSMDBClusterParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateBackup(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateReplicaset(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRestore(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetDBClusterOKBodyPSMDBClusterParams) contextValidateBackup(ctx context.Context, formats strfmt.Registry) error { - if o.Backup != nil { - if err := o.Backup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params" + "." + "backup") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPSMDBClusterParams) 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("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params" + "." + "replicaset") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params" + "." + "replicaset") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPSMDBClusterParams) contextValidateRestore(ctx context.Context, formats strfmt.Registry) error { - if o.Restore != nil { - if err := o.Restore.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params" + "." + "restore") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterParams) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterParams) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPSMDBClusterParams - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPSMDBClusterParamsBackup Backup configuration for a database cluster -swagger:model GetDBClusterOKBodyPSMDBClusterParamsBackup -*/ -type GetDBClusterOKBodyPSMDBClusterParamsBackup struct { - // Backup Location id of stored backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Keep copies represents how many copies should retain. - KeepCopies int32 `json:"keep_copies,omitempty"` - - // Cron expression represents cron expression - CronExpression string `json:"cron_expression,omitempty"` - - // Service acccount used for backups - ServiceAccount string `json:"service_account,omitempty"` -} - -// Validate validates this get DB cluster OK body PSMDB cluster params backup -func (o *GetDBClusterOKBodyPSMDBClusterParamsBackup) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster OK body PSMDB cluster params backup based on context it is used -func (o *GetDBClusterOKBodyPSMDBClusterParamsBackup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterParamsBackup) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterParamsBackup) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPSMDBClusterParamsBackup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPSMDBClusterParamsReplicaset ReplicaSet container parameters. -// TODO Do not use inner messages in all public APIs (for consistency). -swagger:model GetDBClusterOKBodyPSMDBClusterParamsReplicaset -*/ -type GetDBClusterOKBodyPSMDBClusterParamsReplicaset struct { - // Disk size in bytes. - DiskSize string `json:"disk_size,omitempty"` - - // Configuration for PSMDB cluster - Configuration string `json:"configuration,omitempty"` - - // Storage Class for PSMDB cluster. - StorageClass string `json:"storage_class,omitempty"` - - // compute resources - ComputeResources *GetDBClusterOKBodyPSMDBClusterParamsReplicasetComputeResources `json:"compute_resources,omitempty"` -} - -// Validate validates this get DB cluster OK body PSMDB cluster params replicaset -func (o *GetDBClusterOKBodyPSMDBClusterParamsReplicaset) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateComputeResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetDBClusterOKBodyPSMDBClusterParamsReplicaset) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - if err := o.ComputeResources.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params" + "." + "replicaset" + "." + "compute_resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params" + "." + "replicaset" + "." + "compute_resources") - } - return err - } - } - - return nil -} - -// ContextValidate validate this get DB cluster OK body PSMDB cluster params replicaset based on the context it is used -func (o *GetDBClusterOKBodyPSMDBClusterParamsReplicaset) 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 *GetDBClusterOKBodyPSMDBClusterParamsReplicaset) 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("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params" + "." + "replicaset" + "." + "compute_resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "psmdb_cluster" + "." + "params" + "." + "replicaset" + "." + "compute_resources") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterParamsReplicaset) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterParamsReplicaset) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPSMDBClusterParamsReplicaset - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPSMDBClusterParamsReplicasetComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model GetDBClusterOKBodyPSMDBClusterParamsReplicasetComputeResources -*/ -type GetDBClusterOKBodyPSMDBClusterParamsReplicasetComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// Validate validates this get DB cluster OK body PSMDB cluster params replicaset compute resources -func (o *GetDBClusterOKBodyPSMDBClusterParamsReplicasetComputeResources) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster OK body PSMDB cluster params replicaset compute resources based on context it is used -func (o *GetDBClusterOKBodyPSMDBClusterParamsReplicasetComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterParamsReplicasetComputeResources) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterParamsReplicasetComputeResources) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPSMDBClusterParamsReplicasetComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPSMDBClusterParamsRestore Restore represents restoration payload to restore a database cluster from backup -swagger:model GetDBClusterOKBodyPSMDBClusterParamsRestore -*/ -type GetDBClusterOKBodyPSMDBClusterParamsRestore struct { - // Backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Destination filename. - Destination string `json:"destination,omitempty"` - - // K8s Secrets name. - SecretsName string `json:"secrets_name,omitempty"` -} - -// Validate validates this get DB cluster OK body PSMDB cluster params restore -func (o *GetDBClusterOKBodyPSMDBClusterParamsRestore) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster OK body PSMDB cluster params restore based on context it is used -func (o *GetDBClusterOKBodyPSMDBClusterParamsRestore) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterParamsRestore) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterParamsRestore) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPSMDBClusterParamsRestore - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPSMDBClusterRestore Restore represents restoration payload to restore a database cluster from backup -swagger:model GetDBClusterOKBodyPSMDBClusterRestore -*/ -type GetDBClusterOKBodyPSMDBClusterRestore struct { - // Backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Destination filename. - Destination string `json:"destination,omitempty"` - - // K8s Secrets name. - SecretsName string `json:"secrets_name,omitempty"` -} - -// Validate validates this get DB cluster OK body PSMDB cluster restore -func (o *GetDBClusterOKBodyPSMDBClusterRestore) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster OK body PSMDB cluster restore based on context it is used -func (o *GetDBClusterOKBodyPSMDBClusterRestore) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterRestore) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterRestore) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPSMDBClusterRestore - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPSMDBClusterTemplate get DB cluster OK body PSMDB cluster template -swagger:model GetDBClusterOKBodyPSMDBClusterTemplate -*/ -type GetDBClusterOKBodyPSMDBClusterTemplate struct { - // Template CR name. - Name string `json:"name,omitempty"` - - // Template CR kind. - Kind string `json:"kind,omitempty"` -} - -// Validate validates this get DB cluster OK body PSMDB cluster template -func (o *GetDBClusterOKBodyPSMDBClusterTemplate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster OK body PSMDB cluster template based on context it is used -func (o *GetDBClusterOKBodyPSMDBClusterTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterTemplate) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPSMDBClusterTemplate) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPSMDBClusterTemplate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPXCCluster PXCCluster represents PXC cluster information. -swagger:model GetDBClusterOKBodyPXCCluster -*/ -type GetDBClusterOKBodyPXCCluster 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"` - - // Installed XtraDB image. - InstalledImage string `json:"installed_image,omitempty"` - - // Available database version user can upgrade cluster to, returned as an image. Image tag contains the version. - // If it's empty, no upgrade is available. - AvailableImage string `json:"available_image,omitempty"` - - // Is DB cluster accessible via public internet. - InternetFacing bool `json:"internet_facing,omitempty"` - - // Apply IP source ranges against the cluster. - SourceRanges []string `json:"source_ranges"` - - // backup - Backup *GetDBClusterOKBodyPXCClusterBackup `json:"backup,omitempty"` - - // operation - Operation *GetDBClusterOKBodyPXCClusterOperation `json:"operation,omitempty"` - - // params - Params *GetDBClusterOKBodyPXCClusterParams `json:"params,omitempty"` - - // restore - Restore *GetDBClusterOKBodyPXCClusterRestore `json:"restore,omitempty"` - - // template - Template *GetDBClusterOKBodyPXCClusterTemplate `json:"template,omitempty"` -} - -// Validate validates this get DB cluster OK body PXC cluster -func (o *GetDBClusterOKBodyPXCCluster) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateState(formats); err != nil { - res = append(res, err) - } - - if err := o.validateBackup(formats); err != nil { - res = append(res, err) - } - - if err := o.validateOperation(formats); err != nil { - res = append(res, err) - } - - if err := o.validateParams(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRestore(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTemplate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var getDbClusterOkBodyPxcClusterTypeStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["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"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - getDbClusterOkBodyPxcClusterTypeStatePropEnum = append(getDbClusterOkBodyPxcClusterTypeStatePropEnum, v) - } -} - -const ( - - // GetDBClusterOKBodyPXCClusterStateDBCLUSTERSTATEINVALID captures enum value "DB_CLUSTER_STATE_INVALID" - GetDBClusterOKBodyPXCClusterStateDBCLUSTERSTATEINVALID string = "DB_CLUSTER_STATE_INVALID" - - // GetDBClusterOKBodyPXCClusterStateDBCLUSTERSTATECHANGING captures enum value "DB_CLUSTER_STATE_CHANGING" - GetDBClusterOKBodyPXCClusterStateDBCLUSTERSTATECHANGING string = "DB_CLUSTER_STATE_CHANGING" - - // GetDBClusterOKBodyPXCClusterStateDBCLUSTERSTATEREADY captures enum value "DB_CLUSTER_STATE_READY" - GetDBClusterOKBodyPXCClusterStateDBCLUSTERSTATEREADY string = "DB_CLUSTER_STATE_READY" - - // GetDBClusterOKBodyPXCClusterStateDBCLUSTERSTATEFAILED captures enum value "DB_CLUSTER_STATE_FAILED" - GetDBClusterOKBodyPXCClusterStateDBCLUSTERSTATEFAILED string = "DB_CLUSTER_STATE_FAILED" - - // GetDBClusterOKBodyPXCClusterStateDBCLUSTERSTATEDELETING captures enum value "DB_CLUSTER_STATE_DELETING" - GetDBClusterOKBodyPXCClusterStateDBCLUSTERSTATEDELETING string = "DB_CLUSTER_STATE_DELETING" - - // GetDBClusterOKBodyPXCClusterStateDBCLUSTERSTATEPAUSED captures enum value "DB_CLUSTER_STATE_PAUSED" - GetDBClusterOKBodyPXCClusterStateDBCLUSTERSTATEPAUSED string = "DB_CLUSTER_STATE_PAUSED" - - // GetDBClusterOKBodyPXCClusterStateDBCLUSTERSTATEUPGRADING captures enum value "DB_CLUSTER_STATE_UPGRADING" - GetDBClusterOKBodyPXCClusterStateDBCLUSTERSTATEUPGRADING string = "DB_CLUSTER_STATE_UPGRADING" -) - -// prop value enum -func (o *GetDBClusterOKBodyPXCCluster) validateStateEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, getDbClusterOkBodyPxcClusterTypeStatePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *GetDBClusterOKBodyPXCCluster) validateState(formats strfmt.Registry) error { - if swag.IsZero(o.State) { // not required - return nil - } - - // value enum - if err := o.validateStateEnum("getDbClusterOk"+"."+"pxc_cluster"+"."+"state", "body", *o.State); err != nil { - return err - } - - return nil -} - -func (o *GetDBClusterOKBodyPXCCluster) validateBackup(formats strfmt.Registry) error { - if swag.IsZero(o.Backup) { // not required - return nil - } - - if o.Backup != nil { - if err := o.Backup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "backup") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPXCCluster) 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("getDbClusterOk" + "." + "pxc_cluster" + "." + "operation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "operation") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPXCCluster) 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("getDbClusterOk" + "." + "pxc_cluster" + "." + "params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPXCCluster) validateRestore(formats strfmt.Registry) error { - if swag.IsZero(o.Restore) { // not required - return nil - } - - if o.Restore != nil { - if err := o.Restore.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "restore") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPXCCluster) validateTemplate(formats strfmt.Registry) error { - if swag.IsZero(o.Template) { // not required - return nil - } - - if o.Template != nil { - if err := o.Template.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "template") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "template") - } - return err - } - } - - return nil -} - -// ContextValidate validate this get DB cluster OK body PXC cluster based on the context it is used -func (o *GetDBClusterOKBodyPXCCluster) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateBackup(ctx, formats); err != nil { - res = append(res, err) - } - - 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 err := o.contextValidateRestore(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateTemplate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetDBClusterOKBodyPXCCluster) contextValidateBackup(ctx context.Context, formats strfmt.Registry) error { - if o.Backup != nil { - if err := o.Backup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "backup") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPXCCluster) contextValidateOperation(ctx context.Context, formats strfmt.Registry) error { - if o.Operation != nil { - if err := o.Operation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "operation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "operation") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPXCCluster) 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("getDbClusterOk" + "." + "pxc_cluster" + "." + "params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPXCCluster) contextValidateRestore(ctx context.Context, formats strfmt.Registry) error { - if o.Restore != nil { - if err := o.Restore.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "restore") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPXCCluster) contextValidateTemplate(ctx context.Context, formats strfmt.Registry) error { - if o.Template != nil { - if err := o.Template.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "template") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "template") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCCluster) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCCluster) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPXCCluster - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPXCClusterBackup Backup configuration for a database cluster -swagger:model GetDBClusterOKBodyPXCClusterBackup -*/ -type GetDBClusterOKBodyPXCClusterBackup struct { - // Backup Location id of stored backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Keep copies represents how many copies should retain. - KeepCopies int32 `json:"keep_copies,omitempty"` - - // Cron expression represents cron expression - CronExpression string `json:"cron_expression,omitempty"` - - // Service acccount used for backups - ServiceAccount string `json:"service_account,omitempty"` -} - -// Validate validates this get DB cluster OK body PXC cluster backup -func (o *GetDBClusterOKBodyPXCClusterBackup) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster OK body PXC cluster backup based on context it is used -func (o *GetDBClusterOKBodyPXCClusterBackup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterBackup) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterBackup) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPXCClusterBackup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPXCClusterOperation RunningOperation respresents a long-running operation. -swagger:model GetDBClusterOKBodyPXCClusterOperation -*/ -type GetDBClusterOKBodyPXCClusterOperation struct { - // Finished steps of the operaion; can decrease or increase compared to the previous value. - FinishedSteps int32 `json:"finished_steps,omitempty"` - - // Text describing the current operation progress step. - Message string `json:"message,omitempty"` - - // Total steps needed to finish the operation; can decrease or increase compared to the previous value. - TotalSteps int32 `json:"total_steps,omitempty"` -} - -// Validate validates this get DB cluster OK body PXC cluster operation -func (o *GetDBClusterOKBodyPXCClusterOperation) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster OK body PXC cluster operation based on context it is used -func (o *GetDBClusterOKBodyPXCClusterOperation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterOperation) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterOperation) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPXCClusterOperation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPXCClusterParams PXCClusterParams represents PXC cluster parameters that can be updated. -swagger:model GetDBClusterOKBodyPXCClusterParams -*/ -type GetDBClusterOKBodyPXCClusterParams struct { - // Cluster size. - ClusterSize int32 `json:"cluster_size,omitempty"` - - // backup - Backup *GetDBClusterOKBodyPXCClusterParamsBackup `json:"backup,omitempty"` - - // haproxy - Haproxy *GetDBClusterOKBodyPXCClusterParamsHaproxy `json:"haproxy,omitempty"` - - // proxysql - Proxysql *GetDBClusterOKBodyPXCClusterParamsProxysql `json:"proxysql,omitempty"` - - // pxc - PXC *GetDBClusterOKBodyPXCClusterParamsPXC `json:"pxc,omitempty"` - - // restore - Restore *GetDBClusterOKBodyPXCClusterParamsRestore `json:"restore,omitempty"` -} - -// Validate validates this get DB cluster OK body PXC cluster params -func (o *GetDBClusterOKBodyPXCClusterParams) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateBackup(formats); err != nil { - res = append(res, err) - } - - if err := o.validateHaproxy(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePXC(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRestore(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetDBClusterOKBodyPXCClusterParams) validateBackup(formats strfmt.Registry) error { - if swag.IsZero(o.Backup) { // not required - return nil - } - - if o.Backup != nil { - if err := o.Backup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "backup") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPXCClusterParams) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if o.Haproxy != nil { - if err := o.Haproxy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "haproxy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "haproxy") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPXCClusterParams) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if o.Proxysql != nil { - if err := o.Proxysql.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "proxysql") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "proxysql") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPXCClusterParams) validatePXC(formats strfmt.Registry) error { - if swag.IsZero(o.PXC) { // not required - return nil - } - - if o.PXC != nil { - if err := o.PXC.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "pxc") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "pxc") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPXCClusterParams) validateRestore(formats strfmt.Registry) error { - if swag.IsZero(o.Restore) { // not required - return nil - } - - if o.Restore != nil { - if err := o.Restore.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "restore") - } - return err - } - } - - return nil -} - -// ContextValidate validate this get DB cluster OK body PXC cluster params based on the context it is used -func (o *GetDBClusterOKBodyPXCClusterParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateBackup(ctx, formats); err != nil { - res = append(res, err) - } - - 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 err := o.contextValidateRestore(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetDBClusterOKBodyPXCClusterParams) contextValidateBackup(ctx context.Context, formats strfmt.Registry) error { - if o.Backup != nil { - if err := o.Backup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "backup") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPXCClusterParams) 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("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "haproxy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "haproxy") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPXCClusterParams) 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("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "proxysql") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "proxysql") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPXCClusterParams) 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("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "pxc") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "pxc") - } - return err - } - } - - return nil -} - -func (o *GetDBClusterOKBodyPXCClusterParams) contextValidateRestore(ctx context.Context, formats strfmt.Registry) error { - if o.Restore != nil { - if err := o.Restore.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "restore") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParams) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParams) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPXCClusterParams - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPXCClusterParamsBackup Backup configuration for a database cluster -swagger:model GetDBClusterOKBodyPXCClusterParamsBackup -*/ -type GetDBClusterOKBodyPXCClusterParamsBackup struct { - // Backup Location id of stored backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Keep copies represents how many copies should retain. - KeepCopies int32 `json:"keep_copies,omitempty"` - - // Cron expression represents cron expression - CronExpression string `json:"cron_expression,omitempty"` - - // Service acccount used for backups - ServiceAccount string `json:"service_account,omitempty"` -} - -// Validate validates this get DB cluster OK body PXC cluster params backup -func (o *GetDBClusterOKBodyPXCClusterParamsBackup) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster OK body PXC cluster params backup based on context it is used -func (o *GetDBClusterOKBodyPXCClusterParamsBackup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParamsBackup) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParamsBackup) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPXCClusterParamsBackup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPXCClusterParamsHaproxy HAProxy container parameters. -// NOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it. -swagger:model GetDBClusterOKBodyPXCClusterParamsHaproxy -*/ -type GetDBClusterOKBodyPXCClusterParamsHaproxy struct { - // Docker image used for HAProxy. - Image string `json:"image,omitempty"` - - // compute resources - ComputeResources *GetDBClusterOKBodyPXCClusterParamsHaproxyComputeResources `json:"compute_resources,omitempty"` -} - -// Validate validates this get DB cluster OK body PXC cluster params haproxy -func (o *GetDBClusterOKBodyPXCClusterParamsHaproxy) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateComputeResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetDBClusterOKBodyPXCClusterParamsHaproxy) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - if err := o.ComputeResources.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "haproxy" + "." + "compute_resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "haproxy" + "." + "compute_resources") - } - return err - } - } - - return nil -} - -// ContextValidate validate this get DB cluster OK body PXC cluster params haproxy based on the context it is used -func (o *GetDBClusterOKBodyPXCClusterParamsHaproxy) 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 *GetDBClusterOKBodyPXCClusterParamsHaproxy) 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("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "haproxy" + "." + "compute_resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "haproxy" + "." + "compute_resources") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParamsHaproxy) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParamsHaproxy) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPXCClusterParamsHaproxy - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPXCClusterParamsHaproxyComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model GetDBClusterOKBodyPXCClusterParamsHaproxyComputeResources -*/ -type GetDBClusterOKBodyPXCClusterParamsHaproxyComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// Validate validates this get DB cluster OK body PXC cluster params haproxy compute resources -func (o *GetDBClusterOKBodyPXCClusterParamsHaproxyComputeResources) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster OK body PXC cluster params haproxy compute resources based on context it is used -func (o *GetDBClusterOKBodyPXCClusterParamsHaproxyComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParamsHaproxyComputeResources) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParamsHaproxyComputeResources) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPXCClusterParamsHaproxyComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPXCClusterParamsPXC PXC container parameters. -// TODO Do not use inner messages in all public APIs (for consistency). -swagger:model GetDBClusterOKBodyPXCClusterParamsPXC -*/ -type GetDBClusterOKBodyPXCClusterParamsPXC struct { - // Docker image used for PXC. - Image string `json:"image,omitempty"` - - // Disk size in bytes. - DiskSize string `json:"disk_size,omitempty"` - - // Configuration for PXC cluster - Configuration string `json:"configuration,omitempty"` - - // Storage Class for PXC cluster. - StorageClass string `json:"storage_class,omitempty"` - - // compute resources - ComputeResources *GetDBClusterOKBodyPXCClusterParamsPXCComputeResources `json:"compute_resources,omitempty"` -} - -// Validate validates this get DB cluster OK body PXC cluster params PXC -func (o *GetDBClusterOKBodyPXCClusterParamsPXC) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateComputeResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetDBClusterOKBodyPXCClusterParamsPXC) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - if err := o.ComputeResources.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "pxc" + "." + "compute_resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "pxc" + "." + "compute_resources") - } - return err - } - } - - return nil -} - -// ContextValidate validate this get DB cluster OK body PXC cluster params PXC based on the context it is used -func (o *GetDBClusterOKBodyPXCClusterParamsPXC) 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 *GetDBClusterOKBodyPXCClusterParamsPXC) 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("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "pxc" + "." + "compute_resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "pxc" + "." + "compute_resources") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParamsPXC) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParamsPXC) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPXCClusterParamsPXC - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPXCClusterParamsPXCComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model GetDBClusterOKBodyPXCClusterParamsPXCComputeResources -*/ -type GetDBClusterOKBodyPXCClusterParamsPXCComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// Validate validates this get DB cluster OK body PXC cluster params PXC compute resources -func (o *GetDBClusterOKBodyPXCClusterParamsPXCComputeResources) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster OK body PXC cluster params PXC compute resources based on context it is used -func (o *GetDBClusterOKBodyPXCClusterParamsPXCComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParamsPXCComputeResources) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParamsPXCComputeResources) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPXCClusterParamsPXCComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPXCClusterParamsProxysql ProxySQL container parameters. -// TODO Do not use inner messages in all public APIs (for consistency). -swagger:model GetDBClusterOKBodyPXCClusterParamsProxysql -*/ -type GetDBClusterOKBodyPXCClusterParamsProxysql struct { - // Docker image used for ProxySQL. - Image string `json:"image,omitempty"` - - // Disk size in bytes. - DiskSize string `json:"disk_size,omitempty"` - - // compute resources - ComputeResources *GetDBClusterOKBodyPXCClusterParamsProxysqlComputeResources `json:"compute_resources,omitempty"` -} - -// Validate validates this get DB cluster OK body PXC cluster params proxysql -func (o *GetDBClusterOKBodyPXCClusterParamsProxysql) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateComputeResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetDBClusterOKBodyPXCClusterParamsProxysql) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - if err := o.ComputeResources.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "proxysql" + "." + "compute_resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "proxysql" + "." + "compute_resources") - } - return err - } - } - - return nil -} - -// ContextValidate validate this get DB cluster OK body PXC cluster params proxysql based on the context it is used -func (o *GetDBClusterOKBodyPXCClusterParamsProxysql) 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 *GetDBClusterOKBodyPXCClusterParamsProxysql) 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("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "proxysql" + "." + "compute_resources") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("getDbClusterOk" + "." + "pxc_cluster" + "." + "params" + "." + "proxysql" + "." + "compute_resources") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParamsProxysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParamsProxysql) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPXCClusterParamsProxysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPXCClusterParamsProxysqlComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model GetDBClusterOKBodyPXCClusterParamsProxysqlComputeResources -*/ -type GetDBClusterOKBodyPXCClusterParamsProxysqlComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// Validate validates this get DB cluster OK body PXC cluster params proxysql compute resources -func (o *GetDBClusterOKBodyPXCClusterParamsProxysqlComputeResources) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster OK body PXC cluster params proxysql compute resources based on context it is used -func (o *GetDBClusterOKBodyPXCClusterParamsProxysqlComputeResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParamsProxysqlComputeResources) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParamsProxysqlComputeResources) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPXCClusterParamsProxysqlComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPXCClusterParamsRestore Restore represents restoration payload to restore a database cluster from backup -swagger:model GetDBClusterOKBodyPXCClusterParamsRestore -*/ -type GetDBClusterOKBodyPXCClusterParamsRestore struct { - // Backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Destination filename. - Destination string `json:"destination,omitempty"` - - // K8s Secrets name. - SecretsName string `json:"secrets_name,omitempty"` -} - -// Validate validates this get DB cluster OK body PXC cluster params restore -func (o *GetDBClusterOKBodyPXCClusterParamsRestore) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster OK body PXC cluster params restore based on context it is used -func (o *GetDBClusterOKBodyPXCClusterParamsRestore) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParamsRestore) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterParamsRestore) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPXCClusterParamsRestore - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPXCClusterRestore Restore represents restoration payload to restore a database cluster from backup -swagger:model GetDBClusterOKBodyPXCClusterRestore -*/ -type GetDBClusterOKBodyPXCClusterRestore struct { - // Backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Destination filename. - Destination string `json:"destination,omitempty"` - - // K8s Secrets name. - SecretsName string `json:"secrets_name,omitempty"` -} - -// Validate validates this get DB cluster OK body PXC cluster restore -func (o *GetDBClusterOKBodyPXCClusterRestore) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster OK body PXC cluster restore based on context it is used -func (o *GetDBClusterOKBodyPXCClusterRestore) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterRestore) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterRestore) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPXCClusterRestore - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetDBClusterOKBodyPXCClusterTemplate get DB cluster OK body PXC cluster template -swagger:model GetDBClusterOKBodyPXCClusterTemplate -*/ -type GetDBClusterOKBodyPXCClusterTemplate struct { - // Template CR name. - Name string `json:"name,omitempty"` - - // Template CR kind. - Kind string `json:"kind,omitempty"` -} - -// Validate validates this get DB cluster OK body PXC cluster template -func (o *GetDBClusterOKBodyPXCClusterTemplate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get DB cluster OK body PXC cluster template based on context it is used -func (o *GetDBClusterOKBodyPXCClusterTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterTemplate) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetDBClusterOKBodyPXCClusterTemplate) UnmarshalBinary(b []byte) error { - var res GetDBClusterOKBodyPXCClusterTemplate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} 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 deleted file mode 100644 index ec41e02f95..0000000000 --- a/api/managementpb/dbaas/json/client/db_clusters/list_db_clusters_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package db_clusters - -// 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" -) - -// 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 { - return &ListDBClustersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListDBClustersParamsWithTimeout creates a new ListDBClustersParams object -// with the ability to set a timeout on a request. -func NewListDBClustersParamsWithTimeout(timeout time.Duration) *ListDBClustersParams { - return &ListDBClustersParams{ - timeout: timeout, - } -} - -// NewListDBClustersParamsWithContext creates a new ListDBClustersParams object -// with the ability to set a context for a request. -func NewListDBClustersParamsWithContext(ctx context.Context) *ListDBClustersParams { - return &ListDBClustersParams{ - Context: ctx, - } -} - -// NewListDBClustersParamsWithHTTPClient creates a new ListDBClustersParams object -// with the ability to set a custom HTTPClient for a request. -func NewListDBClustersParamsWithHTTPClient(client *http.Client) *ListDBClustersParams { - 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. -*/ -type ListDBClustersParams struct { - // Body. - Body ListDBClustersBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the list DB clusters params -func (o *ListDBClustersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list DB clusters params -func (o *ListDBClustersParams) WithContext(ctx context.Context) *ListDBClustersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list DB clusters params -func (o *ListDBClustersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list DB clusters params -func (o *ListDBClustersParams) WithHTTPClient(client *http.Client) *ListDBClustersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list DB clusters params -func (o *ListDBClustersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the list DB clusters params -func (o *ListDBClustersParams) WithBody(body ListDBClustersBody) *ListDBClustersParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the list DB clusters params -func (o *ListDBClustersParams) SetBody(body ListDBClustersBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ListDBClustersParams) 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/managementpb/dbaas/json/client/db_clusters/list_db_clusters_responses.go b/api/managementpb/dbaas/json/client/db_clusters/list_db_clusters_responses.go deleted file mode 100644 index 9ae9b9a2bf..0000000000 --- a/api/managementpb/dbaas/json/client/db_clusters/list_db_clusters_responses.go +++ /dev/null @@ -1,2704 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package db_clusters - -// 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" -) - -// ListDBClustersReader is a Reader for the ListDBClusters structure. -type ListDBClustersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListDBClustersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListDBClustersOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListDBClustersDefault(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 - } -} - -// NewListDBClustersOK creates a ListDBClustersOK with default headers values -func NewListDBClustersOK() *ListDBClustersOK { - return &ListDBClustersOK{} -} - -/* -ListDBClustersOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListDBClustersOK struct { - Payload *ListDBClustersOKBody -} - -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 -} - -func (o *ListDBClustersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListDBClustersOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListDBClustersDefault creates a ListDBClustersDefault with default headers values -func NewListDBClustersDefault(code int) *ListDBClustersDefault { - return &ListDBClustersDefault{ - _statusCode: code, - } -} - -/* -ListDBClustersDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListDBClustersDefault struct { - _statusCode int - - Payload *ListDBClustersDefaultBody -} - -// Code gets the status code for the list DB clusters default response -func (o *ListDBClustersDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *ListDBClustersDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListDBClustersDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ListDBClustersBody list DB clusters body -swagger:model ListDBClustersBody -*/ -type ListDBClustersBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` -} - -// Validate validates this list DB clusters body -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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersBody) UnmarshalBinary(b []byte) error { - var res ListDBClustersBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersDefaultBody list DB clusters default body -swagger:model ListDBClustersDefaultBody -*/ -type ListDBClustersDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListDBClustersDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list DB clusters default body -func (o *ListDBClustersDefaultBody) 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 *ListDBClustersDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersDefaultBody) UnmarshalBinary(b []byte) error { - var res ListDBClustersDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersDefaultBodyDetailsItems0 list DB clusters default body details items0 -swagger:model ListDBClustersDefaultBodyDetailsItems0 -*/ -type ListDBClustersDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 []*ListDBClustersOKBodyPXCClustersItems0 `json:"pxc_clusters"` - - // PSMDB clusters information. - PSMDBClusters []*ListDBClustersOKBodyPSMDBClustersItems0 `json:"psmdb_clusters"` -} - -// Validate validates this list DB clusters OK body -func (o *ListDBClustersOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validatePXCClusters(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePSMDBClusters(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListDBClustersOKBody) validatePXCClusters(formats strfmt.Registry) error { - if swag.IsZero(o.PXCClusters) { // not required - return nil - } - - for i := 0; i < len(o.PXCClusters); i++ { - if swag.IsZero(o.PXCClusters[i]) { // not required - continue - } - - if o.PXCClusters[i] != nil { - 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 - } - } - - } - - return nil -} - -func (o *ListDBClustersOKBody) validatePSMDBClusters(formats strfmt.Registry) error { - if swag.IsZero(o.PSMDBClusters) { // not required - return nil - } - - for i := 0; i < len(o.PSMDBClusters); i++ { - if swag.IsZero(o.PSMDBClusters[i]) { // not required - continue - } - - if o.PSMDBClusters[i] != nil { - 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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBody) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPSMDBClustersItems0 PSMDBCluster represents PSMDB cluster information. -swagger:model ListDBClustersOKBodyPSMDBClustersItems0 -*/ -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"` - - // Installed PSMDB image. - InstalledImage string `json:"installed_image,omitempty"` - - // Available database version user can upgrade cluster to, returned as an image. Image tag contains the version. - // If it's empty, no upgrade is available. - AvailableImage string `json:"available_image,omitempty"` - - // Is DB cluster accessible via public internet. - InternetFacing bool `json:"internet_facing,omitempty"` - - // Apply IP source ranges against the cluster. - SourceRanges []string `json:"source_ranges"` - - // backup - Backup *ListDBClustersOKBodyPSMDBClustersItems0Backup `json:"backup,omitempty"` - - // operation - Operation *ListDBClustersOKBodyPSMDBClustersItems0Operation `json:"operation,omitempty"` - - // params - Params *ListDBClustersOKBodyPSMDBClustersItems0Params `json:"params,omitempty"` - - // restore - Restore *ListDBClustersOKBodyPSMDBClustersItems0Restore `json:"restore,omitempty"` - - // template - Template *ListDBClustersOKBodyPSMDBClustersItems0Template `json:"template,omitempty"` -} - -// 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 { - res = append(res, err) - } - - if err := o.validateBackup(formats); err != nil { - res = append(res, err) - } - - if err := o.validateOperation(formats); err != nil { - res = append(res, err) - } - - if err := o.validateParams(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRestore(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTemplate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listDbClustersOkBodyPsmdbClustersItems0TypeStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["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"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listDbClustersOkBodyPsmdbClustersItems0TypeStatePropEnum = append(listDbClustersOkBodyPsmdbClustersItems0TypeStatePropEnum, v) - } -} - -const ( - - // ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEINVALID captures enum value "DB_CLUSTER_STATE_INVALID" - ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEINVALID string = "DB_CLUSTER_STATE_INVALID" - - // ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATECHANGING captures enum value "DB_CLUSTER_STATE_CHANGING" - ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATECHANGING string = "DB_CLUSTER_STATE_CHANGING" - - // ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEREADY captures enum value "DB_CLUSTER_STATE_READY" - ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEREADY string = "DB_CLUSTER_STATE_READY" - - // ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEFAILED captures enum value "DB_CLUSTER_STATE_FAILED" - ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEFAILED string = "DB_CLUSTER_STATE_FAILED" - - // ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEDELETING captures enum value "DB_CLUSTER_STATE_DELETING" - ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEDELETING string = "DB_CLUSTER_STATE_DELETING" - - // ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEPAUSED captures enum value "DB_CLUSTER_STATE_PAUSED" - ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEPAUSED string = "DB_CLUSTER_STATE_PAUSED" - - // ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEUPGRADING captures enum value "DB_CLUSTER_STATE_UPGRADING" - ListDBClustersOKBodyPSMDBClustersItems0StateDBCLUSTERSTATEUPGRADING string = "DB_CLUSTER_STATE_UPGRADING" -) - -// prop value enum -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 *ListDBClustersOKBodyPSMDBClustersItems0) validateState(formats strfmt.Registry) error { - if swag.IsZero(o.State) { // not required - return nil - } - - // value enum - if err := o.validateStateEnum("state", "body", *o.State); err != nil { - return err - } - - return nil -} - -func (o *ListDBClustersOKBodyPSMDBClustersItems0) validateBackup(formats strfmt.Registry) error { - if swag.IsZero(o.Backup) { // not required - return nil - } - - if o.Backup != nil { - if err := o.Backup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup") - } - return err - } - } - - return nil -} - -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 -} - -func (o *ListDBClustersOKBodyPSMDBClustersItems0) validateRestore(formats strfmt.Registry) error { - if swag.IsZero(o.Restore) { // not required - return nil - } - - if o.Restore != nil { - if err := o.Restore.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("restore") - } - return err - } - } - - return nil -} - -func (o *ListDBClustersOKBodyPSMDBClustersItems0) validateTemplate(formats strfmt.Registry) error { - if swag.IsZero(o.Template) { // not required - return nil - } - - if o.Template != nil { - if err := o.Template.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("template") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("template") - } - return err - } - } - - return nil -} - -// 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 err := o.contextValidateBackup(ctx, formats); err != nil { - res = append(res, err) - } - - 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 err := o.contextValidateRestore(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateTemplate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListDBClustersOKBodyPSMDBClustersItems0) contextValidateBackup(ctx context.Context, formats strfmt.Registry) error { - if o.Backup != nil { - if err := o.Backup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup") - } - return err - } - } - - return nil -} - -func (o *ListDBClustersOKBodyPSMDBClustersItems0) contextValidateOperation(ctx context.Context, formats strfmt.Registry) error { - if o.Operation != 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 - } - } - - return nil -} - -func (o *ListDBClustersOKBodyPSMDBClustersItems0) 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("params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("params") - } - return err - } - } - - return nil -} - -func (o *ListDBClustersOKBodyPSMDBClustersItems0) contextValidateRestore(ctx context.Context, formats strfmt.Registry) error { - if o.Restore != nil { - if err := o.Restore.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("restore") - } - return err - } - } - - return nil -} - -func (o *ListDBClustersOKBodyPSMDBClustersItems0) contextValidateTemplate(ctx context.Context, formats strfmt.Registry) error { - if o.Template != nil { - if err := o.Template.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("template") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("template") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPSMDBClustersItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPSMDBClustersItems0Backup Backup configuration for a database cluster -swagger:model ListDBClustersOKBodyPSMDBClustersItems0Backup -*/ -type ListDBClustersOKBodyPSMDBClustersItems0Backup struct { - // Backup Location id of stored backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Keep copies represents how many copies should retain. - KeepCopies int32 `json:"keep_copies,omitempty"` - - // Cron expression represents cron expression - CronExpression string `json:"cron_expression,omitempty"` - - // Service acccount used for backups - ServiceAccount string `json:"service_account,omitempty"` -} - -// Validate validates this list DB clusters OK body PSMDB clusters items0 backup -func (o *ListDBClustersOKBodyPSMDBClustersItems0Backup) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list DB clusters OK body PSMDB clusters items0 backup based on context it is used -func (o *ListDBClustersOKBodyPSMDBClustersItems0Backup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0Backup) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0Backup) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPSMDBClustersItems0Backup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPSMDBClustersItems0Operation RunningOperation respresents a long-running operation. -swagger:model ListDBClustersOKBodyPSMDBClustersItems0Operation -*/ -type ListDBClustersOKBodyPSMDBClustersItems0Operation struct { - // Finished steps of the operaion; can decrease or increase compared to the previous value. - FinishedSteps int32 `json:"finished_steps,omitempty"` - - // Text describing the current operation progress step. - Message string `json:"message,omitempty"` - - // Total steps needed to finish the operation; can decrease or increase compared to the previous value. - TotalSteps int32 `json:"total_steps,omitempty"` -} - -// 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 *ListDBClustersOKBodyPSMDBClustersItems0Operation) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0Operation) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPSMDBClustersItems0Operation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPSMDBClustersItems0Params PSMDBClusterParams represents PSMDB cluster parameters that can be updated. -swagger:model ListDBClustersOKBodyPSMDBClustersItems0Params -*/ -type ListDBClustersOKBodyPSMDBClustersItems0Params struct { - // Cluster size. - ClusterSize int32 `json:"cluster_size,omitempty"` - - // Docker image used for PSMDB. - Image string `json:"image,omitempty"` - - // backup - Backup *ListDBClustersOKBodyPSMDBClustersItems0ParamsBackup `json:"backup,omitempty"` - - // replicaset - Replicaset *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset `json:"replicaset,omitempty"` - - // restore - Restore *ListDBClustersOKBodyPSMDBClustersItems0ParamsRestore `json:"restore,omitempty"` -} - -// 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.validateBackup(formats); err != nil { - res = append(res, err) - } - - if err := o.validateReplicaset(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRestore(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListDBClustersOKBodyPSMDBClustersItems0Params) validateBackup(formats strfmt.Registry) error { - if swag.IsZero(o.Backup) { // not required - return nil - } - - if o.Backup != nil { - if err := o.Backup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("params" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("params" + "." + "backup") - } - return err - } - } - - return nil -} - -func (o *ListDBClustersOKBodyPSMDBClustersItems0Params) validateReplicaset(formats strfmt.Registry) error { - if swag.IsZero(o.Replicaset) { // not required - return nil - } - - if o.Replicaset != nil { - 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 -} - -func (o *ListDBClustersOKBodyPSMDBClustersItems0Params) validateRestore(formats strfmt.Registry) error { - if swag.IsZero(o.Restore) { // not required - return nil - } - - if o.Restore != nil { - if err := o.Restore.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("params" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("params" + "." + "restore") - } - 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.contextValidateBackup(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateReplicaset(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRestore(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListDBClustersOKBodyPSMDBClustersItems0Params) contextValidateBackup(ctx context.Context, formats strfmt.Registry) error { - if o.Backup != nil { - if err := o.Backup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("params" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("params" + "." + "backup") - } - return err - } - } - - 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 - } - } - - return nil -} - -func (o *ListDBClustersOKBodyPSMDBClustersItems0Params) contextValidateRestore(ctx context.Context, formats strfmt.Registry) error { - if o.Restore != nil { - if err := o.Restore.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("params" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("params" + "." + "restore") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0Params) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0Params) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPSMDBClustersItems0Params - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPSMDBClustersItems0ParamsBackup Backup configuration for a database cluster -swagger:model ListDBClustersOKBodyPSMDBClustersItems0ParamsBackup -*/ -type ListDBClustersOKBodyPSMDBClustersItems0ParamsBackup struct { - // Backup Location id of stored backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Keep copies represents how many copies should retain. - KeepCopies int32 `json:"keep_copies,omitempty"` - - // Cron expression represents cron expression - CronExpression string `json:"cron_expression,omitempty"` - - // Service acccount used for backups - ServiceAccount string `json:"service_account,omitempty"` -} - -// Validate validates this list DB clusters OK body PSMDB clusters items0 params backup -func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsBackup) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list DB clusters OK body PSMDB clusters items0 params backup based on context it is used -func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsBackup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsBackup) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsBackup) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPSMDBClustersItems0ParamsBackup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset ReplicaSet container parameters. -// TODO Do not use inner messages in all public APIs (for consistency). -swagger:model ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset -*/ -type ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset struct { - // Disk size in bytes. - DiskSize string `json:"disk_size,omitempty"` - - // Configuration for PSMDB cluster - Configuration string `json:"configuration,omitempty"` - - // Storage Class for PSMDB cluster. - StorageClass string `json:"storage_class,omitempty"` - - // compute resources - ComputeResources *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicasetComputeResources `json:"compute_resources,omitempty"` -} - -// 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 { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicaset - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicasetComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicasetComputeResources -*/ -type ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicasetComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// 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 *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicasetComputeResources) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicasetComputeResources) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPSMDBClustersItems0ParamsReplicasetComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPSMDBClustersItems0ParamsRestore Restore represents restoration payload to restore a database cluster from backup -swagger:model ListDBClustersOKBodyPSMDBClustersItems0ParamsRestore -*/ -type ListDBClustersOKBodyPSMDBClustersItems0ParamsRestore struct { - // Backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Destination filename. - Destination string `json:"destination,omitempty"` - - // K8s Secrets name. - SecretsName string `json:"secrets_name,omitempty"` -} - -// Validate validates this list DB clusters OK body PSMDB clusters items0 params restore -func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsRestore) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list DB clusters OK body PSMDB clusters items0 params restore based on context it is used -func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsRestore) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsRestore) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0ParamsRestore) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPSMDBClustersItems0ParamsRestore - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPSMDBClustersItems0Restore Restore represents restoration payload to restore a database cluster from backup -swagger:model ListDBClustersOKBodyPSMDBClustersItems0Restore -*/ -type ListDBClustersOKBodyPSMDBClustersItems0Restore struct { - // Backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Destination filename. - Destination string `json:"destination,omitempty"` - - // K8s Secrets name. - SecretsName string `json:"secrets_name,omitempty"` -} - -// Validate validates this list DB clusters OK body PSMDB clusters items0 restore -func (o *ListDBClustersOKBodyPSMDBClustersItems0Restore) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list DB clusters OK body PSMDB clusters items0 restore based on context it is used -func (o *ListDBClustersOKBodyPSMDBClustersItems0Restore) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0Restore) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0Restore) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPSMDBClustersItems0Restore - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPSMDBClustersItems0Template list DB clusters OK body PSMDB clusters items0 template -swagger:model ListDBClustersOKBodyPSMDBClustersItems0Template -*/ -type ListDBClustersOKBodyPSMDBClustersItems0Template struct { - // Template CR name. - Name string `json:"name,omitempty"` - - // Template CR kind. - Kind string `json:"kind,omitempty"` -} - -// Validate validates this list DB clusters OK body PSMDB clusters items0 template -func (o *ListDBClustersOKBodyPSMDBClustersItems0Template) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list DB clusters OK body PSMDB clusters items0 template based on context it is used -func (o *ListDBClustersOKBodyPSMDBClustersItems0Template) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0Template) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPSMDBClustersItems0Template) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPSMDBClustersItems0Template - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPXCClustersItems0 PXCCluster represents PXC cluster information. -swagger:model ListDBClustersOKBodyPXCClustersItems0 -*/ -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"` - - // Installed XtraDB image. - InstalledImage string `json:"installed_image,omitempty"` - - // Available database version user can upgrade cluster to, returned as an image. Image tag contains the version. - // If it's empty, no upgrade is available. - AvailableImage string `json:"available_image,omitempty"` - - // Is DB cluster accessible via public internet. - InternetFacing bool `json:"internet_facing,omitempty"` - - // Apply IP source ranges against the cluster. - SourceRanges []string `json:"source_ranges"` - - // backup - Backup *ListDBClustersOKBodyPXCClustersItems0Backup `json:"backup,omitempty"` - - // operation - Operation *ListDBClustersOKBodyPXCClustersItems0Operation `json:"operation,omitempty"` - - // params - Params *ListDBClustersOKBodyPXCClustersItems0Params `json:"params,omitempty"` - - // restore - Restore *ListDBClustersOKBodyPXCClustersItems0Restore `json:"restore,omitempty"` - - // template - Template *ListDBClustersOKBodyPXCClustersItems0Template `json:"template,omitempty"` -} - -// 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 { - res = append(res, err) - } - - if err := o.validateBackup(formats); err != nil { - res = append(res, err) - } - - if err := o.validateOperation(formats); err != nil { - res = append(res, err) - } - - if err := o.validateParams(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRestore(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTemplate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listDbClustersOkBodyPxcClustersItems0TypeStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["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"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listDbClustersOkBodyPxcClustersItems0TypeStatePropEnum = append(listDbClustersOkBodyPxcClustersItems0TypeStatePropEnum, v) - } -} - -const ( - - // ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEINVALID captures enum value "DB_CLUSTER_STATE_INVALID" - ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEINVALID string = "DB_CLUSTER_STATE_INVALID" - - // ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATECHANGING captures enum value "DB_CLUSTER_STATE_CHANGING" - ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATECHANGING string = "DB_CLUSTER_STATE_CHANGING" - - // ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEREADY captures enum value "DB_CLUSTER_STATE_READY" - ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEREADY string = "DB_CLUSTER_STATE_READY" - - // ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEFAILED captures enum value "DB_CLUSTER_STATE_FAILED" - ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEFAILED string = "DB_CLUSTER_STATE_FAILED" - - // ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEDELETING captures enum value "DB_CLUSTER_STATE_DELETING" - ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEDELETING string = "DB_CLUSTER_STATE_DELETING" - - // ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEPAUSED captures enum value "DB_CLUSTER_STATE_PAUSED" - ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEPAUSED string = "DB_CLUSTER_STATE_PAUSED" - - // ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEUPGRADING captures enum value "DB_CLUSTER_STATE_UPGRADING" - ListDBClustersOKBodyPXCClustersItems0StateDBCLUSTERSTATEUPGRADING string = "DB_CLUSTER_STATE_UPGRADING" -) - -// prop value enum -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 *ListDBClustersOKBodyPXCClustersItems0) validateState(formats strfmt.Registry) error { - if swag.IsZero(o.State) { // not required - return nil - } - - // value enum - if err := o.validateStateEnum("state", "body", *o.State); err != nil { - return err - } - - return nil -} - -func (o *ListDBClustersOKBodyPXCClustersItems0) validateBackup(formats strfmt.Registry) error { - if swag.IsZero(o.Backup) { // not required - return nil - } - - if o.Backup != nil { - if err := o.Backup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup") - } - return err - } - } - - return nil -} - -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 -} - -func (o *ListDBClustersOKBodyPXCClustersItems0) validateRestore(formats strfmt.Registry) error { - if swag.IsZero(o.Restore) { // not required - return nil - } - - if o.Restore != nil { - if err := o.Restore.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("restore") - } - return err - } - } - - return nil -} - -func (o *ListDBClustersOKBodyPXCClustersItems0) validateTemplate(formats strfmt.Registry) error { - if swag.IsZero(o.Template) { // not required - return nil - } - - if o.Template != nil { - if err := o.Template.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("template") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("template") - } - return err - } - } - - return nil -} - -// 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 err := o.contextValidateBackup(ctx, formats); err != nil { - res = append(res, err) - } - - 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 err := o.contextValidateRestore(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateTemplate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListDBClustersOKBodyPXCClustersItems0) contextValidateBackup(ctx context.Context, formats strfmt.Registry) error { - if o.Backup != nil { - if err := o.Backup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup") - } - return err - } - } - - return nil -} - -func (o *ListDBClustersOKBodyPXCClustersItems0) contextValidateOperation(ctx context.Context, formats strfmt.Registry) error { - if o.Operation != 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 - } - } - - return nil -} - -func (o *ListDBClustersOKBodyPXCClustersItems0) 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("params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("params") - } - return err - } - } - - return nil -} - -func (o *ListDBClustersOKBodyPXCClustersItems0) contextValidateRestore(ctx context.Context, formats strfmt.Registry) error { - if o.Restore != nil { - if err := o.Restore.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("restore") - } - return err - } - } - - return nil -} - -func (o *ListDBClustersOKBodyPXCClustersItems0) contextValidateTemplate(ctx context.Context, formats strfmt.Registry) error { - if o.Template != nil { - if err := o.Template.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("template") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("template") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPXCClustersItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPXCClustersItems0Backup Backup configuration for a database cluster -swagger:model ListDBClustersOKBodyPXCClustersItems0Backup -*/ -type ListDBClustersOKBodyPXCClustersItems0Backup struct { - // Backup Location id of stored backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Keep copies represents how many copies should retain. - KeepCopies int32 `json:"keep_copies,omitempty"` - - // Cron expression represents cron expression - CronExpression string `json:"cron_expression,omitempty"` - - // Service acccount used for backups - ServiceAccount string `json:"service_account,omitempty"` -} - -// Validate validates this list DB clusters OK body PXC clusters items0 backup -func (o *ListDBClustersOKBodyPXCClustersItems0Backup) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list DB clusters OK body PXC clusters items0 backup based on context it is used -func (o *ListDBClustersOKBodyPXCClustersItems0Backup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0Backup) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0Backup) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPXCClustersItems0Backup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPXCClustersItems0Operation RunningOperation respresents a long-running operation. -swagger:model ListDBClustersOKBodyPXCClustersItems0Operation -*/ -type ListDBClustersOKBodyPXCClustersItems0Operation struct { - // Finished steps of the operaion; can decrease or increase compared to the previous value. - FinishedSteps int32 `json:"finished_steps,omitempty"` - - // Text describing the current operation progress step. - Message string `json:"message,omitempty"` - - // Total steps needed to finish the operation; can decrease or increase compared to the previous value. - TotalSteps int32 `json:"total_steps,omitempty"` -} - -// 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 *ListDBClustersOKBodyPXCClustersItems0Operation) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0Operation) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPXCClustersItems0Operation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPXCClustersItems0Params PXCClusterParams represents PXC cluster parameters that can be updated. -swagger:model ListDBClustersOKBodyPXCClustersItems0Params -*/ -type ListDBClustersOKBodyPXCClustersItems0Params struct { - // Cluster size. - ClusterSize int32 `json:"cluster_size,omitempty"` - - // backup - Backup *ListDBClustersOKBodyPXCClustersItems0ParamsBackup `json:"backup,omitempty"` - - // haproxy - Haproxy *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy `json:"haproxy,omitempty"` - - // proxysql - Proxysql *ListDBClustersOKBodyPXCClustersItems0ParamsProxysql `json:"proxysql,omitempty"` - - // pxc - PXC *ListDBClustersOKBodyPXCClustersItems0ParamsPXC `json:"pxc,omitempty"` - - // restore - Restore *ListDBClustersOKBodyPXCClustersItems0ParamsRestore `json:"restore,omitempty"` -} - -// 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.validateBackup(formats); err != nil { - res = append(res, err) - } - - if err := o.validateHaproxy(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePXC(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRestore(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListDBClustersOKBodyPXCClustersItems0Params) validateBackup(formats strfmt.Registry) error { - if swag.IsZero(o.Backup) { // not required - return nil - } - - if o.Backup != nil { - if err := o.Backup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("params" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("params" + "." + "backup") - } - return err - } - } - - return nil -} - -func (o *ListDBClustersOKBodyPXCClustersItems0Params) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if o.Haproxy != nil { - if err := o.Haproxy.Validate(formats); err != nil { - 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) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if o.Proxysql != nil { - if err := o.Proxysql.Validate(formats); err != nil { - 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) validatePXC(formats strfmt.Registry) error { - if swag.IsZero(o.PXC) { // not required - return nil - } - - if o.PXC != nil { - 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 -} - -func (o *ListDBClustersOKBodyPXCClustersItems0Params) validateRestore(formats strfmt.Registry) error { - if swag.IsZero(o.Restore) { // not required - return nil - } - - if o.Restore != nil { - if err := o.Restore.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("params" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("params" + "." + "restore") - } - 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.contextValidateBackup(ctx, formats); err != nil { - res = append(res, err) - } - - 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 err := o.contextValidateRestore(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListDBClustersOKBodyPXCClustersItems0Params) contextValidateBackup(ctx context.Context, formats strfmt.Registry) error { - if o.Backup != nil { - if err := o.Backup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("params" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("params" + "." + "backup") - } - return err - } - } - - 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 - } - } - - return nil -} - -func (o *ListDBClustersOKBodyPXCClustersItems0Params) contextValidateRestore(ctx context.Context, formats strfmt.Registry) error { - if o.Restore != nil { - if err := o.Restore.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("params" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("params" + "." + "restore") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0Params) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0Params) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPXCClustersItems0Params - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPXCClustersItems0ParamsBackup Backup configuration for a database cluster -swagger:model ListDBClustersOKBodyPXCClustersItems0ParamsBackup -*/ -type ListDBClustersOKBodyPXCClustersItems0ParamsBackup struct { - // Backup Location id of stored backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Keep copies represents how many copies should retain. - KeepCopies int32 `json:"keep_copies,omitempty"` - - // Cron expression represents cron expression - CronExpression string `json:"cron_expression,omitempty"` - - // Service acccount used for backups - ServiceAccount string `json:"service_account,omitempty"` -} - -// Validate validates this list DB clusters OK body PXC clusters items0 params backup -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsBackup) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list DB clusters OK body PXC clusters items0 params backup based on context it is used -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsBackup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsBackup) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsBackup) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPXCClustersItems0ParamsBackup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy HAProxy container parameters. -// NOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it. -swagger:model ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy -*/ -type ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy struct { - // Docker image used for HAProxy. - Image string `json:"image,omitempty"` - - // compute resources - ComputeResources *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxyComputeResources `json:"compute_resources,omitempty"` -} - -// 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 { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPXCClustersItems0ParamsHaproxy - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPXCClustersItems0ParamsHaproxyComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model ListDBClustersOKBodyPXCClustersItems0ParamsHaproxyComputeResources -*/ -type ListDBClustersOKBodyPXCClustersItems0ParamsHaproxyComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// 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 *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxyComputeResources) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsHaproxyComputeResources) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPXCClustersItems0ParamsHaproxyComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPXCClustersItems0ParamsPXC PXC container parameters. -// TODO Do not use inner messages in all public APIs (for consistency). -swagger:model ListDBClustersOKBodyPXCClustersItems0ParamsPXC -*/ -type ListDBClustersOKBodyPXCClustersItems0ParamsPXC struct { - // Docker image used for PXC. - Image string `json:"image,omitempty"` - - // Disk size in bytes. - DiskSize string `json:"disk_size,omitempty"` - - // Configuration for PXC cluster - Configuration string `json:"configuration,omitempty"` - - // Storage Class for PXC cluster. - StorageClass string `json:"storage_class,omitempty"` - - // compute resources - ComputeResources *ListDBClustersOKBodyPXCClustersItems0ParamsPXCComputeResources `json:"compute_resources,omitempty"` -} - -// 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 { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsPXC) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsPXC) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsPXC) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPXCClustersItems0ParamsPXC - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPXCClustersItems0ParamsPXCComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model ListDBClustersOKBodyPXCClustersItems0ParamsPXCComputeResources -*/ -type ListDBClustersOKBodyPXCClustersItems0ParamsPXCComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// 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 *ListDBClustersOKBodyPXCClustersItems0ParamsPXCComputeResources) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsPXCComputeResources) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPXCClustersItems0ParamsPXCComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPXCClustersItems0ParamsProxysql ProxySQL container parameters. -// TODO Do not use inner messages in all public APIs (for consistency). -swagger:model ListDBClustersOKBodyPXCClustersItems0ParamsProxysql -*/ -type ListDBClustersOKBodyPXCClustersItems0ParamsProxysql struct { - // Docker image used for ProxySQL. - Image string `json:"image,omitempty"` - - // Disk size in bytes. - DiskSize string `json:"disk_size,omitempty"` - - // compute resources - ComputeResources *ListDBClustersOKBodyPXCClustersItems0ParamsProxysqlComputeResources `json:"compute_resources,omitempty"` -} - -// 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 { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsProxysql) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsProxysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsProxysql) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPXCClustersItems0ParamsProxysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPXCClustersItems0ParamsProxysqlComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model ListDBClustersOKBodyPXCClustersItems0ParamsProxysqlComputeResources -*/ -type ListDBClustersOKBodyPXCClustersItems0ParamsProxysqlComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// 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 *ListDBClustersOKBodyPXCClustersItems0ParamsProxysqlComputeResources) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsProxysqlComputeResources) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPXCClustersItems0ParamsProxysqlComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPXCClustersItems0ParamsRestore Restore represents restoration payload to restore a database cluster from backup -swagger:model ListDBClustersOKBodyPXCClustersItems0ParamsRestore -*/ -type ListDBClustersOKBodyPXCClustersItems0ParamsRestore struct { - // Backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Destination filename. - Destination string `json:"destination,omitempty"` - - // K8s Secrets name. - SecretsName string `json:"secrets_name,omitempty"` -} - -// Validate validates this list DB clusters OK body PXC clusters items0 params restore -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsRestore) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list DB clusters OK body PXC clusters items0 params restore based on context it is used -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsRestore) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsRestore) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0ParamsRestore) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPXCClustersItems0ParamsRestore - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPXCClustersItems0Restore Restore represents restoration payload to restore a database cluster from backup -swagger:model ListDBClustersOKBodyPXCClustersItems0Restore -*/ -type ListDBClustersOKBodyPXCClustersItems0Restore struct { - // Backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Destination filename. - Destination string `json:"destination,omitempty"` - - // K8s Secrets name. - SecretsName string `json:"secrets_name,omitempty"` -} - -// Validate validates this list DB clusters OK body PXC clusters items0 restore -func (o *ListDBClustersOKBodyPXCClustersItems0Restore) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list DB clusters OK body PXC clusters items0 restore based on context it is used -func (o *ListDBClustersOKBodyPXCClustersItems0Restore) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0Restore) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0Restore) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPXCClustersItems0Restore - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListDBClustersOKBodyPXCClustersItems0Template list DB clusters OK body PXC clusters items0 template -swagger:model ListDBClustersOKBodyPXCClustersItems0Template -*/ -type ListDBClustersOKBodyPXCClustersItems0Template struct { - // Template CR name. - Name string `json:"name,omitempty"` - - // Template CR kind. - Kind string `json:"kind,omitempty"` -} - -// Validate validates this list DB clusters OK body PXC clusters items0 template -func (o *ListDBClustersOKBodyPXCClustersItems0Template) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list DB clusters OK body PXC clusters items0 template based on context it is used -func (o *ListDBClustersOKBodyPXCClustersItems0Template) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0Template) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListDBClustersOKBodyPXCClustersItems0Template) UnmarshalBinary(b []byte) error { - var res ListDBClustersOKBodyPXCClustersItems0Template - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/dbaas/json/client/db_clusters/list_s3_backups_parameters.go b/api/managementpb/dbaas/json/client/db_clusters/list_s3_backups_parameters.go deleted file mode 100644 index e1317ba225..0000000000 --- a/api/managementpb/dbaas/json/client/db_clusters/list_s3_backups_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package db_clusters - -// 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" -) - -// NewListS3BackupsParams creates a new ListS3BackupsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListS3BackupsParams() *ListS3BackupsParams { - return &ListS3BackupsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListS3BackupsParamsWithTimeout creates a new ListS3BackupsParams object -// with the ability to set a timeout on a request. -func NewListS3BackupsParamsWithTimeout(timeout time.Duration) *ListS3BackupsParams { - return &ListS3BackupsParams{ - timeout: timeout, - } -} - -// NewListS3BackupsParamsWithContext creates a new ListS3BackupsParams object -// with the ability to set a context for a request. -func NewListS3BackupsParamsWithContext(ctx context.Context) *ListS3BackupsParams { - return &ListS3BackupsParams{ - Context: ctx, - } -} - -// NewListS3BackupsParamsWithHTTPClient creates a new ListS3BackupsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListS3BackupsParamsWithHTTPClient(client *http.Client) *ListS3BackupsParams { - return &ListS3BackupsParams{ - HTTPClient: client, - } -} - -/* -ListS3BackupsParams contains all the parameters to send to the API endpoint - - for the list s3 backups operation. - - Typically these are written to a http.Request. -*/ -type ListS3BackupsParams struct { - // Body. - Body ListS3BackupsBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list s3 backups params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListS3BackupsParams) WithDefaults() *ListS3BackupsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list s3 backups params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListS3BackupsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list s3 backups params -func (o *ListS3BackupsParams) WithTimeout(timeout time.Duration) *ListS3BackupsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list s3 backups params -func (o *ListS3BackupsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list s3 backups params -func (o *ListS3BackupsParams) WithContext(ctx context.Context) *ListS3BackupsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list s3 backups params -func (o *ListS3BackupsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list s3 backups params -func (o *ListS3BackupsParams) WithHTTPClient(client *http.Client) *ListS3BackupsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list s3 backups params -func (o *ListS3BackupsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the list s3 backups params -func (o *ListS3BackupsParams) WithBody(body ListS3BackupsBody) *ListS3BackupsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the list s3 backups params -func (o *ListS3BackupsParams) SetBody(body ListS3BackupsBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ListS3BackupsParams) 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/managementpb/dbaas/json/client/db_clusters/list_s3_backups_responses.go b/api/managementpb/dbaas/json/client/db_clusters/list_s3_backups_responses.go deleted file mode 100644 index 49479866fe..0000000000 --- a/api/managementpb/dbaas/json/client/db_clusters/list_s3_backups_responses.go +++ /dev/null @@ -1,432 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package db_clusters - -// 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" -) - -// ListS3BackupsReader is a Reader for the ListS3Backups structure. -type ListS3BackupsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListS3BackupsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListS3BackupsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListS3BackupsDefault(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 - } -} - -// NewListS3BackupsOK creates a ListS3BackupsOK with default headers values -func NewListS3BackupsOK() *ListS3BackupsOK { - return &ListS3BackupsOK{} -} - -/* -ListS3BackupsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListS3BackupsOK struct { - Payload *ListS3BackupsOKBody -} - -func (o *ListS3BackupsOK) Error() string { - return fmt.Sprintf("[POST /v1/management/DBaaS/Backups/List][%d] listS3BackupsOk %+v", 200, o.Payload) -} - -func (o *ListS3BackupsOK) GetPayload() *ListS3BackupsOKBody { - return o.Payload -} - -func (o *ListS3BackupsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListS3BackupsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListS3BackupsDefault creates a ListS3BackupsDefault with default headers values -func NewListS3BackupsDefault(code int) *ListS3BackupsDefault { - return &ListS3BackupsDefault{ - _statusCode: code, - } -} - -/* -ListS3BackupsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListS3BackupsDefault struct { - _statusCode int - - Payload *ListS3BackupsDefaultBody -} - -// Code gets the status code for the list s3 backups default response -func (o *ListS3BackupsDefault) Code() int { - return o._statusCode -} - -func (o *ListS3BackupsDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/DBaaS/Backups/List][%d] ListS3Backups default %+v", o._statusCode, o.Payload) -} - -func (o *ListS3BackupsDefault) GetPayload() *ListS3BackupsDefaultBody { - return o.Payload -} - -func (o *ListS3BackupsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListS3BackupsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ListS3BackupsBody list s3 backups body -swagger:model ListS3BackupsBody -*/ -type ListS3BackupsBody struct { - // Backup Location ID to list backups from - LocationID string `json:"location_id,omitempty"` -} - -// Validate validates this list s3 backups body -func (o *ListS3BackupsBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list s3 backups body based on context it is used -func (o *ListS3BackupsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListS3BackupsBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListS3BackupsBody) UnmarshalBinary(b []byte) error { - var res ListS3BackupsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListS3BackupsDefaultBody list s3 backups default body -swagger:model ListS3BackupsDefaultBody -*/ -type ListS3BackupsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListS3BackupsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list s3 backups default body -func (o *ListS3BackupsDefaultBody) 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 *ListS3BackupsDefaultBody) 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("ListS3Backups default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ListS3Backups default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list s3 backups default body based on the context it is used -func (o *ListS3BackupsDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListS3BackupsDefaultBody) 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("ListS3Backups default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ListS3Backups default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListS3BackupsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListS3BackupsDefaultBody) UnmarshalBinary(b []byte) error { - var res ListS3BackupsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListS3BackupsDefaultBodyDetailsItems0 list s3 backups default body details items0 -swagger:model ListS3BackupsDefaultBodyDetailsItems0 -*/ -type ListS3BackupsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// Validate validates this list s3 backups default body details items0 -func (o *ListS3BackupsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list s3 backups default body details items0 based on context it is used -func (o *ListS3BackupsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListS3BackupsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListS3BackupsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListS3BackupsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListS3BackupsOKBody list s3 backups OK body -swagger:model ListS3BackupsOKBody -*/ -type ListS3BackupsOKBody struct { - // Backup list. - Backups []*ListS3BackupsOKBodyBackupsItems0 `json:"backups"` -} - -// Validate validates this list s3 backups OK body -func (o *ListS3BackupsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateBackups(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListS3BackupsOKBody) validateBackups(formats strfmt.Registry) error { - if swag.IsZero(o.Backups) { // not required - return nil - } - - for i := 0; i < len(o.Backups); i++ { - if swag.IsZero(o.Backups[i]) { // not required - continue - } - - if o.Backups[i] != nil { - if err := o.Backups[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listS3BackupsOk" + "." + "backups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listS3BackupsOk" + "." + "backups" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list s3 backups OK body based on the context it is used -func (o *ListS3BackupsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateBackups(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListS3BackupsOKBody) contextValidateBackups(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Backups); i++ { - if o.Backups[i] != nil { - if err := o.Backups[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listS3BackupsOk" + "." + "backups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listS3BackupsOk" + "." + "backups" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListS3BackupsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListS3BackupsOKBody) UnmarshalBinary(b []byte) error { - var res ListS3BackupsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListS3BackupsOKBodyBackupsItems0 list s3 backups OK body backups items0 -swagger:model ListS3BackupsOKBodyBackupsItems0 -*/ -type ListS3BackupsOKBodyBackupsItems0 struct { - // Key of a filename on s3. - Key string `json:"key,omitempty"` -} - -// Validate validates this list s3 backups OK body backups items0 -func (o *ListS3BackupsOKBodyBackupsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list s3 backups OK body backups items0 based on context it is used -func (o *ListS3BackupsOKBodyBackupsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListS3BackupsOKBodyBackupsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListS3BackupsOKBodyBackupsItems0) UnmarshalBinary(b []byte) error { - var res ListS3BackupsOKBodyBackupsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/dbaas/json/client/db_clusters/list_secrets_parameters.go b/api/managementpb/dbaas/json/client/db_clusters/list_secrets_parameters.go deleted file mode 100644 index d7c6857780..0000000000 --- a/api/managementpb/dbaas/json/client/db_clusters/list_secrets_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package db_clusters - -// 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" -) - -// NewListSecretsParams creates a new ListSecretsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListSecretsParams() *ListSecretsParams { - return &ListSecretsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListSecretsParamsWithTimeout creates a new ListSecretsParams object -// with the ability to set a timeout on a request. -func NewListSecretsParamsWithTimeout(timeout time.Duration) *ListSecretsParams { - return &ListSecretsParams{ - timeout: timeout, - } -} - -// NewListSecretsParamsWithContext creates a new ListSecretsParams object -// with the ability to set a context for a request. -func NewListSecretsParamsWithContext(ctx context.Context) *ListSecretsParams { - return &ListSecretsParams{ - Context: ctx, - } -} - -// NewListSecretsParamsWithHTTPClient creates a new ListSecretsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListSecretsParamsWithHTTPClient(client *http.Client) *ListSecretsParams { - return &ListSecretsParams{ - HTTPClient: client, - } -} - -/* -ListSecretsParams contains all the parameters to send to the API endpoint - - for the list secrets operation. - - Typically these are written to a http.Request. -*/ -type ListSecretsParams struct { - // Body. - Body ListSecretsBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list secrets params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListSecretsParams) WithDefaults() *ListSecretsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list secrets params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListSecretsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list secrets params -func (o *ListSecretsParams) WithTimeout(timeout time.Duration) *ListSecretsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list secrets params -func (o *ListSecretsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list secrets params -func (o *ListSecretsParams) WithContext(ctx context.Context) *ListSecretsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list secrets params -func (o *ListSecretsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list secrets params -func (o *ListSecretsParams) WithHTTPClient(client *http.Client) *ListSecretsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list secrets params -func (o *ListSecretsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the list secrets params -func (o *ListSecretsParams) WithBody(body ListSecretsBody) *ListSecretsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the list secrets params -func (o *ListSecretsParams) SetBody(body ListSecretsBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ListSecretsParams) 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/managementpb/dbaas/json/client/db_clusters/list_secrets_responses.go b/api/managementpb/dbaas/json/client/db_clusters/list_secrets_responses.go deleted file mode 100644 index d6d7f3c134..0000000000 --- a/api/managementpb/dbaas/json/client/db_clusters/list_secrets_responses.go +++ /dev/null @@ -1,432 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package db_clusters - -// 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" -) - -// ListSecretsReader is a Reader for the ListSecrets structure. -type ListSecretsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListSecretsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListSecretsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListSecretsDefault(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 - } -} - -// NewListSecretsOK creates a ListSecretsOK with default headers values -func NewListSecretsOK() *ListSecretsOK { - return &ListSecretsOK{} -} - -/* -ListSecretsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListSecretsOK struct { - Payload *ListSecretsOKBody -} - -func (o *ListSecretsOK) Error() string { - return fmt.Sprintf("[POST /v1/management/DBaaS/Secrets/List][%d] listSecretsOk %+v", 200, o.Payload) -} - -func (o *ListSecretsOK) GetPayload() *ListSecretsOKBody { - return o.Payload -} - -func (o *ListSecretsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListSecretsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListSecretsDefault creates a ListSecretsDefault with default headers values -func NewListSecretsDefault(code int) *ListSecretsDefault { - return &ListSecretsDefault{ - _statusCode: code, - } -} - -/* -ListSecretsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListSecretsDefault struct { - _statusCode int - - Payload *ListSecretsDefaultBody -} - -// Code gets the status code for the list secrets default response -func (o *ListSecretsDefault) Code() int { - return o._statusCode -} - -func (o *ListSecretsDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/DBaaS/Secrets/List][%d] ListSecrets default %+v", o._statusCode, o.Payload) -} - -func (o *ListSecretsDefault) GetPayload() *ListSecretsDefaultBody { - return o.Payload -} - -func (o *ListSecretsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListSecretsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ListSecretsBody list secrets body -swagger:model ListSecretsBody -*/ -type ListSecretsBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` -} - -// Validate validates this list secrets body -func (o *ListSecretsBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list secrets body based on context it is used -func (o *ListSecretsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListSecretsBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListSecretsBody) UnmarshalBinary(b []byte) error { - var res ListSecretsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListSecretsDefaultBody list secrets default body -swagger:model ListSecretsDefaultBody -*/ -type ListSecretsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListSecretsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list secrets default body -func (o *ListSecretsDefaultBody) 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 *ListSecretsDefaultBody) 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("ListSecrets default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ListSecrets default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list secrets default body based on the context it is used -func (o *ListSecretsDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListSecretsDefaultBody) 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("ListSecrets default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ListSecrets default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListSecretsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListSecretsDefaultBody) UnmarshalBinary(b []byte) error { - var res ListSecretsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListSecretsDefaultBodyDetailsItems0 list secrets default body details items0 -swagger:model ListSecretsDefaultBodyDetailsItems0 -*/ -type ListSecretsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// Validate validates this list secrets default body details items0 -func (o *ListSecretsDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list secrets default body details items0 based on context it is used -func (o *ListSecretsDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListSecretsDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListSecretsDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListSecretsDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListSecretsOKBody list secrets OK body -swagger:model ListSecretsOKBody -*/ -type ListSecretsOKBody struct { - // Secret list. - Secrets []*ListSecretsOKBodySecretsItems0 `json:"secrets"` -} - -// Validate validates this list secrets OK body -func (o *ListSecretsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateSecrets(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListSecretsOKBody) validateSecrets(formats strfmt.Registry) error { - if swag.IsZero(o.Secrets) { // not required - return nil - } - - for i := 0; i < len(o.Secrets); i++ { - if swag.IsZero(o.Secrets[i]) { // not required - continue - } - - if o.Secrets[i] != nil { - if err := o.Secrets[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listSecretsOk" + "." + "secrets" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listSecretsOk" + "." + "secrets" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list secrets OK body based on the context it is used -func (o *ListSecretsOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateSecrets(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListSecretsOKBody) contextValidateSecrets(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Secrets); i++ { - if o.Secrets[i] != nil { - if err := o.Secrets[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("listSecretsOk" + "." + "secrets" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("listSecretsOk" + "." + "secrets" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListSecretsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListSecretsOKBody) UnmarshalBinary(b []byte) error { - var res ListSecretsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListSecretsOKBodySecretsItems0 list secrets OK body secrets items0 -swagger:model ListSecretsOKBodySecretsItems0 -*/ -type ListSecretsOKBodySecretsItems0 struct { - // Name of a secret - Name string `json:"name,omitempty"` -} - -// Validate validates this list secrets OK body secrets items0 -func (o *ListSecretsOKBodySecretsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list secrets OK body secrets items0 based on context it is used -func (o *ListSecretsOKBodySecretsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListSecretsOKBodySecretsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListSecretsOKBodySecretsItems0) UnmarshalBinary(b []byte) error { - var res ListSecretsOKBodySecretsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} 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 deleted file mode 100644 index 43b6755cc5..0000000000 --- a/api/managementpb/dbaas/json/client/db_clusters/restart_db_cluster_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package db_clusters - -// 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" -) - -// 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 { - return &RestartDBClusterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewRestartDBClusterParamsWithTimeout creates a new RestartDBClusterParams object -// with the ability to set a timeout on a request. -func NewRestartDBClusterParamsWithTimeout(timeout time.Duration) *RestartDBClusterParams { - return &RestartDBClusterParams{ - timeout: timeout, - } -} - -// NewRestartDBClusterParamsWithContext creates a new RestartDBClusterParams object -// with the ability to set a context for a request. -func NewRestartDBClusterParamsWithContext(ctx context.Context) *RestartDBClusterParams { - return &RestartDBClusterParams{ - Context: ctx, - } -} - -// NewRestartDBClusterParamsWithHTTPClient creates a new RestartDBClusterParams object -// with the ability to set a custom HTTPClient for a request. -func NewRestartDBClusterParamsWithHTTPClient(client *http.Client) *RestartDBClusterParams { - 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. -*/ -type RestartDBClusterParams struct { - // Body. - Body RestartDBClusterBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the restart DB cluster params -func (o *RestartDBClusterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the restart DB cluster params -func (o *RestartDBClusterParams) WithContext(ctx context.Context) *RestartDBClusterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the restart DB cluster params -func (o *RestartDBClusterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the restart DB cluster params -func (o *RestartDBClusterParams) WithHTTPClient(client *http.Client) *RestartDBClusterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the restart DB cluster params -func (o *RestartDBClusterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the restart DB cluster params -func (o *RestartDBClusterParams) WithBody(body RestartDBClusterBody) *RestartDBClusterParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the restart DB cluster params -func (o *RestartDBClusterParams) SetBody(body RestartDBClusterBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *RestartDBClusterParams) 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/managementpb/dbaas/json/client/db_clusters/restart_db_cluster_responses.go b/api/managementpb/dbaas/json/client/db_clusters/restart_db_cluster_responses.go deleted file mode 100644 index 99bd494ffb..0000000000 --- a/api/managementpb/dbaas/json/client/db_clusters/restart_db_cluster_responses.go +++ /dev/null @@ -1,362 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package db_clusters - -// 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" -) - -// RestartDBClusterReader is a Reader for the RestartDBCluster structure. -type RestartDBClusterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *RestartDBClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewRestartDBClusterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewRestartDBClusterDefault(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 - } -} - -// NewRestartDBClusterOK creates a RestartDBClusterOK with default headers values -func NewRestartDBClusterOK() *RestartDBClusterOK { - return &RestartDBClusterOK{} -} - -/* -RestartDBClusterOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type RestartDBClusterOK struct { - Payload interface{} -} - -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 -} - -func (o *RestartDBClusterOK) 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 -} - -// NewRestartDBClusterDefault creates a RestartDBClusterDefault with default headers values -func NewRestartDBClusterDefault(code int) *RestartDBClusterDefault { - return &RestartDBClusterDefault{ - _statusCode: code, - } -} - -/* -RestartDBClusterDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type RestartDBClusterDefault struct { - _statusCode int - - Payload *RestartDBClusterDefaultBody -} - -// Code gets the status code for the restart DB cluster default response -func (o *RestartDBClusterDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *RestartDBClusterDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(RestartDBClusterDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -RestartDBClusterBody restart DB cluster body -swagger:model RestartDBClusterBody -*/ -type RestartDBClusterBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // PXC cluster name. - Name string `json:"name,omitempty"` - - // DBClusterType represents database cluster type. - // - // - DB_CLUSTER_TYPE_INVALID: DB_CLUSTER_TYPE_INVALID represents unknown cluster type. - // - DB_CLUSTER_TYPE_PXC: DB_CLUSTER_TYPE_PXC represents pxc cluster type. - // - DB_CLUSTER_TYPE_PSMDB: DB_CLUSTER_TYPE_PSMDB represents psmdb cluster type. - // Enum: [DB_CLUSTER_TYPE_INVALID DB_CLUSTER_TYPE_PXC DB_CLUSTER_TYPE_PSMDB] - ClusterType *string `json:"cluster_type,omitempty"` -} - -// Validate validates this restart DB cluster body -func (o *RestartDBClusterBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateClusterType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var restartDbClusterBodyTypeClusterTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DB_CLUSTER_TYPE_INVALID","DB_CLUSTER_TYPE_PXC","DB_CLUSTER_TYPE_PSMDB"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - restartDbClusterBodyTypeClusterTypePropEnum = append(restartDbClusterBodyTypeClusterTypePropEnum, v) - } -} - -const ( - - // RestartDBClusterBodyClusterTypeDBCLUSTERTYPEINVALID captures enum value "DB_CLUSTER_TYPE_INVALID" - RestartDBClusterBodyClusterTypeDBCLUSTERTYPEINVALID string = "DB_CLUSTER_TYPE_INVALID" - - // RestartDBClusterBodyClusterTypeDBCLUSTERTYPEPXC captures enum value "DB_CLUSTER_TYPE_PXC" - RestartDBClusterBodyClusterTypeDBCLUSTERTYPEPXC string = "DB_CLUSTER_TYPE_PXC" - - // RestartDBClusterBodyClusterTypeDBCLUSTERTYPEPSMDB captures enum value "DB_CLUSTER_TYPE_PSMDB" - RestartDBClusterBodyClusterTypeDBCLUSTERTYPEPSMDB string = "DB_CLUSTER_TYPE_PSMDB" -) - -// prop value enum -func (o *RestartDBClusterBody) validateClusterTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, restartDbClusterBodyTypeClusterTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *RestartDBClusterBody) validateClusterType(formats strfmt.Registry) error { - if swag.IsZero(o.ClusterType) { // not required - return nil - } - - // value enum - if err := o.validateClusterTypeEnum("body"+"."+"cluster_type", "body", *o.ClusterType); err != nil { - return err - } - - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RestartDBClusterBody) UnmarshalBinary(b []byte) error { - var res RestartDBClusterBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -RestartDBClusterDefaultBody restart DB cluster default body -swagger:model RestartDBClusterDefaultBody -*/ -type RestartDBClusterDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*RestartDBClusterDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this restart DB cluster default body -func (o *RestartDBClusterDefaultBody) 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 *RestartDBClusterDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *RestartDBClusterDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RestartDBClusterDefaultBody) UnmarshalBinary(b []byte) error { - var res RestartDBClusterDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -RestartDBClusterDefaultBodyDetailsItems0 restart DB cluster default body details items0 -swagger:model RestartDBClusterDefaultBodyDetailsItems0 -*/ -type RestartDBClusterDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 deleted file mode 100644 index ffa4c86bad..0000000000 --- a/api/managementpb/dbaas/json/client/kubernetes/get_kubernetes_cluster_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package kubernetes - -// 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" -) - -// 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 { - return &GetKubernetesClusterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetKubernetesClusterParamsWithTimeout creates a new GetKubernetesClusterParams object -// with the ability to set a timeout on a request. -func NewGetKubernetesClusterParamsWithTimeout(timeout time.Duration) *GetKubernetesClusterParams { - return &GetKubernetesClusterParams{ - timeout: timeout, - } -} - -// NewGetKubernetesClusterParamsWithContext creates a new GetKubernetesClusterParams object -// with the ability to set a context for a request. -func NewGetKubernetesClusterParamsWithContext(ctx context.Context) *GetKubernetesClusterParams { - return &GetKubernetesClusterParams{ - Context: ctx, - } -} - -// NewGetKubernetesClusterParamsWithHTTPClient creates a new GetKubernetesClusterParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetKubernetesClusterParamsWithHTTPClient(client *http.Client) *GetKubernetesClusterParams { - 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. -*/ -type GetKubernetesClusterParams struct { - // Body. - Body GetKubernetesClusterBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the get kubernetes cluster params -func (o *GetKubernetesClusterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get kubernetes cluster params -func (o *GetKubernetesClusterParams) WithContext(ctx context.Context) *GetKubernetesClusterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get kubernetes cluster params -func (o *GetKubernetesClusterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get kubernetes cluster params -func (o *GetKubernetesClusterParams) WithHTTPClient(client *http.Client) *GetKubernetesClusterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get kubernetes cluster params -func (o *GetKubernetesClusterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get kubernetes cluster params -func (o *GetKubernetesClusterParams) WithBody(body GetKubernetesClusterBody) *GetKubernetesClusterParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get kubernetes cluster params -func (o *GetKubernetesClusterParams) SetBody(body GetKubernetesClusterBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetKubernetesClusterParams) 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/managementpb/dbaas/json/client/kubernetes/get_kubernetes_cluster_responses.go b/api/managementpb/dbaas/json/client/kubernetes/get_kubernetes_cluster_responses.go deleted file mode 100644 index 28755b99e1..0000000000 --- a/api/managementpb/dbaas/json/client/kubernetes/get_kubernetes_cluster_responses.go +++ /dev/null @@ -1,423 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package kubernetes - -// 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" -) - -// GetKubernetesClusterReader is a Reader for the GetKubernetesCluster structure. -type GetKubernetesClusterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetKubernetesClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetKubernetesClusterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetKubernetesClusterDefault(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 - } -} - -// NewGetKubernetesClusterOK creates a GetKubernetesClusterOK with default headers values -func NewGetKubernetesClusterOK() *GetKubernetesClusterOK { - return &GetKubernetesClusterOK{} -} - -/* -GetKubernetesClusterOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetKubernetesClusterOK struct { - Payload *GetKubernetesClusterOKBody -} - -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 -} - -func (o *GetKubernetesClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetKubernetesClusterOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetKubernetesClusterDefault creates a GetKubernetesClusterDefault with default headers values -func NewGetKubernetesClusterDefault(code int) *GetKubernetesClusterDefault { - return &GetKubernetesClusterDefault{ - _statusCode: code, - } -} - -/* -GetKubernetesClusterDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetKubernetesClusterDefault struct { - _statusCode int - - Payload *GetKubernetesClusterDefaultBody -} - -// Code gets the status code for the get kubernetes cluster default response -func (o *GetKubernetesClusterDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *GetKubernetesClusterDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetKubernetesClusterDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -GetKubernetesClusterBody get kubernetes cluster body -swagger:model GetKubernetesClusterBody -*/ -type GetKubernetesClusterBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` -} - -// Validate validates this get kubernetes cluster body -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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetKubernetesClusterBody) UnmarshalBinary(b []byte) error { - var res GetKubernetesClusterBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetKubernetesClusterDefaultBody get kubernetes cluster default body -swagger:model GetKubernetesClusterDefaultBody -*/ -type GetKubernetesClusterDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetKubernetesClusterDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get kubernetes cluster default body -func (o *GetKubernetesClusterDefaultBody) 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 *GetKubernetesClusterDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetKubernetesClusterDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetKubernetesClusterDefaultBody) UnmarshalBinary(b []byte) error { - var res GetKubernetesClusterDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetKubernetesClusterDefaultBodyDetailsItems0 get kubernetes cluster default body details items0 -swagger:model GetKubernetesClusterDefaultBodyDetailsItems0 -*/ -type GetKubernetesClusterDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 -*/ -type GetKubernetesClusterOKBody struct { - // kube auth - KubeAuth *GetKubernetesClusterOKBodyKubeAuth `json:"kube_auth,omitempty"` -} - -// Validate validates this get kubernetes cluster OK body -func (o *GetKubernetesClusterOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateKubeAuth(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetKubernetesClusterOKBody) validateKubeAuth(formats strfmt.Registry) error { - if swag.IsZero(o.KubeAuth) { // not required - return nil - } - - if o.KubeAuth != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetKubernetesClusterOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetKubernetesClusterOKBody) UnmarshalBinary(b []byte) error { - var res GetKubernetesClusterOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetKubernetesClusterOKBodyKubeAuth KubeAuth represents Kubernetes / kubectl authentication and authorization information. -swagger:model GetKubernetesClusterOKBodyKubeAuth -*/ -type GetKubernetesClusterOKBodyKubeAuth struct { - // Kubeconfig file content. - Kubeconfig string `json:"kubeconfig,omitempty"` -} - -// Validate validates this get kubernetes cluster OK body kube auth -func (o *GetKubernetesClusterOKBodyKubeAuth) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetKubernetesClusterOKBodyKubeAuth) UnmarshalBinary(b []byte) error { - var res GetKubernetesClusterOKBodyKubeAuth - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return 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 deleted file mode 100644 index c973499d64..0000000000 --- a/api/managementpb/dbaas/json/client/kubernetes/get_resources_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package kubernetes - -// 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" -) - -// 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 { - return &GetResourcesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetResourcesParamsWithTimeout creates a new GetResourcesParams object -// with the ability to set a timeout on a request. -func NewGetResourcesParamsWithTimeout(timeout time.Duration) *GetResourcesParams { - return &GetResourcesParams{ - timeout: timeout, - } -} - -// NewGetResourcesParamsWithContext creates a new GetResourcesParams object -// with the ability to set a context for a request. -func NewGetResourcesParamsWithContext(ctx context.Context) *GetResourcesParams { - return &GetResourcesParams{ - Context: ctx, - } -} - -// NewGetResourcesParamsWithHTTPClient creates a new GetResourcesParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetResourcesParamsWithHTTPClient(client *http.Client) *GetResourcesParams { - 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. -*/ -type GetResourcesParams struct { - // Body. - Body GetResourcesBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the get resources params -func (o *GetResourcesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get resources params -func (o *GetResourcesParams) WithContext(ctx context.Context) *GetResourcesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get resources params -func (o *GetResourcesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get resources params -func (o *GetResourcesParams) WithHTTPClient(client *http.Client) *GetResourcesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get resources params -func (o *GetResourcesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get resources params -func (o *GetResourcesParams) WithBody(body GetResourcesBody) *GetResourcesParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get resources params -func (o *GetResourcesParams) SetBody(body GetResourcesBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetResourcesParams) 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/managementpb/dbaas/json/client/kubernetes/get_resources_responses.go b/api/managementpb/dbaas/json/client/kubernetes/get_resources_responses.go deleted file mode 100644 index 0c057ab4cd..0000000000 --- a/api/managementpb/dbaas/json/client/kubernetes/get_resources_responses.go +++ /dev/null @@ -1,519 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package kubernetes - -// 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" -) - -// GetResourcesReader is a Reader for the GetResources structure. -type GetResourcesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetResourcesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetResourcesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetResourcesDefault(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 - } -} - -// NewGetResourcesOK creates a GetResourcesOK with default headers values -func NewGetResourcesOK() *GetResourcesOK { - return &GetResourcesOK{} -} - -/* -GetResourcesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetResourcesOK struct { - Payload *GetResourcesOKBody -} - -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 -} - -func (o *GetResourcesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetResourcesOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetResourcesDefault creates a GetResourcesDefault with default headers values -func NewGetResourcesDefault(code int) *GetResourcesDefault { - return &GetResourcesDefault{ - _statusCode: code, - } -} - -/* -GetResourcesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetResourcesDefault struct { - _statusCode int - - Payload *GetResourcesDefaultBody -} - -// Code gets the status code for the get resources default response -func (o *GetResourcesDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *GetResourcesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetResourcesDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -GetResourcesBody get resources body -swagger:model GetResourcesBody -*/ -type GetResourcesBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` -} - -// Validate validates this get resources body -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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetResourcesBody) UnmarshalBinary(b []byte) error { - var res GetResourcesBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetResourcesDefaultBody get resources default body -swagger:model GetResourcesDefaultBody -*/ -type GetResourcesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetResourcesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get resources default body -func (o *GetResourcesDefaultBody) 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 *GetResourcesDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetResourcesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetResourcesDefaultBody) UnmarshalBinary(b []byte) error { - var res GetResourcesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetResourcesDefaultBodyDetailsItems0 get resources default body details items0 -swagger:model GetResourcesDefaultBodyDetailsItems0 -*/ -type GetResourcesDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 -*/ -type GetResourcesOKBody struct { - // all - All *GetResourcesOKBodyAll `json:"all,omitempty"` - - // available - Available *GetResourcesOKBodyAvailable `json:"available,omitempty"` -} - -// Validate validates this get resources OK body -func (o *GetResourcesOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateAll(formats); err != nil { - res = append(res, err) - } - - if err := o.validateAvailable(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetResourcesOKBody) validateAll(formats strfmt.Registry) error { - if swag.IsZero(o.All) { // not required - return nil - } - - if o.All != nil { - 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 - } - } - - return nil -} - -func (o *GetResourcesOKBody) validateAvailable(formats strfmt.Registry) error { - if swag.IsZero(o.Available) { // not required - return nil - } - - if o.Available != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetResourcesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetResourcesOKBody) UnmarshalBinary(b []byte) error { - var res GetResourcesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetResourcesOKBodyAll Resources contains Kubernetes cluster resources. -swagger:model GetResourcesOKBodyAll -*/ -type GetResourcesOKBodyAll struct { - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` - - // CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus. - // See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu. - CPUm string `json:"cpu_m,omitempty"` - - // Disk size in bytes. - DiskSize string `json:"disk_size,omitempty"` -} - -// Validate validates this get resources OK body all -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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetResourcesOKBodyAll) UnmarshalBinary(b []byte) error { - var res GetResourcesOKBodyAll - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetResourcesOKBodyAvailable Resources contains Kubernetes cluster resources. -swagger:model GetResourcesOKBodyAvailable -*/ -type GetResourcesOKBodyAvailable struct { - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` - - // CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus. - // See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu. - CPUm string `json:"cpu_m,omitempty"` - - // Disk size in bytes. - DiskSize string `json:"disk_size,omitempty"` -} - -// Validate validates this get resources OK body available -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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetResourcesOKBodyAvailable) UnmarshalBinary(b []byte) error { - var res GetResourcesOKBodyAvailable - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/dbaas/json/client/kubernetes/kubernetes_client.go b/api/managementpb/dbaas/json/client/kubernetes/kubernetes_client.go deleted file mode 100644 index 16fd0d9ddd..0000000000 --- a/api/managementpb/dbaas/json/client/kubernetes/kubernetes_client.go +++ /dev/null @@ -1,271 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package kubernetes - -// 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 kubernetes API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for kubernetes 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 { - GetKubernetesCluster(params *GetKubernetesClusterParams, opts ...ClientOption) (*GetKubernetesClusterOK, error) - - GetResources(params *GetResourcesParams, opts ...ClientOption) (*GetResourcesOK, error) - - ListKubernetesClusters(params *ListKubernetesClustersParams, opts ...ClientOption) (*ListKubernetesClustersOK, error) - - ListStorageClasses(params *ListStorageClassesParams, opts ...ClientOption) (*ListStorageClassesOK, error) - - RegisterKubernetesCluster(params *RegisterKubernetesClusterParams, opts ...ClientOption) (*RegisterKubernetesClusterOK, error) - - UnregisterKubernetesCluster(params *UnregisterKubernetesClusterParams, opts ...ClientOption) (*UnregisterKubernetesClusterOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -GetKubernetesCluster gets kubernetes cluster return kube auth with kubernetes config -*/ -func (a *Client) GetKubernetesCluster(params *GetKubernetesClusterParams, opts ...ClientOption) (*GetKubernetesClusterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetKubernetesClusterParams() - } - op := &runtime.ClientOperation{ - ID: "GetKubernetesCluster", - Method: "POST", - PathPattern: "/v1/management/DBaaS/Kubernetes/Get", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*GetKubernetesClusterOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetKubernetesClusterDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -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, opts ...ClientOption) (*GetResourcesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetResourcesParams() - } - op := &runtime.ClientOperation{ - ID: "GetResources", - Method: "POST", - PathPattern: "/v1/management/DBaaS/Kubernetes/Resources/Get", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*GetResourcesOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetResourcesDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListKubernetesClusters lists kubernetes clusters returns a list of all registered kubernetes clusters -*/ -func (a *Client) ListKubernetesClusters(params *ListKubernetesClustersParams, opts ...ClientOption) (*ListKubernetesClustersOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListKubernetesClustersParams() - } - op := &runtime.ClientOperation{ - ID: "ListKubernetesClusters", - Method: "POST", - PathPattern: "/v1/management/DBaaS/Kubernetes/List", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*ListKubernetesClustersOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*ListKubernetesClustersDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -ListStorageClasses lists storage classes returns the names of all storage classes available in a kubernetes cluster -*/ -func (a *Client) ListStorageClasses(params *ListStorageClassesParams, opts ...ClientOption) (*ListStorageClassesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListStorageClassesParams() - } - op := &runtime.ClientOperation{ - ID: "ListStorageClasses", - Method: "POST", - PathPattern: "/v1/management/DBaaS/Kubernetes/StorageClasses/List", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListStorageClassesReader{formats: a.formats}, - 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.(*ListStorageClassesOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*ListStorageClassesDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -RegisterKubernetesCluster registers kubernetes cluster registers an existing kubernetes cluster in PMM -*/ -func (a *Client) RegisterKubernetesCluster(params *RegisterKubernetesClusterParams, opts ...ClientOption) (*RegisterKubernetesClusterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewRegisterKubernetesClusterParams() - } - op := &runtime.ClientOperation{ - ID: "RegisterKubernetesCluster", - Method: "POST", - PathPattern: "/v1/management/DBaaS/Kubernetes/Register", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*RegisterKubernetesClusterOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*RegisterKubernetesClusterDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -UnregisterKubernetesCluster unregisters kubernetes cluster removes a registered kubernetes cluster from PMM -*/ -func (a *Client) UnregisterKubernetesCluster(params *UnregisterKubernetesClusterParams, opts ...ClientOption) (*UnregisterKubernetesClusterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUnregisterKubernetesClusterParams() - } - op := &runtime.ClientOperation{ - ID: "UnregisterKubernetesCluster", - Method: "POST", - PathPattern: "/v1/management/DBaaS/Kubernetes/Unregister", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*UnregisterKubernetesClusterOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*UnregisterKubernetesClusterDefault) - 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/managementpb/dbaas/json/client/kubernetes/list_kubernetes_clusters_parameters.go b/api/managementpb/dbaas/json/client/kubernetes/list_kubernetes_clusters_parameters.go deleted file mode 100644 index fc2546bdc7..0000000000 --- a/api/managementpb/dbaas/json/client/kubernetes/list_kubernetes_clusters_parameters.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package kubernetes - -// 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" -) - -// 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 { - return &ListKubernetesClustersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListKubernetesClustersParamsWithTimeout creates a new ListKubernetesClustersParams object -// with the ability to set a timeout on a request. -func NewListKubernetesClustersParamsWithTimeout(timeout time.Duration) *ListKubernetesClustersParams { - return &ListKubernetesClustersParams{ - timeout: timeout, - } -} - -// NewListKubernetesClustersParamsWithContext creates a new ListKubernetesClustersParams object -// with the ability to set a context for a request. -func NewListKubernetesClustersParamsWithContext(ctx context.Context) *ListKubernetesClustersParams { - return &ListKubernetesClustersParams{ - Context: ctx, - } -} - -// NewListKubernetesClustersParamsWithHTTPClient creates a new ListKubernetesClustersParams object -// with the ability to set a custom HTTPClient for a request. -func NewListKubernetesClustersParamsWithHTTPClient(client *http.Client) *ListKubernetesClustersParams { - 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. -*/ -type ListKubernetesClustersParams struct { - // Body. - Body interface{} - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the list kubernetes clusters params -func (o *ListKubernetesClustersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list kubernetes clusters params -func (o *ListKubernetesClustersParams) WithContext(ctx context.Context) *ListKubernetesClustersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list kubernetes clusters params -func (o *ListKubernetesClustersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list kubernetes clusters params -func (o *ListKubernetesClustersParams) WithHTTPClient(client *http.Client) *ListKubernetesClustersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list kubernetes clusters params -func (o *ListKubernetesClustersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the list kubernetes clusters params -func (o *ListKubernetesClustersParams) WithBody(body interface{}) *ListKubernetesClustersParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the list kubernetes clusters params -func (o *ListKubernetesClustersParams) SetBody(body interface{}) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ListKubernetesClustersParams) 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/managementpb/dbaas/json/client/kubernetes/list_kubernetes_clusters_responses.go b/api/managementpb/dbaas/json/client/kubernetes/list_kubernetes_clusters_responses.go deleted file mode 100644 index 7a4ccd0ab3..0000000000 --- a/api/managementpb/dbaas/json/client/kubernetes/list_kubernetes_clusters_responses.go +++ /dev/null @@ -1,1002 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package kubernetes - -// 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" -) - -// ListKubernetesClustersReader is a Reader for the ListKubernetesClusters structure. -type ListKubernetesClustersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListKubernetesClustersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListKubernetesClustersOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListKubernetesClustersDefault(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 - } -} - -// NewListKubernetesClustersOK creates a ListKubernetesClustersOK with default headers values -func NewListKubernetesClustersOK() *ListKubernetesClustersOK { - return &ListKubernetesClustersOK{} -} - -/* -ListKubernetesClustersOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListKubernetesClustersOK struct { - Payload *ListKubernetesClustersOKBody -} - -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 -} - -func (o *ListKubernetesClustersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListKubernetesClustersOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListKubernetesClustersDefault creates a ListKubernetesClustersDefault with default headers values -func NewListKubernetesClustersDefault(code int) *ListKubernetesClustersDefault { - return &ListKubernetesClustersDefault{ - _statusCode: code, - } -} - -/* -ListKubernetesClustersDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListKubernetesClustersDefault struct { - _statusCode int - - Payload *ListKubernetesClustersDefaultBody -} - -// Code gets the status code for the list kubernetes clusters default response -func (o *ListKubernetesClustersDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *ListKubernetesClustersDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListKubernetesClustersDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ListKubernetesClustersDefaultBody list kubernetes clusters default body -swagger:model ListKubernetesClustersDefaultBody -*/ -type ListKubernetesClustersDefaultBody struct { - // 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 { - // at type - AtType string `json:"@type,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 ListKubernetesClustersOKBodyKubernetesClustersItems0 -*/ -type ListKubernetesClustersOKBodyKubernetesClustersItems0 struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // KubernetesClusterStatus defines status of Kubernetes cluster. - // - // - KUBERNETES_CLUSTER_STATUS_INVALID: KUBERNETES_CLUSTER_STATUS_INVALID represents unknown state. - // - KUBERNETES_CLUSTER_STATUS_OK: KUBERNETES_CLUSTER_STATUS_OK represents that Kubernetes cluster is accessible. - // - KUBERNETES_CLUSTER_STATUS_UNAVAILABLE: KUBERNETES_CLUSTER_STATUS_UNAVAILABLE represents that Kubernetes cluster is not accessible. - // - KUBERNETES_CLUSTER_STATUS_PROVISIONING: KUBERNETES_CLUSTER_STATUS_PROVISIONING represents that Kubernetes cluster is privisioning. - // Enum: [KUBERNETES_CLUSTER_STATUS_INVALID KUBERNETES_CLUSTER_STATUS_OK KUBERNETES_CLUSTER_STATUS_UNAVAILABLE KUBERNETES_CLUSTER_STATUS_PROVISIONING] - Status *string `json:"status,omitempty"` - - // operators - Operators *ListKubernetesClustersOKBodyKubernetesClustersItems0Operators `json:"operators,omitempty"` -} - -// 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 { - res = append(res, err) - } - - if err := o.validateOperators(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listKubernetesClustersOkBodyKubernetesClustersItems0TypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["KUBERNETES_CLUSTER_STATUS_INVALID","KUBERNETES_CLUSTER_STATUS_OK","KUBERNETES_CLUSTER_STATUS_UNAVAILABLE","KUBERNETES_CLUSTER_STATUS_PROVISIONING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listKubernetesClustersOkBodyKubernetesClustersItems0TypeStatusPropEnum = append(listKubernetesClustersOkBodyKubernetesClustersItems0TypeStatusPropEnum, v) - } -} - -const ( - - // ListKubernetesClustersOKBodyKubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSINVALID captures enum value "KUBERNETES_CLUSTER_STATUS_INVALID" - ListKubernetesClustersOKBodyKubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSINVALID string = "KUBERNETES_CLUSTER_STATUS_INVALID" - - // ListKubernetesClustersOKBodyKubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSOK captures enum value "KUBERNETES_CLUSTER_STATUS_OK" - ListKubernetesClustersOKBodyKubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSOK string = "KUBERNETES_CLUSTER_STATUS_OK" - - // ListKubernetesClustersOKBodyKubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSUNAVAILABLE captures enum value "KUBERNETES_CLUSTER_STATUS_UNAVAILABLE" - ListKubernetesClustersOKBodyKubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSUNAVAILABLE string = "KUBERNETES_CLUSTER_STATUS_UNAVAILABLE" - - // ListKubernetesClustersOKBodyKubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSPROVISIONING captures enum value "KUBERNETES_CLUSTER_STATUS_PROVISIONING" - ListKubernetesClustersOKBodyKubernetesClustersItems0StatusKUBERNETESCLUSTERSTATUSPROVISIONING string = "KUBERNETES_CLUSTER_STATUS_PROVISIONING" -) - -// prop value enum -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 *ListKubernetesClustersOKBodyKubernetesClustersItems0) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -func (o *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 -} - -// 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 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.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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0) UnmarshalBinary(b []byte) error { - var res ListKubernetesClustersOKBodyKubernetesClustersItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListKubernetesClustersOKBodyKubernetesClustersItems0Operators Operators contains list of operators installed in Kubernetes cluster. -swagger:model ListKubernetesClustersOKBodyKubernetesClustersItems0Operators -*/ -type ListKubernetesClustersOKBodyKubernetesClustersItems0Operators struct { - // dbaas - Dbaas *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaas `json:"dbaas,omitempty"` - - // psmdb - PSMDB *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB `json:"psmdb,omitempty"` - - // pxc - PXC *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC `json:"pxc,omitempty"` -} - -// 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.validateDbaas(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePSMDB(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePXC(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0Operators) validateDbaas(formats strfmt.Registry) error { - if swag.IsZero(o.Dbaas) { // not required - return nil - } - - if o.Dbaas != nil { - if err := o.Dbaas.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operators" + "." + "dbaas") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operators" + "." + "dbaas") - } - return err - } - } - - return nil -} - -func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0Operators) validatePSMDB(formats strfmt.Registry) error { - if swag.IsZero(o.PSMDB) { // not required - return nil - } - - if o.PSMDB != nil { - 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 - } - } - - return nil -} - -func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0Operators) validatePXC(formats strfmt.Registry) error { - if swag.IsZero(o.PXC) { // not required - return nil - } - - if o.PXC != nil { - 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.contextValidateDbaas(ctx, formats); err != nil { - res = append(res, err) - } - - 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) contextValidateDbaas(ctx context.Context, formats strfmt.Registry) error { - if o.Dbaas != nil { - if err := o.Dbaas.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operators" + "." + "dbaas") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operators" + "." + "dbaas") - } - return err - } - } - - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0Operators) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0Operators) UnmarshalBinary(b []byte) error { - var res ListKubernetesClustersOKBodyKubernetesClustersItems0Operators - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaas Operator contains all information about operator installed in Kubernetes cluster. -swagger:model ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaas -*/ -type ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaas struct { - // OperatorsStatus defines status of operators installed in Kubernetes cluster. - // - // - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state. - // - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version. - // - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version. - // - 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 list kubernetes clusters OK body kubernetes clusters items0 operators dbaas -func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaas) 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 listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsDbaasTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["OPERATORS_STATUS_INVALID","OPERATORS_STATUS_OK","OPERATORS_STATUS_UNSUPPORTED","OPERATORS_STATUS_NOT_INSTALLED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsDbaasTypeStatusPropEnum = append(listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsDbaasTypeStatusPropEnum, v) - } -} - -const ( - - // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaasStatusOPERATORSSTATUSINVALID captures enum value "OPERATORS_STATUS_INVALID" - ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaasStatusOPERATORSSTATUSINVALID string = "OPERATORS_STATUS_INVALID" - - // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaasStatusOPERATORSSTATUSOK captures enum value "OPERATORS_STATUS_OK" - ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaasStatusOPERATORSSTATUSOK string = "OPERATORS_STATUS_OK" - - // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaasStatusOPERATORSSTATUSUNSUPPORTED captures enum value "OPERATORS_STATUS_UNSUPPORTED" - ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaasStatusOPERATORSSTATUSUNSUPPORTED string = "OPERATORS_STATUS_UNSUPPORTED" - - // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaasStatusOPERATORSSTATUSNOTINSTALLED captures enum value "OPERATORS_STATUS_NOT_INSTALLED" - ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaasStatusOPERATORSSTATUSNOTINSTALLED string = "OPERATORS_STATUS_NOT_INSTALLED" -) - -// prop value enum -func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaas) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsDbaasTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaas) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("operators"+"."+"dbaas"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list kubernetes clusters OK body kubernetes clusters items0 operators dbaas based on context it is used -func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaas) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaas) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaas) UnmarshalBinary(b []byte) error { - var res ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsDbaas - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB Operator contains all information about operator installed in Kubernetes cluster. -swagger:model ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB -*/ -type ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB struct { - // OperatorsStatus defines status of operators installed in Kubernetes cluster. - // - // - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state. - // - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version. - // - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version. - // - 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 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 { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsPsmdbTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["OPERATORS_STATUS_INVALID","OPERATORS_STATUS_OK","OPERATORS_STATUS_UNSUPPORTED","OPERATORS_STATUS_NOT_INSTALLED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsPsmdbTypeStatusPropEnum = append(listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsPsmdbTypeStatusPropEnum, v) - } -} - -const ( - - // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSINVALID captures enum value "OPERATORS_STATUS_INVALID" - ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSINVALID string = "OPERATORS_STATUS_INVALID" - - // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSOK captures enum value "OPERATORS_STATUS_OK" - ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSOK string = "OPERATORS_STATUS_OK" - - // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSUNSUPPORTED captures enum value "OPERATORS_STATUS_UNSUPPORTED" - ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSUNSUPPORTED string = "OPERATORS_STATUS_UNSUPPORTED" - - // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSNOTINSTALLED captures enum value "OPERATORS_STATUS_NOT_INSTALLED" - ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDBStatusOPERATORSSTATUSNOTINSTALLED string = "OPERATORS_STATUS_NOT_INSTALLED" -) - -// prop value enum -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 *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("operators"+"."+"psmdb"+"."+"status", "body", *o.Status); err != nil { - return err - } - - 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 *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB) UnmarshalBinary(b []byte) error { - var res ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPSMDB - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC Operator contains all information about operator installed in Kubernetes cluster. -swagger:model ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC -*/ -type ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC struct { - // OperatorsStatus defines status of operators installed in Kubernetes cluster. - // - // - OPERATORS_STATUS_INVALID: OPERATORS_STATUS_INVALID represents unknown state. - // - OPERATORS_STATUS_OK: OPERATORS_STATUS_OK represents that operators are installed and have supported API version. - // - OPERATORS_STATUS_UNSUPPORTED: OPERATORS_STATUS_UNSUPPORTED represents that operators are installed, but doesn't have supported API version. - // - 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 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 { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsPxcTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["OPERATORS_STATUS_INVALID","OPERATORS_STATUS_OK","OPERATORS_STATUS_UNSUPPORTED","OPERATORS_STATUS_NOT_INSTALLED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsPxcTypeStatusPropEnum = append(listKubernetesClustersOkBodyKubernetesClustersItems0OperatorsPxcTypeStatusPropEnum, v) - } -} - -const ( - - // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSINVALID captures enum value "OPERATORS_STATUS_INVALID" - ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSINVALID string = "OPERATORS_STATUS_INVALID" - - // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSOK captures enum value "OPERATORS_STATUS_OK" - ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSOK string = "OPERATORS_STATUS_OK" - - // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSUNSUPPORTED captures enum value "OPERATORS_STATUS_UNSUPPORTED" - ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSUNSUPPORTED string = "OPERATORS_STATUS_UNSUPPORTED" - - // ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSNOTINSTALLED captures enum value "OPERATORS_STATUS_NOT_INSTALLED" - ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXCStatusOPERATORSSTATUSNOTINSTALLED string = "OPERATORS_STATUS_NOT_INSTALLED" -) - -// prop value enum -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 *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - // value enum - if err := o.validateStatusEnum("operators"+"."+"pxc"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -// 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 *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC) UnmarshalBinary(b []byte) error { - var res ListKubernetesClustersOKBodyKubernetesClustersItems0OperatorsPXC - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/dbaas/json/client/kubernetes/list_storage_classes_parameters.go b/api/managementpb/dbaas/json/client/kubernetes/list_storage_classes_parameters.go deleted file mode 100644 index 4b58b8cdfa..0000000000 --- a/api/managementpb/dbaas/json/client/kubernetes/list_storage_classes_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package kubernetes - -// 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" -) - -// NewListStorageClassesParams creates a new ListStorageClassesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListStorageClassesParams() *ListStorageClassesParams { - return &ListStorageClassesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListStorageClassesParamsWithTimeout creates a new ListStorageClassesParams object -// with the ability to set a timeout on a request. -func NewListStorageClassesParamsWithTimeout(timeout time.Duration) *ListStorageClassesParams { - return &ListStorageClassesParams{ - timeout: timeout, - } -} - -// NewListStorageClassesParamsWithContext creates a new ListStorageClassesParams object -// with the ability to set a context for a request. -func NewListStorageClassesParamsWithContext(ctx context.Context) *ListStorageClassesParams { - return &ListStorageClassesParams{ - Context: ctx, - } -} - -// NewListStorageClassesParamsWithHTTPClient creates a new ListStorageClassesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListStorageClassesParamsWithHTTPClient(client *http.Client) *ListStorageClassesParams { - return &ListStorageClassesParams{ - HTTPClient: client, - } -} - -/* -ListStorageClassesParams contains all the parameters to send to the API endpoint - - for the list storage classes operation. - - Typically these are written to a http.Request. -*/ -type ListStorageClassesParams struct { - // Body. - Body ListStorageClassesBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list storage classes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListStorageClassesParams) WithDefaults() *ListStorageClassesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list storage classes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListStorageClassesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list storage classes params -func (o *ListStorageClassesParams) WithTimeout(timeout time.Duration) *ListStorageClassesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list storage classes params -func (o *ListStorageClassesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list storage classes params -func (o *ListStorageClassesParams) WithContext(ctx context.Context) *ListStorageClassesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list storage classes params -func (o *ListStorageClassesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list storage classes params -func (o *ListStorageClassesParams) WithHTTPClient(client *http.Client) *ListStorageClassesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list storage classes params -func (o *ListStorageClassesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the list storage classes params -func (o *ListStorageClassesParams) WithBody(body ListStorageClassesBody) *ListStorageClassesParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the list storage classes params -func (o *ListStorageClassesParams) SetBody(body ListStorageClassesBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ListStorageClassesParams) 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/managementpb/dbaas/json/client/kubernetes/list_storage_classes_responses.go b/api/managementpb/dbaas/json/client/kubernetes/list_storage_classes_responses.go deleted file mode 100644 index fa8509dbec..0000000000 --- a/api/managementpb/dbaas/json/client/kubernetes/list_storage_classes_responses.go +++ /dev/null @@ -1,334 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package kubernetes - -// 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" -) - -// ListStorageClassesReader is a Reader for the ListStorageClasses structure. -type ListStorageClassesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListStorageClassesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListStorageClassesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListStorageClassesDefault(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 - } -} - -// NewListStorageClassesOK creates a ListStorageClassesOK with default headers values -func NewListStorageClassesOK() *ListStorageClassesOK { - return &ListStorageClassesOK{} -} - -/* -ListStorageClassesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListStorageClassesOK struct { - Payload *ListStorageClassesOKBody -} - -func (o *ListStorageClassesOK) Error() string { - return fmt.Sprintf("[POST /v1/management/DBaaS/Kubernetes/StorageClasses/List][%d] listStorageClassesOk %+v", 200, o.Payload) -} - -func (o *ListStorageClassesOK) GetPayload() *ListStorageClassesOKBody { - return o.Payload -} - -func (o *ListStorageClassesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListStorageClassesOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListStorageClassesDefault creates a ListStorageClassesDefault with default headers values -func NewListStorageClassesDefault(code int) *ListStorageClassesDefault { - return &ListStorageClassesDefault{ - _statusCode: code, - } -} - -/* -ListStorageClassesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListStorageClassesDefault struct { - _statusCode int - - Payload *ListStorageClassesDefaultBody -} - -// Code gets the status code for the list storage classes default response -func (o *ListStorageClassesDefault) Code() int { - return o._statusCode -} - -func (o *ListStorageClassesDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/DBaaS/Kubernetes/StorageClasses/List][%d] ListStorageClasses default %+v", o._statusCode, o.Payload) -} - -func (o *ListStorageClassesDefault) GetPayload() *ListStorageClassesDefaultBody { - return o.Payload -} - -func (o *ListStorageClassesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListStorageClassesDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ListStorageClassesBody list storage classes body -swagger:model ListStorageClassesBody -*/ -type ListStorageClassesBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` -} - -// Validate validates this list storage classes body -func (o *ListStorageClassesBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list storage classes body based on context it is used -func (o *ListStorageClassesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListStorageClassesBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListStorageClassesBody) UnmarshalBinary(b []byte) error { - var res ListStorageClassesBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListStorageClassesDefaultBody list storage classes default body -swagger:model ListStorageClassesDefaultBody -*/ -type ListStorageClassesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListStorageClassesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list storage classes default body -func (o *ListStorageClassesDefaultBody) 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 *ListStorageClassesDefaultBody) 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("ListStorageClasses default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ListStorageClasses default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this list storage classes default body based on the context it is used -func (o *ListStorageClassesDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateDetails(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListStorageClassesDefaultBody) 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("ListStorageClasses default" + "." + "details" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ListStorageClasses default" + "." + "details" + "." + strconv.Itoa(i)) - } - return err - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListStorageClassesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListStorageClassesDefaultBody) UnmarshalBinary(b []byte) error { - var res ListStorageClassesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListStorageClassesDefaultBodyDetailsItems0 list storage classes default body details items0 -swagger:model ListStorageClassesDefaultBodyDetailsItems0 -*/ -type ListStorageClassesDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// Validate validates this list storage classes default body details items0 -func (o *ListStorageClassesDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list storage classes default body details items0 based on context it is used -func (o *ListStorageClassesDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListStorageClassesDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListStorageClassesDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { - var res ListStorageClassesDefaultBodyDetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListStorageClassesOKBody list storage classes OK body -swagger:model ListStorageClassesOKBody -*/ -type ListStorageClassesOKBody struct { - // Kubernetes storage classes names. - StorageClasses []string `json:"storage_classes"` -} - -// Validate validates this list storage classes OK body -func (o *ListStorageClassesOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list storage classes OK body based on context it is used -func (o *ListStorageClassesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListStorageClassesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListStorageClassesOKBody) UnmarshalBinary(b []byte) error { - var res ListStorageClassesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} 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 deleted file mode 100644 index c672e66248..0000000000 --- a/api/managementpb/dbaas/json/client/kubernetes/register_kubernetes_cluster_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package kubernetes - -// 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" -) - -// 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 { - return &RegisterKubernetesClusterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewRegisterKubernetesClusterParamsWithTimeout creates a new RegisterKubernetesClusterParams object -// with the ability to set a timeout on a request. -func NewRegisterKubernetesClusterParamsWithTimeout(timeout time.Duration) *RegisterKubernetesClusterParams { - return &RegisterKubernetesClusterParams{ - timeout: timeout, - } -} - -// NewRegisterKubernetesClusterParamsWithContext creates a new RegisterKubernetesClusterParams object -// with the ability to set a context for a request. -func NewRegisterKubernetesClusterParamsWithContext(ctx context.Context) *RegisterKubernetesClusterParams { - return &RegisterKubernetesClusterParams{ - Context: ctx, - } -} - -// NewRegisterKubernetesClusterParamsWithHTTPClient creates a new RegisterKubernetesClusterParams object -// with the ability to set a custom HTTPClient for a request. -func NewRegisterKubernetesClusterParamsWithHTTPClient(client *http.Client) *RegisterKubernetesClusterParams { - 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. -*/ -type RegisterKubernetesClusterParams struct { - // Body. - Body RegisterKubernetesClusterBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the register kubernetes cluster params -func (o *RegisterKubernetesClusterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the register kubernetes cluster params -func (o *RegisterKubernetesClusterParams) WithContext(ctx context.Context) *RegisterKubernetesClusterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the register kubernetes cluster params -func (o *RegisterKubernetesClusterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the register kubernetes cluster params -func (o *RegisterKubernetesClusterParams) WithHTTPClient(client *http.Client) *RegisterKubernetesClusterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the register kubernetes cluster params -func (o *RegisterKubernetesClusterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the register kubernetes cluster params -func (o *RegisterKubernetesClusterParams) WithBody(body RegisterKubernetesClusterBody) *RegisterKubernetesClusterParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the register kubernetes cluster params -func (o *RegisterKubernetesClusterParams) SetBody(body RegisterKubernetesClusterBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *RegisterKubernetesClusterParams) 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/managementpb/dbaas/json/client/kubernetes/register_kubernetes_cluster_responses.go b/api/managementpb/dbaas/json/client/kubernetes/register_kubernetes_cluster_responses.go deleted file mode 100644 index 019fabe844..0000000000 --- a/api/managementpb/dbaas/json/client/kubernetes/register_kubernetes_cluster_responses.go +++ /dev/null @@ -1,393 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package kubernetes - -// 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" -) - -// RegisterKubernetesClusterReader is a Reader for the RegisterKubernetesCluster structure. -type RegisterKubernetesClusterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *RegisterKubernetesClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewRegisterKubernetesClusterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewRegisterKubernetesClusterDefault(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 - } -} - -// NewRegisterKubernetesClusterOK creates a RegisterKubernetesClusterOK with default headers values -func NewRegisterKubernetesClusterOK() *RegisterKubernetesClusterOK { - return &RegisterKubernetesClusterOK{} -} - -/* -RegisterKubernetesClusterOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type RegisterKubernetesClusterOK struct { - Payload interface{} -} - -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 -} - -func (o *RegisterKubernetesClusterOK) 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 -} - -// NewRegisterKubernetesClusterDefault creates a RegisterKubernetesClusterDefault with default headers values -func NewRegisterKubernetesClusterDefault(code int) *RegisterKubernetesClusterDefault { - return &RegisterKubernetesClusterDefault{ - _statusCode: code, - } -} - -/* -RegisterKubernetesClusterDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type RegisterKubernetesClusterDefault struct { - _statusCode int - - Payload *RegisterKubernetesClusterDefaultBody -} - -// Code gets the status code for the register kubernetes cluster default response -func (o *RegisterKubernetesClusterDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *RegisterKubernetesClusterDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(RegisterKubernetesClusterDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -RegisterKubernetesClusterBody register kubernetes cluster body -swagger:model RegisterKubernetesClusterBody -*/ -type RegisterKubernetesClusterBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // AWS access key id, only needed when registering EKS cluster and kubeconfig does not contain it. - AWSAccessKeyID string `json:"aws_access_key_id,omitempty"` - - // AWS secret access key, only needed when registering EKS cluster and kubeconfig does not contain it. - AWSSecretAccessKey string `json:"aws_secret_access_key,omitempty"` - - // kube auth - KubeAuth *RegisterKubernetesClusterParamsBodyKubeAuth `json:"kube_auth,omitempty"` -} - -// Validate validates this register kubernetes cluster body -func (o *RegisterKubernetesClusterBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateKubeAuth(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *RegisterKubernetesClusterBody) validateKubeAuth(formats strfmt.Registry) error { - if swag.IsZero(o.KubeAuth) { // not required - return nil - } - - if o.KubeAuth != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *RegisterKubernetesClusterBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RegisterKubernetesClusterBody) UnmarshalBinary(b []byte) error { - var res RegisterKubernetesClusterBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -RegisterKubernetesClusterDefaultBody register kubernetes cluster default body -swagger:model RegisterKubernetesClusterDefaultBody -*/ -type RegisterKubernetesClusterDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*RegisterKubernetesClusterDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this register kubernetes cluster default body -func (o *RegisterKubernetesClusterDefaultBody) 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 *RegisterKubernetesClusterDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *RegisterKubernetesClusterDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RegisterKubernetesClusterDefaultBody) UnmarshalBinary(b []byte) error { - var res RegisterKubernetesClusterDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -RegisterKubernetesClusterDefaultBodyDetailsItems0 register kubernetes cluster default body details items0 -swagger:model RegisterKubernetesClusterDefaultBodyDetailsItems0 -*/ -type RegisterKubernetesClusterDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 -*/ -type RegisterKubernetesClusterParamsBodyKubeAuth struct { - // Kubeconfig file content. - Kubeconfig string `json:"kubeconfig,omitempty"` -} - -// Validate validates this register kubernetes cluster params body kube auth -func (o *RegisterKubernetesClusterParamsBodyKubeAuth) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *RegisterKubernetesClusterParamsBodyKubeAuth) UnmarshalBinary(b []byte) error { - var res RegisterKubernetesClusterParamsBodyKubeAuth - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return 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 deleted file mode 100644 index bc66be521f..0000000000 --- a/api/managementpb/dbaas/json/client/kubernetes/unregister_kubernetes_cluster_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package kubernetes - -// 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" -) - -// 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 { - return &UnregisterKubernetesClusterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUnregisterKubernetesClusterParamsWithTimeout creates a new UnregisterKubernetesClusterParams object -// with the ability to set a timeout on a request. -func NewUnregisterKubernetesClusterParamsWithTimeout(timeout time.Duration) *UnregisterKubernetesClusterParams { - return &UnregisterKubernetesClusterParams{ - timeout: timeout, - } -} - -// NewUnregisterKubernetesClusterParamsWithContext creates a new UnregisterKubernetesClusterParams object -// with the ability to set a context for a request. -func NewUnregisterKubernetesClusterParamsWithContext(ctx context.Context) *UnregisterKubernetesClusterParams { - return &UnregisterKubernetesClusterParams{ - Context: ctx, - } -} - -// NewUnregisterKubernetesClusterParamsWithHTTPClient creates a new UnregisterKubernetesClusterParams object -// with the ability to set a custom HTTPClient for a request. -func NewUnregisterKubernetesClusterParamsWithHTTPClient(client *http.Client) *UnregisterKubernetesClusterParams { - 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. -*/ -type UnregisterKubernetesClusterParams struct { - // Body. - Body UnregisterKubernetesClusterBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the unregister kubernetes cluster params -func (o *UnregisterKubernetesClusterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the unregister kubernetes cluster params -func (o *UnregisterKubernetesClusterParams) WithContext(ctx context.Context) *UnregisterKubernetesClusterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the unregister kubernetes cluster params -func (o *UnregisterKubernetesClusterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the unregister kubernetes cluster params -func (o *UnregisterKubernetesClusterParams) WithHTTPClient(client *http.Client) *UnregisterKubernetesClusterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the unregister kubernetes cluster params -func (o *UnregisterKubernetesClusterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the unregister kubernetes cluster params -func (o *UnregisterKubernetesClusterParams) WithBody(body UnregisterKubernetesClusterBody) *UnregisterKubernetesClusterParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the unregister kubernetes cluster params -func (o *UnregisterKubernetesClusterParams) SetBody(body UnregisterKubernetesClusterBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *UnregisterKubernetesClusterParams) 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/managementpb/dbaas/json/client/kubernetes/unregister_kubernetes_cluster_responses.go b/api/managementpb/dbaas/json/client/kubernetes/unregister_kubernetes_cluster_responses.go deleted file mode 100644 index 2429e1e295..0000000000 --- a/api/managementpb/dbaas/json/client/kubernetes/unregister_kubernetes_cluster_responses.go +++ /dev/null @@ -1,299 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package kubernetes - -// 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" -) - -// UnregisterKubernetesClusterReader is a Reader for the UnregisterKubernetesCluster structure. -type UnregisterKubernetesClusterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UnregisterKubernetesClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUnregisterKubernetesClusterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewUnregisterKubernetesClusterDefault(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 - } -} - -// NewUnregisterKubernetesClusterOK creates a UnregisterKubernetesClusterOK with default headers values -func NewUnregisterKubernetesClusterOK() *UnregisterKubernetesClusterOK { - return &UnregisterKubernetesClusterOK{} -} - -/* -UnregisterKubernetesClusterOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type UnregisterKubernetesClusterOK struct { - Payload interface{} -} - -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 -} - -func (o *UnregisterKubernetesClusterOK) 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 -} - -// NewUnregisterKubernetesClusterDefault creates a UnregisterKubernetesClusterDefault with default headers values -func NewUnregisterKubernetesClusterDefault(code int) *UnregisterKubernetesClusterDefault { - return &UnregisterKubernetesClusterDefault{ - _statusCode: code, - } -} - -/* -UnregisterKubernetesClusterDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type UnregisterKubernetesClusterDefault struct { - _statusCode int - - Payload *UnregisterKubernetesClusterDefaultBody -} - -// Code gets the status code for the unregister kubernetes cluster default response -func (o *UnregisterKubernetesClusterDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *UnregisterKubernetesClusterDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(UnregisterKubernetesClusterDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -UnregisterKubernetesClusterBody unregister kubernetes cluster body -swagger:model UnregisterKubernetesClusterBody -*/ -type UnregisterKubernetesClusterBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // If true then Kubernetes cluster will be deleted - // even if it contains database clusters. - Force bool `json:"force,omitempty"` -} - -// Validate validates this unregister kubernetes cluster body -func (o *UnregisterKubernetesClusterBody) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UnregisterKubernetesClusterBody) UnmarshalBinary(b []byte) error { - var res UnregisterKubernetesClusterBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UnregisterKubernetesClusterDefaultBody unregister kubernetes cluster default body -swagger:model UnregisterKubernetesClusterDefaultBody -*/ -type UnregisterKubernetesClusterDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*UnregisterKubernetesClusterDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this unregister kubernetes cluster default body -func (o *UnregisterKubernetesClusterDefaultBody) 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 *UnregisterKubernetesClusterDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UnregisterKubernetesClusterDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UnregisterKubernetesClusterDefaultBody) UnmarshalBinary(b []byte) error { - var res UnregisterKubernetesClusterDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UnregisterKubernetesClusterDefaultBodyDetailsItems0 unregister kubernetes cluster default body details items0 -swagger:model UnregisterKubernetesClusterDefaultBodyDetailsItems0 -*/ -type UnregisterKubernetesClusterDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 deleted file mode 100644 index 66f2f1ca9d..0000000000 --- a/api/managementpb/dbaas/json/client/logs_api/get_logs_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package logs_api - -// 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" -) - -// NewGetLogsParams creates a new GetLogsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetLogsParams() *GetLogsParams { - return &GetLogsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetLogsParamsWithTimeout creates a new GetLogsParams object -// with the ability to set a timeout on a request. -func NewGetLogsParamsWithTimeout(timeout time.Duration) *GetLogsParams { - return &GetLogsParams{ - timeout: timeout, - } -} - -// NewGetLogsParamsWithContext creates a new GetLogsParams object -// with the ability to set a context for a request. -func NewGetLogsParamsWithContext(ctx context.Context) *GetLogsParams { - return &GetLogsParams{ - Context: ctx, - } -} - -// NewGetLogsParamsWithHTTPClient creates a new GetLogsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetLogsParamsWithHTTPClient(client *http.Client) *GetLogsParams { - return &GetLogsParams{ - HTTPClient: client, - } -} - -/* -GetLogsParams contains all the parameters to send to the API endpoint - - for the get logs operation. - - Typically these are written to a http.Request. -*/ -type GetLogsParams struct { - // Body. - Body GetLogsBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get logs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetLogsParams) WithDefaults() *GetLogsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get logs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetLogsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get logs params -func (o *GetLogsParams) WithTimeout(timeout time.Duration) *GetLogsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get logs params -func (o *GetLogsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get logs params -func (o *GetLogsParams) WithContext(ctx context.Context) *GetLogsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get logs params -func (o *GetLogsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get logs params -func (o *GetLogsParams) WithHTTPClient(client *http.Client) *GetLogsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get logs params -func (o *GetLogsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get logs params -func (o *GetLogsParams) WithBody(body GetLogsBody) *GetLogsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get logs params -func (o *GetLogsParams) SetBody(body GetLogsBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetLogsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} 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 deleted file mode 100644 index 21d5f7525a..0000000000 --- a/api/managementpb/dbaas/json/client/logs_api/get_logs_responses.go +++ /dev/null @@ -1,443 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package logs_api - -// 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" -) - -// GetLogsReader is a Reader for the GetLogs structure. -type GetLogsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetLogsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetLogsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetLogsDefault(response.Code()) - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - if response.Code()/100 == 2 { - return result, nil - } - return nil, result - } -} - -// NewGetLogsOK creates a GetLogsOK with default headers values -func NewGetLogsOK() *GetLogsOK { - return &GetLogsOK{} -} - -/* -GetLogsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetLogsOK struct { - Payload *GetLogsOKBody -} - -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 -} - -func (o *GetLogsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetLogsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetLogsDefault creates a GetLogsDefault with default headers values -func NewGetLogsDefault(code int) *GetLogsDefault { - return &GetLogsDefault{ - _statusCode: code, - } -} - -/* -GetLogsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetLogsDefault struct { - _statusCode int - - Payload *GetLogsDefaultBody -} - -// Code gets the status code for the get logs default response -func (o *GetLogsDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *GetLogsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetLogsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -GetLogsBody get logs body -swagger:model GetLogsBody -*/ -type GetLogsBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // DB cluster name. - ClusterName string `json:"cluster_name,omitempty"` -} - -// Validate validates this get logs body -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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetLogsBody) UnmarshalBinary(b []byte) error { - var res GetLogsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetLogsDefaultBody get logs default body -swagger:model GetLogsDefaultBody -*/ -type GetLogsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetLogsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get logs default body -func (o *GetLogsDefaultBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateDetails(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetLogsDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required - return nil - } - - for i := 0; i < len(o.Details); i++ { - if swag.IsZero(o.Details[i]) { // not required - continue - } - - if o.Details[i] != nil { - if err := o.Details[i].Validate(formats); err != nil { - 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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetLogsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetLogsDefaultBody) UnmarshalBinary(b []byte) error { - var res GetLogsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetLogsDefaultBodyDetailsItems0 get logs default body details items0 -swagger:model GetLogsDefaultBodyDetailsItems0 -*/ -type GetLogsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// 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 { - // Log represents list of logs. Each entry contains either container's logs or, - // when container field is empty, pod's events. - Logs []*GetLogsOKBodyLogsItems0 `json:"logs"` -} - -// Validate validates this get logs OK body -func (o *GetLogsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateLogs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetLogsOKBody) validateLogs(formats strfmt.Registry) error { - if swag.IsZero(o.Logs) { // not required - return nil - } - - for i := 0; i < len(o.Logs); i++ { - if swag.IsZero(o.Logs[i]) { // not required - continue - } - - if o.Logs[i] != nil { - if err := o.Logs[i].Validate(formats); err != nil { - 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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetLogsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetLogsOKBody) UnmarshalBinary(b []byte) error { - var res GetLogsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetLogsOKBodyLogsItems0 Logs contain logs for certain pod's container. If container is an empty -// string, logs contain pod's events. -swagger:model GetLogsOKBodyLogsItems0 -*/ -type GetLogsOKBodyLogsItems0 struct { - // Pod name. - Pod string `json:"pod,omitempty"` - - // Container name. - Container string `json:"container,omitempty"` - - // Content of container's log or pod's events. - Logs []string `json:"logs"` -} - -// Validate validates this get logs OK body logs items0 -func (o *GetLogsOKBodyLogsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get logs OK body logs items0 based on context it is used -func (o *GetLogsOKBodyLogsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetLogsOKBodyLogsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetLogsOKBodyLogsItems0) UnmarshalBinary(b []byte) error { - var res GetLogsOKBodyLogsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/dbaas/json/client/logs_api/logs_api_client.go b/api/managementpb/dbaas/json/client/logs_api/logs_api_client.go deleted file mode 100644 index da9cf3caf6..0000000000 --- a/api/managementpb/dbaas/json/client/logs_api/logs_api_client.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package logs_api - -// 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 logs api API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for logs api 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 { - GetLogs(params *GetLogsParams, opts ...ClientOption) (*GetLogsOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -GetLogs gets logs gets all logs from db cluster -*/ -func (a *Client) GetLogs(params *GetLogsParams, opts ...ClientOption) (*GetLogsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetLogsParams() - } - op := &runtime.ClientOperation{ - ID: "GetLogs", - Method: "POST", - PathPattern: "/v1/management/DBaaS/GetLogs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetLogsReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetLogsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetLogsDefault) - 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/managementpb/dbaas/json/client/pmm_d_baa_s_api_client.go b/api/managementpb/dbaas/json/client/pmm_d_baa_s_api_client.go deleted file mode 100644 index 6372c4a232..0000000000 --- a/api/managementpb/dbaas/json/client/pmm_d_baa_s_api_client.go +++ /dev/null @@ -1,142 +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/managementpb/dbaas/json/client/components" - "github.com/percona/pmm/api/managementpb/dbaas/json/client/db_clusters" - "github.com/percona/pmm/api/managementpb/dbaas/json/client/kubernetes" - "github.com/percona/pmm/api/managementpb/dbaas/json/client/logs_api" - "github.com/percona/pmm/api/managementpb/dbaas/json/client/psmdb_clusters" - "github.com/percona/pmm/api/managementpb/dbaas/json/client/pxc_clusters" - "github.com/percona/pmm/api/managementpb/dbaas/json/client/templates" -) - -// Default PMM d baa s 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 d baa s API HTTP client. -func NewHTTPClient(formats strfmt.Registry) *PMMDBaaSAPI { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new PMM d baa s API HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMDBaaSAPI { - // 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 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(PMMDBaaSAPI) - cli.Transport = transport - cli.Components = components.New(transport, formats) - cli.DBClusters = db_clusters.New(transport, formats) - cli.Kubernetes = kubernetes.New(transport, formats) - cli.LogsAPI = logs_api.New(transport, formats) - cli.PSMDBClusters = psmdb_clusters.New(transport, formats) - cli.PXCClusters = pxc_clusters.New(transport, formats) - cli.Templates = templates.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 -} - -// PMMDBaaSAPI is a client for PMM d baa s API -type PMMDBaaSAPI struct { - Components components.ClientService - - DBClusters db_clusters.ClientService - - Kubernetes kubernetes.ClientService - - LogsAPI logs_api.ClientService - - PSMDBClusters psmdb_clusters.ClientService - - PXCClusters pxc_clusters.ClientService - - Templates templates.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *PMMDBaaSAPI) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.Components.SetTransport(transport) - c.DBClusters.SetTransport(transport) - c.Kubernetes.SetTransport(transport) - c.LogsAPI.SetTransport(transport) - c.PSMDBClusters.SetTransport(transport) - c.PXCClusters.SetTransport(transport) - c.Templates.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 deleted file mode 100644 index 0998427faa..0000000000 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/create_psmdb_cluster_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package psmdb_clusters - -// 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" -) - -// 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 { - return &CreatePSMDBClusterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreatePSMDBClusterParamsWithTimeout creates a new CreatePSMDBClusterParams object -// with the ability to set a timeout on a request. -func NewCreatePSMDBClusterParamsWithTimeout(timeout time.Duration) *CreatePSMDBClusterParams { - return &CreatePSMDBClusterParams{ - timeout: timeout, - } -} - -// NewCreatePSMDBClusterParamsWithContext creates a new CreatePSMDBClusterParams object -// with the ability to set a context for a request. -func NewCreatePSMDBClusterParamsWithContext(ctx context.Context) *CreatePSMDBClusterParams { - return &CreatePSMDBClusterParams{ - Context: ctx, - } -} - -// NewCreatePSMDBClusterParamsWithHTTPClient creates a new CreatePSMDBClusterParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreatePSMDBClusterParamsWithHTTPClient(client *http.Client) *CreatePSMDBClusterParams { - 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. -*/ -type CreatePSMDBClusterParams struct { - // Body. - Body CreatePSMDBClusterBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the create PSMDB cluster params -func (o *CreatePSMDBClusterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create PSMDB cluster params -func (o *CreatePSMDBClusterParams) WithContext(ctx context.Context) *CreatePSMDBClusterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create PSMDB cluster params -func (o *CreatePSMDBClusterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create PSMDB cluster params -func (o *CreatePSMDBClusterParams) WithHTTPClient(client *http.Client) *CreatePSMDBClusterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create PSMDB cluster params -func (o *CreatePSMDBClusterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create PSMDB cluster params -func (o *CreatePSMDBClusterParams) WithBody(body CreatePSMDBClusterBody) *CreatePSMDBClusterParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create PSMDB cluster params -func (o *CreatePSMDBClusterParams) SetBody(body CreatePSMDBClusterBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CreatePSMDBClusterParams) 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/managementpb/dbaas/json/client/psmdb_clusters/create_psmdb_cluster_responses.go b/api/managementpb/dbaas/json/client/psmdb_clusters/create_psmdb_cluster_responses.go deleted file mode 100644 index eff9cb0717..0000000000 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/create_psmdb_cluster_responses.go +++ /dev/null @@ -1,863 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package psmdb_clusters - -// 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" -) - -// CreatePSMDBClusterReader is a Reader for the CreatePSMDBCluster structure. -type CreatePSMDBClusterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreatePSMDBClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreatePSMDBClusterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewCreatePSMDBClusterDefault(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 - } -} - -// NewCreatePSMDBClusterOK creates a CreatePSMDBClusterOK with default headers values -func NewCreatePSMDBClusterOK() *CreatePSMDBClusterOK { - return &CreatePSMDBClusterOK{} -} - -/* -CreatePSMDBClusterOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type CreatePSMDBClusterOK struct { - Payload interface{} -} - -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 -} - -func (o *CreatePSMDBClusterOK) 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 -} - -// NewCreatePSMDBClusterDefault creates a CreatePSMDBClusterDefault with default headers values -func NewCreatePSMDBClusterDefault(code int) *CreatePSMDBClusterDefault { - return &CreatePSMDBClusterDefault{ - _statusCode: code, - } -} - -/* -CreatePSMDBClusterDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type CreatePSMDBClusterDefault struct { - _statusCode int - - Payload *CreatePSMDBClusterDefaultBody -} - -// Code gets the status code for the create PSMDB cluster default response -func (o *CreatePSMDBClusterDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *CreatePSMDBClusterDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(CreatePSMDBClusterDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -CreatePSMDBClusterBody create PSMDB cluster body -swagger:model CreatePSMDBClusterBody -*/ -type CreatePSMDBClusterBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // PSMDB cluster name. - // a DNS-1035 label must consist of lower case alphanumeric characters or '-', - // start with an alphabetic character, and end with an alphanumeric character - // (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?') - Name string `json:"name,omitempty"` - - // Make DB cluster accessible outside of K8s cluster. - Expose bool `json:"expose,omitempty"` - - // Make DB cluster accessible via public internet. - InternetFacing bool `json:"internet_facing,omitempty"` - - // Apply IP source ranges against the cluster. - SourceRanges []string `json:"source_ranges"` - - // params - Params *CreatePSMDBClusterParamsBodyParams `json:"params,omitempty"` - - // template - Template *CreatePSMDBClusterParamsBodyTemplate `json:"template,omitempty"` -} - -// Validate validates this create PSMDB cluster body -func (o *CreatePSMDBClusterBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateParams(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTemplate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePSMDBClusterBody) 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("body" + "." + "params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params") - } - return err - } - } - - return nil -} - -func (o *CreatePSMDBClusterBody) validateTemplate(formats strfmt.Registry) error { - if swag.IsZero(o.Template) { // not required - return nil - } - - if o.Template != nil { - if err := o.Template.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "template") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "template") - } - 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 err := o.contextValidateTemplate(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 - } - } - - return nil -} - -func (o *CreatePSMDBClusterBody) contextValidateTemplate(ctx context.Context, formats strfmt.Registry) error { - if o.Template != nil { - if err := o.Template.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "template") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "template") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePSMDBClusterBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePSMDBClusterBody) UnmarshalBinary(b []byte) error { - var res CreatePSMDBClusterBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePSMDBClusterDefaultBody create PSMDB cluster default body -swagger:model CreatePSMDBClusterDefaultBody -*/ -type CreatePSMDBClusterDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*CreatePSMDBClusterDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this create PSMDB cluster default body -func (o *CreatePSMDBClusterDefaultBody) 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 *CreatePSMDBClusterDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePSMDBClusterDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePSMDBClusterDefaultBody) UnmarshalBinary(b []byte) error { - var res CreatePSMDBClusterDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePSMDBClusterDefaultBodyDetailsItems0 create PSMDB cluster default body details items0 -swagger:model CreatePSMDBClusterDefaultBodyDetailsItems0 -*/ -type CreatePSMDBClusterDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 -*/ -type CreatePSMDBClusterParamsBodyParams struct { - // Cluster size. - ClusterSize int32 `json:"cluster_size,omitempty"` - - // Docker image used for PSMDB. - Image string `json:"image,omitempty"` - - // backup - Backup *CreatePSMDBClusterParamsBodyParamsBackup `json:"backup,omitempty"` - - // replicaset - Replicaset *CreatePSMDBClusterParamsBodyParamsReplicaset `json:"replicaset,omitempty"` - - // restore - Restore *CreatePSMDBClusterParamsBodyParamsRestore `json:"restore,omitempty"` -} - -// Validate validates this create PSMDB cluster params body params -func (o *CreatePSMDBClusterParamsBodyParams) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateBackup(formats); err != nil { - res = append(res, err) - } - - if err := o.validateReplicaset(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRestore(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePSMDBClusterParamsBodyParams) validateBackup(formats strfmt.Registry) error { - if swag.IsZero(o.Backup) { // not required - return nil - } - - if o.Backup != nil { - if err := o.Backup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + "backup") - } - return err - } - } - - return nil -} - -func (o *CreatePSMDBClusterParamsBodyParams) validateReplicaset(formats strfmt.Registry) error { - if swag.IsZero(o.Replicaset) { // not required - return nil - } - - if o.Replicaset != nil { - 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 -} - -func (o *CreatePSMDBClusterParamsBodyParams) validateRestore(formats strfmt.Registry) error { - if swag.IsZero(o.Restore) { // not required - return nil - } - - if o.Restore != nil { - if err := o.Restore.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + "restore") - } - 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.contextValidateBackup(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateReplicaset(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRestore(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePSMDBClusterParamsBodyParams) contextValidateBackup(ctx context.Context, formats strfmt.Registry) error { - if o.Backup != nil { - if err := o.Backup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + "backup") - } - return err - } - } - - 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 - } - } - - return nil -} - -func (o *CreatePSMDBClusterParamsBodyParams) contextValidateRestore(ctx context.Context, formats strfmt.Registry) error { - if o.Restore != nil { - if err := o.Restore.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + "restore") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePSMDBClusterParamsBodyParams) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePSMDBClusterParamsBodyParams) UnmarshalBinary(b []byte) error { - var res CreatePSMDBClusterParamsBodyParams - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePSMDBClusterParamsBodyParamsBackup Backup configuration for a database cluster -swagger:model CreatePSMDBClusterParamsBodyParamsBackup -*/ -type CreatePSMDBClusterParamsBodyParamsBackup struct { - // Backup Location id of stored backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Keep copies represents how many copies should retain. - KeepCopies int32 `json:"keep_copies,omitempty"` - - // Cron expression represents cron expression - CronExpression string `json:"cron_expression,omitempty"` - - // Service acccount used for backups - ServiceAccount string `json:"service_account,omitempty"` -} - -// Validate validates this create PSMDB cluster params body params backup -func (o *CreatePSMDBClusterParamsBodyParamsBackup) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this create PSMDB cluster params body params backup based on context it is used -func (o *CreatePSMDBClusterParamsBodyParamsBackup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePSMDBClusterParamsBodyParamsBackup) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePSMDBClusterParamsBodyParamsBackup) UnmarshalBinary(b []byte) error { - var res CreatePSMDBClusterParamsBodyParamsBackup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePSMDBClusterParamsBodyParamsReplicaset ReplicaSet container parameters. -// TODO Do not use inner messages in all public APIs (for consistency). -swagger:model CreatePSMDBClusterParamsBodyParamsReplicaset -*/ -type CreatePSMDBClusterParamsBodyParamsReplicaset struct { - // Disk size in bytes. - DiskSize string `json:"disk_size,omitempty"` - - // Configuration for PSMDB cluster - Configuration string `json:"configuration,omitempty"` - - // Storage Class for PSMDB cluster. - StorageClass string `json:"storage_class,omitempty"` - - // compute resources - ComputeResources *CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources `json:"compute_resources,omitempty"` -} - -// Validate validates this create PSMDB cluster params body params replicaset -func (o *CreatePSMDBClusterParamsBodyParamsReplicaset) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateComputeResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePSMDBClusterParamsBodyParamsReplicaset) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePSMDBClusterParamsBodyParamsReplicaset) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePSMDBClusterParamsBodyParamsReplicaset) UnmarshalBinary(b []byte) error { - var res CreatePSMDBClusterParamsBodyParamsReplicaset - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources -*/ -type CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// Validate validates this create PSMDB cluster params body params replicaset compute resources -func (o *CreatePSMDBClusterParamsBodyParamsReplicasetComputeResources) Validate(formats strfmt.Registry) error { - return nil -} - -// 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 *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 -} - -/* -CreatePSMDBClusterParamsBodyParamsRestore Restore represents restoration payload to restore a database cluster from backup -swagger:model CreatePSMDBClusterParamsBodyParamsRestore -*/ -type CreatePSMDBClusterParamsBodyParamsRestore struct { - // Backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Destination filename. - Destination string `json:"destination,omitempty"` - - // K8s Secrets name. - SecretsName string `json:"secrets_name,omitempty"` -} - -// Validate validates this create PSMDB cluster params body params restore -func (o *CreatePSMDBClusterParamsBodyParamsRestore) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this create PSMDB cluster params body params restore based on context it is used -func (o *CreatePSMDBClusterParamsBodyParamsRestore) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePSMDBClusterParamsBodyParamsRestore) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePSMDBClusterParamsBodyParamsRestore) UnmarshalBinary(b []byte) error { - var res CreatePSMDBClusterParamsBodyParamsRestore - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePSMDBClusterParamsBodyTemplate create PSMDB cluster params body template -swagger:model CreatePSMDBClusterParamsBodyTemplate -*/ -type CreatePSMDBClusterParamsBodyTemplate struct { - // Template CR name. - Name string `json:"name,omitempty"` - - // Template CR kind. - Kind string `json:"kind,omitempty"` -} - -// Validate validates this create PSMDB cluster params body template -func (o *CreatePSMDBClusterParamsBodyTemplate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this create PSMDB cluster params body template based on context it is used -func (o *CreatePSMDBClusterParamsBodyTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePSMDBClusterParamsBodyTemplate) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePSMDBClusterParamsBodyTemplate) UnmarshalBinary(b []byte) error { - var res CreatePSMDBClusterParamsBodyTemplate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} 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 deleted file mode 100644 index f51b6e79fc..0000000000 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_credentials_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package psmdb_clusters - -// 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" -) - -// 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 { - return &GetPSMDBClusterCredentialsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetPSMDBClusterCredentialsParamsWithTimeout creates a new GetPSMDBClusterCredentialsParams object -// with the ability to set a timeout on a request. -func NewGetPSMDBClusterCredentialsParamsWithTimeout(timeout time.Duration) *GetPSMDBClusterCredentialsParams { - return &GetPSMDBClusterCredentialsParams{ - timeout: timeout, - } -} - -// NewGetPSMDBClusterCredentialsParamsWithContext creates a new GetPSMDBClusterCredentialsParams object -// with the ability to set a context for a request. -func NewGetPSMDBClusterCredentialsParamsWithContext(ctx context.Context) *GetPSMDBClusterCredentialsParams { - return &GetPSMDBClusterCredentialsParams{ - Context: ctx, - } -} - -// NewGetPSMDBClusterCredentialsParamsWithHTTPClient creates a new GetPSMDBClusterCredentialsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetPSMDBClusterCredentialsParamsWithHTTPClient(client *http.Client) *GetPSMDBClusterCredentialsParams { - 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. -*/ -type GetPSMDBClusterCredentialsParams struct { - // Body. - Body GetPSMDBClusterCredentialsBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the get PSMDB cluster credentials params -func (o *GetPSMDBClusterCredentialsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get PSMDB cluster credentials params -func (o *GetPSMDBClusterCredentialsParams) WithContext(ctx context.Context) *GetPSMDBClusterCredentialsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get PSMDB cluster credentials params -func (o *GetPSMDBClusterCredentialsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get PSMDB cluster credentials params -func (o *GetPSMDBClusterCredentialsParams) WithHTTPClient(client *http.Client) *GetPSMDBClusterCredentialsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get PSMDB cluster credentials params -func (o *GetPSMDBClusterCredentialsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get PSMDB cluster credentials params -func (o *GetPSMDBClusterCredentialsParams) WithBody(body GetPSMDBClusterCredentialsBody) *GetPSMDBClusterCredentialsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get PSMDB cluster credentials params -func (o *GetPSMDBClusterCredentialsParams) SetBody(body GetPSMDBClusterCredentialsBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetPSMDBClusterCredentialsParams) 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/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 deleted file mode 100644 index 0c53037935..0000000000 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_credentials_responses.go +++ /dev/null @@ -1,439 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package psmdb_clusters - -// 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" -) - -// GetPSMDBClusterCredentialsReader is a Reader for the GetPSMDBClusterCredentials structure. -type GetPSMDBClusterCredentialsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetPSMDBClusterCredentialsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetPSMDBClusterCredentialsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetPSMDBClusterCredentialsDefault(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 - } -} - -// NewGetPSMDBClusterCredentialsOK creates a GetPSMDBClusterCredentialsOK with default headers values -func NewGetPSMDBClusterCredentialsOK() *GetPSMDBClusterCredentialsOK { - return &GetPSMDBClusterCredentialsOK{} -} - -/* -GetPSMDBClusterCredentialsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetPSMDBClusterCredentialsOK struct { - Payload *GetPSMDBClusterCredentialsOKBody -} - -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 -} - -func (o *GetPSMDBClusterCredentialsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetPSMDBClusterCredentialsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetPSMDBClusterCredentialsDefault creates a GetPSMDBClusterCredentialsDefault with default headers values -func NewGetPSMDBClusterCredentialsDefault(code int) *GetPSMDBClusterCredentialsDefault { - return &GetPSMDBClusterCredentialsDefault{ - _statusCode: code, - } -} - -/* -GetPSMDBClusterCredentialsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetPSMDBClusterCredentialsDefault struct { - _statusCode int - - Payload *GetPSMDBClusterCredentialsDefaultBody -} - -// Code gets the status code for the get PSMDB cluster credentials default response -func (o *GetPSMDBClusterCredentialsDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *GetPSMDBClusterCredentialsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetPSMDBClusterCredentialsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -GetPSMDBClusterCredentialsBody get PSMDB cluster credentials body -swagger:model GetPSMDBClusterCredentialsBody -*/ -type GetPSMDBClusterCredentialsBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // PSMDB cluster name. - Name string `json:"name,omitempty"` -} - -// Validate validates this get PSMDB cluster credentials body -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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBClusterCredentialsBody) UnmarshalBinary(b []byte) error { - var res GetPSMDBClusterCredentialsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBClusterCredentialsDefaultBody get PSMDB cluster credentials default body -swagger:model GetPSMDBClusterCredentialsDefaultBody -*/ -type GetPSMDBClusterCredentialsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetPSMDBClusterCredentialsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get PSMDB cluster credentials default body -func (o *GetPSMDBClusterCredentialsDefaultBody) 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 *GetPSMDBClusterCredentialsDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPSMDBClusterCredentialsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBClusterCredentialsDefaultBody) UnmarshalBinary(b []byte) error { - var res GetPSMDBClusterCredentialsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBClusterCredentialsDefaultBodyDetailsItems0 get PSMDB cluster credentials default body details items0 -swagger:model GetPSMDBClusterCredentialsDefaultBodyDetailsItems0 -*/ -type GetPSMDBClusterCredentialsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 -*/ -type GetPSMDBClusterCredentialsOKBody struct { - // connection credentials - ConnectionCredentials *GetPSMDBClusterCredentialsOKBodyConnectionCredentials `json:"connection_credentials,omitempty"` -} - -// Validate validates this get PSMDB cluster credentials OK body -func (o *GetPSMDBClusterCredentialsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateConnectionCredentials(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetPSMDBClusterCredentialsOKBody) validateConnectionCredentials(formats strfmt.Registry) error { - if swag.IsZero(o.ConnectionCredentials) { // not required - return nil - } - - if o.ConnectionCredentials != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPSMDBClusterCredentialsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBClusterCredentialsOKBody) UnmarshalBinary(b []byte) error { - var res GetPSMDBClusterCredentialsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBClusterCredentialsOKBodyConnectionCredentials PSMDBCredentials is a credentials to connect to PSMDB. -// TODO Do not use inner messages in all public APIs (for consistency). -swagger:model GetPSMDBClusterCredentialsOKBodyConnectionCredentials -*/ -type GetPSMDBClusterCredentialsOKBodyConnectionCredentials struct { - // MongoDB username. - Username string `json:"username,omitempty"` - - // MongoDB password. - Password string `json:"password,omitempty"` - - // MongoDB host. - Host string `json:"host,omitempty"` - - // MongoDB port. - Port int32 `json:"port,omitempty"` - - // Replicaset name. - Replicaset string `json:"replicaset,omitempty"` -} - -// Validate validates this get PSMDB cluster credentials OK body connection credentials -func (o *GetPSMDBClusterCredentialsOKBodyConnectionCredentials) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBClusterCredentialsOKBodyConnectionCredentials) UnmarshalBinary(b []byte) error { - var res GetPSMDBClusterCredentialsOKBodyConnectionCredentials - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return 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 deleted file mode 100644 index 74b6e68f61..0000000000 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_resources_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package psmdb_clusters - -// 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" -) - -// 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 { - return &GetPSMDBClusterResourcesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetPSMDBClusterResourcesParamsWithTimeout creates a new GetPSMDBClusterResourcesParams object -// with the ability to set a timeout on a request. -func NewGetPSMDBClusterResourcesParamsWithTimeout(timeout time.Duration) *GetPSMDBClusterResourcesParams { - return &GetPSMDBClusterResourcesParams{ - timeout: timeout, - } -} - -// NewGetPSMDBClusterResourcesParamsWithContext creates a new GetPSMDBClusterResourcesParams object -// with the ability to set a context for a request. -func NewGetPSMDBClusterResourcesParamsWithContext(ctx context.Context) *GetPSMDBClusterResourcesParams { - return &GetPSMDBClusterResourcesParams{ - Context: ctx, - } -} - -// NewGetPSMDBClusterResourcesParamsWithHTTPClient creates a new GetPSMDBClusterResourcesParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetPSMDBClusterResourcesParamsWithHTTPClient(client *http.Client) *GetPSMDBClusterResourcesParams { - 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. -*/ -type GetPSMDBClusterResourcesParams struct { - // Body. - Body GetPSMDBClusterResourcesBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the get PSMDB cluster resources params -func (o *GetPSMDBClusterResourcesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get PSMDB cluster resources params -func (o *GetPSMDBClusterResourcesParams) WithContext(ctx context.Context) *GetPSMDBClusterResourcesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get PSMDB cluster resources params -func (o *GetPSMDBClusterResourcesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get PSMDB cluster resources params -func (o *GetPSMDBClusterResourcesParams) WithHTTPClient(client *http.Client) *GetPSMDBClusterResourcesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get PSMDB cluster resources params -func (o *GetPSMDBClusterResourcesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get PSMDB cluster resources params -func (o *GetPSMDBClusterResourcesParams) WithBody(body GetPSMDBClusterResourcesBody) *GetPSMDBClusterResourcesParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get PSMDB cluster resources params -func (o *GetPSMDBClusterResourcesParams) SetBody(body GetPSMDBClusterResourcesBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetPSMDBClusterResourcesParams) 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/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 deleted file mode 100644 index 930f0a3b19..0000000000 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/get_psmdb_cluster_resources_responses.go +++ /dev/null @@ -1,895 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package psmdb_clusters - -// 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" -) - -// GetPSMDBClusterResourcesReader is a Reader for the GetPSMDBClusterResources structure. -type GetPSMDBClusterResourcesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetPSMDBClusterResourcesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetPSMDBClusterResourcesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetPSMDBClusterResourcesDefault(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 - } -} - -// NewGetPSMDBClusterResourcesOK creates a GetPSMDBClusterResourcesOK with default headers values -func NewGetPSMDBClusterResourcesOK() *GetPSMDBClusterResourcesOK { - return &GetPSMDBClusterResourcesOK{} -} - -/* -GetPSMDBClusterResourcesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetPSMDBClusterResourcesOK struct { - Payload *GetPSMDBClusterResourcesOKBody -} - -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 -} - -func (o *GetPSMDBClusterResourcesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetPSMDBClusterResourcesOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetPSMDBClusterResourcesDefault creates a GetPSMDBClusterResourcesDefault with default headers values -func NewGetPSMDBClusterResourcesDefault(code int) *GetPSMDBClusterResourcesDefault { - return &GetPSMDBClusterResourcesDefault{ - _statusCode: code, - } -} - -/* -GetPSMDBClusterResourcesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetPSMDBClusterResourcesDefault struct { - _statusCode int - - Payload *GetPSMDBClusterResourcesDefaultBody -} - -// Code gets the status code for the get PSMDB cluster resources default response -func (o *GetPSMDBClusterResourcesDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *GetPSMDBClusterResourcesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetPSMDBClusterResourcesDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -GetPSMDBClusterResourcesBody get PSMDB cluster resources body -swagger:model GetPSMDBClusterResourcesBody -*/ -type GetPSMDBClusterResourcesBody struct { - // params - Params *GetPSMDBClusterResourcesParamsBodyParams `json:"params,omitempty"` -} - -// Validate validates this get PSMDB cluster resources body -func (o *GetPSMDBClusterResourcesBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateParams(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetPSMDBClusterResourcesBody) 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("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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPSMDBClusterResourcesBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBClusterResourcesBody) UnmarshalBinary(b []byte) error { - var res GetPSMDBClusterResourcesBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBClusterResourcesDefaultBody get PSMDB cluster resources default body -swagger:model GetPSMDBClusterResourcesDefaultBody -*/ -type GetPSMDBClusterResourcesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetPSMDBClusterResourcesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get PSMDB cluster resources default body -func (o *GetPSMDBClusterResourcesDefaultBody) 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 *GetPSMDBClusterResourcesDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPSMDBClusterResourcesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBClusterResourcesDefaultBody) UnmarshalBinary(b []byte) error { - var res GetPSMDBClusterResourcesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBClusterResourcesDefaultBodyDetailsItems0 get PSMDB cluster resources default body details items0 -swagger:model GetPSMDBClusterResourcesDefaultBodyDetailsItems0 -*/ -type GetPSMDBClusterResourcesDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 -*/ -type GetPSMDBClusterResourcesOKBody struct { - // expected - Expected *GetPSMDBClusterResourcesOKBodyExpected `json:"expected,omitempty"` -} - -// Validate validates this get PSMDB cluster resources OK body -func (o *GetPSMDBClusterResourcesOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateExpected(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetPSMDBClusterResourcesOKBody) validateExpected(formats strfmt.Registry) error { - if swag.IsZero(o.Expected) { // not required - return nil - } - - if o.Expected != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPSMDBClusterResourcesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBClusterResourcesOKBody) UnmarshalBinary(b []byte) error { - var res GetPSMDBClusterResourcesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBClusterResourcesOKBodyExpected Resources contains Kubernetes cluster resources. -swagger:model GetPSMDBClusterResourcesOKBodyExpected -*/ -type GetPSMDBClusterResourcesOKBodyExpected struct { - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` - - // CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus. - // See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu. - CPUm string `json:"cpu_m,omitempty"` - - // Disk size in bytes. - DiskSize string `json:"disk_size,omitempty"` -} - -// Validate validates this get PSMDB cluster resources OK body expected -func (o *GetPSMDBClusterResourcesOKBodyExpected) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBClusterResourcesOKBodyExpected) UnmarshalBinary(b []byte) error { - var res GetPSMDBClusterResourcesOKBodyExpected - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBClusterResourcesParamsBodyParams PSMDBClusterParams represents PSMDB cluster parameters that can be updated. -swagger:model GetPSMDBClusterResourcesParamsBodyParams -*/ -type GetPSMDBClusterResourcesParamsBodyParams struct { - // Cluster size. - ClusterSize int32 `json:"cluster_size,omitempty"` - - // Docker image used for PSMDB. - Image string `json:"image,omitempty"` - - // backup - Backup *GetPSMDBClusterResourcesParamsBodyParamsBackup `json:"backup,omitempty"` - - // replicaset - Replicaset *GetPSMDBClusterResourcesParamsBodyParamsReplicaset `json:"replicaset,omitempty"` - - // restore - Restore *GetPSMDBClusterResourcesParamsBodyParamsRestore `json:"restore,omitempty"` -} - -// Validate validates this get PSMDB cluster resources params body params -func (o *GetPSMDBClusterResourcesParamsBodyParams) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateBackup(formats); err != nil { - res = append(res, err) - } - - if err := o.validateReplicaset(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRestore(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetPSMDBClusterResourcesParamsBodyParams) validateBackup(formats strfmt.Registry) error { - if swag.IsZero(o.Backup) { // not required - return nil - } - - if o.Backup != nil { - if err := o.Backup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + "backup") - } - return err - } - } - - return nil -} - -func (o *GetPSMDBClusterResourcesParamsBodyParams) validateReplicaset(formats strfmt.Registry) error { - if swag.IsZero(o.Replicaset) { // not required - return nil - } - - if o.Replicaset != nil { - 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 -} - -func (o *GetPSMDBClusterResourcesParamsBodyParams) validateRestore(formats strfmt.Registry) error { - if swag.IsZero(o.Restore) { // not required - return nil - } - - if o.Restore != nil { - if err := o.Restore.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + "restore") - } - 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.contextValidateBackup(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateReplicaset(ctx, formats); err != nil { - res = append(res, err) - } - - if err := o.contextValidateRestore(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetPSMDBClusterResourcesParamsBodyParams) contextValidateBackup(ctx context.Context, formats strfmt.Registry) error { - if o.Backup != nil { - if err := o.Backup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + "backup") - } - return err - } - } - - 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 - } - } - - return nil -} - -func (o *GetPSMDBClusterResourcesParamsBodyParams) contextValidateRestore(ctx context.Context, formats strfmt.Registry) error { - if o.Restore != nil { - if err := o.Restore.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + "restore") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPSMDBClusterResourcesParamsBodyParams) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBClusterResourcesParamsBodyParams) UnmarshalBinary(b []byte) error { - var res GetPSMDBClusterResourcesParamsBodyParams - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBClusterResourcesParamsBodyParamsBackup Backup configuration for a database cluster -swagger:model GetPSMDBClusterResourcesParamsBodyParamsBackup -*/ -type GetPSMDBClusterResourcesParamsBodyParamsBackup struct { - // Backup Location id of stored backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Keep copies represents how many copies should retain. - KeepCopies int32 `json:"keep_copies,omitempty"` - - // Cron expression represents cron expression - CronExpression string `json:"cron_expression,omitempty"` - - // Service acccount used for backups - ServiceAccount string `json:"service_account,omitempty"` -} - -// Validate validates this get PSMDB cluster resources params body params backup -func (o *GetPSMDBClusterResourcesParamsBodyParamsBackup) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get PSMDB cluster resources params body params backup based on context it is used -func (o *GetPSMDBClusterResourcesParamsBodyParamsBackup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetPSMDBClusterResourcesParamsBodyParamsBackup) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBClusterResourcesParamsBodyParamsBackup) UnmarshalBinary(b []byte) error { - var res GetPSMDBClusterResourcesParamsBodyParamsBackup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBClusterResourcesParamsBodyParamsReplicaset ReplicaSet container parameters. -// TODO Do not use inner messages in all public APIs (for consistency). -swagger:model GetPSMDBClusterResourcesParamsBodyParamsReplicaset -*/ -type GetPSMDBClusterResourcesParamsBodyParamsReplicaset struct { - // Disk size in bytes. - DiskSize string `json:"disk_size,omitempty"` - - // Configuration for PSMDB cluster - Configuration string `json:"configuration,omitempty"` - - // Storage Class for PSMDB cluster. - StorageClass string `json:"storage_class,omitempty"` - - // compute resources - ComputeResources *GetPSMDBClusterResourcesParamsBodyParamsReplicasetComputeResources `json:"compute_resources,omitempty"` -} - -// Validate validates this get PSMDB cluster resources params body params replicaset -func (o *GetPSMDBClusterResourcesParamsBodyParamsReplicaset) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateComputeResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetPSMDBClusterResourcesParamsBodyParamsReplicaset) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPSMDBClusterResourcesParamsBodyParamsReplicaset) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBClusterResourcesParamsBodyParamsReplicaset) UnmarshalBinary(b []byte) error { - var res GetPSMDBClusterResourcesParamsBodyParamsReplicaset - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBClusterResourcesParamsBodyParamsReplicasetComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model GetPSMDBClusterResourcesParamsBodyParamsReplicasetComputeResources -*/ -type GetPSMDBClusterResourcesParamsBodyParamsReplicasetComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// Validate validates this get PSMDB cluster resources params body params replicaset compute resources -func (o *GetPSMDBClusterResourcesParamsBodyParamsReplicasetComputeResources) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBClusterResourcesParamsBodyParamsReplicasetComputeResources) UnmarshalBinary(b []byte) error { - var res GetPSMDBClusterResourcesParamsBodyParamsReplicasetComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPSMDBClusterResourcesParamsBodyParamsRestore Restore represents restoration payload to restore a database cluster from backup -swagger:model GetPSMDBClusterResourcesParamsBodyParamsRestore -*/ -type GetPSMDBClusterResourcesParamsBodyParamsRestore struct { - // Backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Destination filename. - Destination string `json:"destination,omitempty"` - - // K8s Secrets name. - SecretsName string `json:"secrets_name,omitempty"` -} - -// Validate validates this get PSMDB cluster resources params body params restore -func (o *GetPSMDBClusterResourcesParamsBodyParamsRestore) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get PSMDB cluster resources params body params restore based on context it is used -func (o *GetPSMDBClusterResourcesParamsBodyParamsRestore) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetPSMDBClusterResourcesParamsBodyParamsRestore) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPSMDBClusterResourcesParamsBodyParamsRestore) UnmarshalBinary(b []byte) error { - var res GetPSMDBClusterResourcesParamsBodyParamsRestore - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return 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 deleted file mode 100644 index d4987b997f..0000000000 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/psmdb_clusters_client.go +++ /dev/null @@ -1,193 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package psmdb_clusters - -// 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 psmdb clusters API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for psmdb clusters 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 { - CreatePSMDBCluster(params *CreatePSMDBClusterParams, opts ...ClientOption) (*CreatePSMDBClusterOK, error) - - GetPSMDBClusterCredentials(params *GetPSMDBClusterCredentialsParams, opts ...ClientOption) (*GetPSMDBClusterCredentialsOK, error) - - GetPSMDBClusterResources(params *GetPSMDBClusterResourcesParams, opts ...ClientOption) (*GetPSMDBClusterResourcesOK, error) - - UpdatePSMDBCluster(params *UpdatePSMDBClusterParams, opts ...ClientOption) (*UpdatePSMDBClusterOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -CreatePSMDBCluster creates PSMDB cluster creates a new PSMDB cluster -*/ -func (a *Client) CreatePSMDBCluster(params *CreatePSMDBClusterParams, opts ...ClientOption) (*CreatePSMDBClusterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreatePSMDBClusterParams() - } - op := &runtime.ClientOperation{ - ID: "CreatePSMDBCluster", - Method: "POST", - PathPattern: "/v1/management/DBaaS/PSMDBCluster/Create", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*CreatePSMDBClusterOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*CreatePSMDBClusterDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetPSMDBClusterCredentials gets PSMDB cluster credentials returns a PSMDB cluster credentials by cluster name -*/ -func (a *Client) GetPSMDBClusterCredentials(params *GetPSMDBClusterCredentialsParams, opts ...ClientOption) (*GetPSMDBClusterCredentialsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetPSMDBClusterCredentialsParams() - } - op := &runtime.ClientOperation{ - ID: "GetPSMDBClusterCredentials", - Method: "POST", - PathPattern: "/v1/management/DBaaS/PSMDBClusters/GetCredentials", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*GetPSMDBClusterCredentialsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetPSMDBClusterCredentialsDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetPSMDBClusterResources gets PSMDB cluster resources returns expected resources to be consumed by the cluster -*/ -func (a *Client) GetPSMDBClusterResources(params *GetPSMDBClusterResourcesParams, opts ...ClientOption) (*GetPSMDBClusterResourcesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetPSMDBClusterResourcesParams() - } - op := &runtime.ClientOperation{ - ID: "GetPSMDBClusterResources", - Method: "POST", - PathPattern: "/v1/management/DBaaS/PSMDBCluster/Resources/Get", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*GetPSMDBClusterResourcesOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetPSMDBClusterResourcesDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -UpdatePSMDBCluster updates PSMDB cluster updates existing PSMDB cluster -*/ -func (a *Client) UpdatePSMDBCluster(params *UpdatePSMDBClusterParams, opts ...ClientOption) (*UpdatePSMDBClusterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdatePSMDBClusterParams() - } - op := &runtime.ClientOperation{ - ID: "UpdatePSMDBCluster", - Method: "POST", - PathPattern: "/v1/management/DBaaS/PSMDBCluster/Update", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*UpdatePSMDBClusterOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*UpdatePSMDBClusterDefault) - 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/managementpb/dbaas/json/client/psmdb_clusters/update_psmdb_cluster_parameters.go b/api/managementpb/dbaas/json/client/psmdb_clusters/update_psmdb_cluster_parameters.go deleted file mode 100644 index 23c76e1316..0000000000 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/update_psmdb_cluster_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package psmdb_clusters - -// 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" -) - -// 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 { - return &UpdatePSMDBClusterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdatePSMDBClusterParamsWithTimeout creates a new UpdatePSMDBClusterParams object -// with the ability to set a timeout on a request. -func NewUpdatePSMDBClusterParamsWithTimeout(timeout time.Duration) *UpdatePSMDBClusterParams { - return &UpdatePSMDBClusterParams{ - timeout: timeout, - } -} - -// NewUpdatePSMDBClusterParamsWithContext creates a new UpdatePSMDBClusterParams object -// with the ability to set a context for a request. -func NewUpdatePSMDBClusterParamsWithContext(ctx context.Context) *UpdatePSMDBClusterParams { - return &UpdatePSMDBClusterParams{ - Context: ctx, - } -} - -// NewUpdatePSMDBClusterParamsWithHTTPClient creates a new UpdatePSMDBClusterParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdatePSMDBClusterParamsWithHTTPClient(client *http.Client) *UpdatePSMDBClusterParams { - 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. -*/ -type UpdatePSMDBClusterParams struct { - // Body. - Body UpdatePSMDBClusterBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the update PSMDB cluster params -func (o *UpdatePSMDBClusterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update PSMDB cluster params -func (o *UpdatePSMDBClusterParams) WithContext(ctx context.Context) *UpdatePSMDBClusterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update PSMDB cluster params -func (o *UpdatePSMDBClusterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update PSMDB cluster params -func (o *UpdatePSMDBClusterParams) WithHTTPClient(client *http.Client) *UpdatePSMDBClusterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update PSMDB cluster params -func (o *UpdatePSMDBClusterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the update PSMDB cluster params -func (o *UpdatePSMDBClusterParams) WithBody(body UpdatePSMDBClusterBody) *UpdatePSMDBClusterParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update PSMDB cluster params -func (o *UpdatePSMDBClusterParams) SetBody(body UpdatePSMDBClusterBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdatePSMDBClusterParams) 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/managementpb/dbaas/json/client/psmdb_clusters/update_psmdb_cluster_responses.go b/api/managementpb/dbaas/json/client/psmdb_clusters/update_psmdb_cluster_responses.go deleted file mode 100644 index 8e6b13e24c..0000000000 --- a/api/managementpb/dbaas/json/client/psmdb_clusters/update_psmdb_cluster_responses.go +++ /dev/null @@ -1,684 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package psmdb_clusters - -// 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" -) - -// UpdatePSMDBClusterReader is a Reader for the UpdatePSMDBCluster structure. -type UpdatePSMDBClusterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdatePSMDBClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdatePSMDBClusterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewUpdatePSMDBClusterDefault(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 - } -} - -// NewUpdatePSMDBClusterOK creates a UpdatePSMDBClusterOK with default headers values -func NewUpdatePSMDBClusterOK() *UpdatePSMDBClusterOK { - return &UpdatePSMDBClusterOK{} -} - -/* -UpdatePSMDBClusterOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type UpdatePSMDBClusterOK struct { - Payload interface{} -} - -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 -} - -func (o *UpdatePSMDBClusterOK) 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 -} - -// NewUpdatePSMDBClusterDefault creates a UpdatePSMDBClusterDefault with default headers values -func NewUpdatePSMDBClusterDefault(code int) *UpdatePSMDBClusterDefault { - return &UpdatePSMDBClusterDefault{ - _statusCode: code, - } -} - -/* -UpdatePSMDBClusterDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type UpdatePSMDBClusterDefault struct { - _statusCode int - - Payload *UpdatePSMDBClusterDefaultBody -} - -// Code gets the status code for the update PSMDB cluster default response -func (o *UpdatePSMDBClusterDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *UpdatePSMDBClusterDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(UpdatePSMDBClusterDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -UpdatePSMDBClusterBody update PSMDB cluster body -swagger:model UpdatePSMDBClusterBody -*/ -type UpdatePSMDBClusterBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // PSMDB cluster name. - Name string `json:"name,omitempty"` - - // Make DB cluster accessible outside of K8s cluster. - Expose bool `json:"expose,omitempty"` - - // Make DB cluster accessible via public internet. - InternetFacing bool `json:"internet_facing,omitempty"` - - // Apply IP source ranges against the cluster. - SourceRanges []string `json:"source_ranges"` - - // params - Params *UpdatePSMDBClusterParamsBodyParams `json:"params,omitempty"` - - // template - Template *UpdatePSMDBClusterParamsBodyTemplate `json:"template,omitempty"` -} - -// Validate validates this update PSMDB cluster body -func (o *UpdatePSMDBClusterBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateParams(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTemplate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *UpdatePSMDBClusterBody) 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("body" + "." + "params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params") - } - return err - } - } - - return nil -} - -func (o *UpdatePSMDBClusterBody) validateTemplate(formats strfmt.Registry) error { - if swag.IsZero(o.Template) { // not required - return nil - } - - if o.Template != nil { - if err := o.Template.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "template") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "template") - } - 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 err := o.contextValidateTemplate(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 - } - } - - return nil -} - -func (o *UpdatePSMDBClusterBody) contextValidateTemplate(ctx context.Context, formats strfmt.Registry) error { - if o.Template != nil { - if err := o.Template.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "template") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "template") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UpdatePSMDBClusterBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdatePSMDBClusterBody) UnmarshalBinary(b []byte) error { - var res UpdatePSMDBClusterBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdatePSMDBClusterDefaultBody update PSMDB cluster default body -swagger:model UpdatePSMDBClusterDefaultBody -*/ -type UpdatePSMDBClusterDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*UpdatePSMDBClusterDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this update PSMDB cluster default body -func (o *UpdatePSMDBClusterDefaultBody) 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 *UpdatePSMDBClusterDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UpdatePSMDBClusterDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdatePSMDBClusterDefaultBody) UnmarshalBinary(b []byte) error { - var res UpdatePSMDBClusterDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdatePSMDBClusterDefaultBodyDetailsItems0 update PSMDB cluster default body details items0 -swagger:model UpdatePSMDBClusterDefaultBodyDetailsItems0 -*/ -type UpdatePSMDBClusterDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 -*/ -type UpdatePSMDBClusterParamsBodyParams struct { - // Cluster size. - ClusterSize int32 `json:"cluster_size,omitempty"` - - // Suspend cluster `pause: true`. - Suspend bool `json:"suspend,omitempty"` - - // Resume cluster `pause: false`. - Resume bool `json:"resume,omitempty"` - - // PSMDB image to use. If it's the same image but with different version tag, upgrade of database cluster to version - // in given tag is triggered. If entirely different image is given, error is returned. - Image string `json:"image,omitempty"` - - // replicaset - Replicaset *UpdatePSMDBClusterParamsBodyParamsReplicaset `json:"replicaset,omitempty"` -} - -// Validate validates this update PSMDB cluster params body params -func (o *UpdatePSMDBClusterParamsBodyParams) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateReplicaset(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *UpdatePSMDBClusterParamsBodyParams) validateReplicaset(formats strfmt.Registry) error { - if swag.IsZero(o.Replicaset) { // not required - return nil - } - - if o.Replicaset != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UpdatePSMDBClusterParamsBodyParams) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdatePSMDBClusterParamsBodyParams) UnmarshalBinary(b []byte) error { - var res UpdatePSMDBClusterParamsBodyParams - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdatePSMDBClusterParamsBodyParamsReplicaset ReplicaSet container parameters. -swagger:model UpdatePSMDBClusterParamsBodyParamsReplicaset -*/ -type UpdatePSMDBClusterParamsBodyParamsReplicaset struct { - // Configuration for PSMDB cluster - Configuration string `json:"configuration,omitempty"` - - // Storage Class for PSMDB cluster. - StorageClass string `json:"storage_class,omitempty"` - - // compute resources - ComputeResources *UpdatePSMDBClusterParamsBodyParamsReplicasetComputeResources `json:"compute_resources,omitempty"` -} - -// Validate validates this update PSMDB cluster params body params replicaset -func (o *UpdatePSMDBClusterParamsBodyParamsReplicaset) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateComputeResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *UpdatePSMDBClusterParamsBodyParamsReplicaset) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UpdatePSMDBClusterParamsBodyParamsReplicaset) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdatePSMDBClusterParamsBodyParamsReplicaset) UnmarshalBinary(b []byte) error { - var res UpdatePSMDBClusterParamsBodyParamsReplicaset - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdatePSMDBClusterParamsBodyParamsReplicasetComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model UpdatePSMDBClusterParamsBodyParamsReplicasetComputeResources -*/ -type UpdatePSMDBClusterParamsBodyParamsReplicasetComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// Validate validates this update PSMDB cluster params body params replicaset compute resources -func (o *UpdatePSMDBClusterParamsBodyParamsReplicasetComputeResources) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdatePSMDBClusterParamsBodyParamsReplicasetComputeResources) UnmarshalBinary(b []byte) error { - var res UpdatePSMDBClusterParamsBodyParamsReplicasetComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdatePSMDBClusterParamsBodyTemplate update PSMDB cluster params body template -swagger:model UpdatePSMDBClusterParamsBodyTemplate -*/ -type UpdatePSMDBClusterParamsBodyTemplate struct { - // Template CR name. - Name string `json:"name,omitempty"` - - // Template CR kind. - Kind string `json:"kind,omitempty"` -} - -// Validate validates this update PSMDB cluster params body template -func (o *UpdatePSMDBClusterParamsBodyTemplate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this update PSMDB cluster params body template based on context it is used -func (o *UpdatePSMDBClusterParamsBodyTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdatePSMDBClusterParamsBodyTemplate) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdatePSMDBClusterParamsBodyTemplate) UnmarshalBinary(b []byte) error { - var res UpdatePSMDBClusterParamsBodyTemplate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return 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 deleted file mode 100644 index 7beb33eddb..0000000000 --- a/api/managementpb/dbaas/json/client/pxc_clusters/create_pxc_cluster_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package pxc_clusters - -// 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" -) - -// 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 { - return &CreatePXCClusterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreatePXCClusterParamsWithTimeout creates a new CreatePXCClusterParams object -// with the ability to set a timeout on a request. -func NewCreatePXCClusterParamsWithTimeout(timeout time.Duration) *CreatePXCClusterParams { - return &CreatePXCClusterParams{ - timeout: timeout, - } -} - -// NewCreatePXCClusterParamsWithContext creates a new CreatePXCClusterParams object -// with the ability to set a context for a request. -func NewCreatePXCClusterParamsWithContext(ctx context.Context) *CreatePXCClusterParams { - return &CreatePXCClusterParams{ - Context: ctx, - } -} - -// NewCreatePXCClusterParamsWithHTTPClient creates a new CreatePXCClusterParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreatePXCClusterParamsWithHTTPClient(client *http.Client) *CreatePXCClusterParams { - 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. -*/ -type CreatePXCClusterParams struct { - // Body. - Body CreatePXCClusterBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the create PXC cluster params -func (o *CreatePXCClusterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create PXC cluster params -func (o *CreatePXCClusterParams) WithContext(ctx context.Context) *CreatePXCClusterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create PXC cluster params -func (o *CreatePXCClusterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create PXC cluster params -func (o *CreatePXCClusterParams) WithHTTPClient(client *http.Client) *CreatePXCClusterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create PXC cluster params -func (o *CreatePXCClusterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create PXC cluster params -func (o *CreatePXCClusterParams) WithBody(body CreatePXCClusterBody) *CreatePXCClusterParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create PXC cluster params -func (o *CreatePXCClusterParams) SetBody(body CreatePXCClusterBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CreatePXCClusterParams) 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/managementpb/dbaas/json/client/pxc_clusters/create_pxc_cluster_responses.go b/api/managementpb/dbaas/json/client/pxc_clusters/create_pxc_cluster_responses.go deleted file mode 100644 index 00c257a18e..0000000000 --- a/api/managementpb/dbaas/json/client/pxc_clusters/create_pxc_cluster_responses.go +++ /dev/null @@ -1,1222 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package pxc_clusters - -// 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" -) - -// CreatePXCClusterReader is a Reader for the CreatePXCCluster structure. -type CreatePXCClusterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreatePXCClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreatePXCClusterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewCreatePXCClusterDefault(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 - } -} - -// NewCreatePXCClusterOK creates a CreatePXCClusterOK with default headers values -func NewCreatePXCClusterOK() *CreatePXCClusterOK { - return &CreatePXCClusterOK{} -} - -/* -CreatePXCClusterOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type CreatePXCClusterOK struct { - Payload interface{} -} - -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 -} - -func (o *CreatePXCClusterOK) 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 -} - -// NewCreatePXCClusterDefault creates a CreatePXCClusterDefault with default headers values -func NewCreatePXCClusterDefault(code int) *CreatePXCClusterDefault { - return &CreatePXCClusterDefault{ - _statusCode: code, - } -} - -/* -CreatePXCClusterDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type CreatePXCClusterDefault struct { - _statusCode int - - Payload *CreatePXCClusterDefaultBody -} - -// Code gets the status code for the create PXC cluster default response -func (o *CreatePXCClusterDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *CreatePXCClusterDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(CreatePXCClusterDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -CreatePXCClusterBody create PXC cluster body -swagger:model CreatePXCClusterBody -*/ -type CreatePXCClusterBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // PXC cluster name. - // a DNS-1035 label must consist of lower case alphanumeric characters or '-', - // start with an alphabetic character, and end with an alphanumeric character - // (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?') - Name string `json:"name,omitempty"` - - // Make DB cluster accessible outside of K8s cluster. - Expose bool `json:"expose,omitempty"` - - // Make DB cluster accessible via public internet. - InternetFacing bool `json:"internet_facing,omitempty"` - - // Apply IP source ranges against the cluster. - SourceRanges []string `json:"source_ranges"` - - // params - Params *CreatePXCClusterParamsBodyParams `json:"params,omitempty"` - - // template - Template *CreatePXCClusterParamsBodyTemplate `json:"template,omitempty"` -} - -// Validate validates this create PXC cluster body -func (o *CreatePXCClusterBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateParams(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTemplate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePXCClusterBody) 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("body" + "." + "params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params") - } - return err - } - } - - return nil -} - -func (o *CreatePXCClusterBody) validateTemplate(formats strfmt.Registry) error { - if swag.IsZero(o.Template) { // not required - return nil - } - - if o.Template != nil { - if err := o.Template.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "template") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "template") - } - 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 err := o.contextValidateTemplate(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 - } - } - - return nil -} - -func (o *CreatePXCClusterBody) contextValidateTemplate(ctx context.Context, formats strfmt.Registry) error { - if o.Template != nil { - if err := o.Template.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "template") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "template") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePXCClusterBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePXCClusterBody) UnmarshalBinary(b []byte) error { - var res CreatePXCClusterBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePXCClusterDefaultBody create PXC cluster default body -swagger:model CreatePXCClusterDefaultBody -*/ -type CreatePXCClusterDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*CreatePXCClusterDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this create PXC cluster default body -func (o *CreatePXCClusterDefaultBody) 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 *CreatePXCClusterDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePXCClusterDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePXCClusterDefaultBody) UnmarshalBinary(b []byte) error { - var res CreatePXCClusterDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePXCClusterDefaultBodyDetailsItems0 create PXC cluster default body details items0 -swagger:model CreatePXCClusterDefaultBodyDetailsItems0 -*/ -type CreatePXCClusterDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 -*/ -type CreatePXCClusterParamsBodyParams struct { - // Cluster size. - ClusterSize int32 `json:"cluster_size,omitempty"` - - // backup - Backup *CreatePXCClusterParamsBodyParamsBackup `json:"backup,omitempty"` - - // haproxy - Haproxy *CreatePXCClusterParamsBodyParamsHaproxy `json:"haproxy,omitempty"` - - // proxysql - Proxysql *CreatePXCClusterParamsBodyParamsProxysql `json:"proxysql,omitempty"` - - // pxc - PXC *CreatePXCClusterParamsBodyParamsPXC `json:"pxc,omitempty"` - - // restore - Restore *CreatePXCClusterParamsBodyParamsRestore `json:"restore,omitempty"` -} - -// Validate validates this create PXC cluster params body params -func (o *CreatePXCClusterParamsBodyParams) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateBackup(formats); err != nil { - res = append(res, err) - } - - if err := o.validateHaproxy(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePXC(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRestore(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePXCClusterParamsBodyParams) validateBackup(formats strfmt.Registry) error { - if swag.IsZero(o.Backup) { // not required - return nil - } - - if o.Backup != nil { - if err := o.Backup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + "backup") - } - return err - } - } - - return nil -} - -func (o *CreatePXCClusterParamsBodyParams) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if o.Haproxy != nil { - if err := o.Haproxy.Validate(formats); err != nil { - 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) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if o.Proxysql != nil { - if err := o.Proxysql.Validate(formats); err != nil { - 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) validatePXC(formats strfmt.Registry) error { - if swag.IsZero(o.PXC) { // not required - return nil - } - - if o.PXC != nil { - 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 -} - -func (o *CreatePXCClusterParamsBodyParams) validateRestore(formats strfmt.Registry) error { - if swag.IsZero(o.Restore) { // not required - return nil - } - - if o.Restore != nil { - if err := o.Restore.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + "restore") - } - 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.contextValidateBackup(ctx, formats); err != nil { - res = append(res, err) - } - - 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 err := o.contextValidateRestore(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePXCClusterParamsBodyParams) contextValidateBackup(ctx context.Context, formats strfmt.Registry) error { - if o.Backup != nil { - if err := o.Backup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + "backup") - } - return err - } - } - - 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 - } - } - - return nil -} - -func (o *CreatePXCClusterParamsBodyParams) contextValidateRestore(ctx context.Context, formats strfmt.Registry) error { - if o.Restore != nil { - if err := o.Restore.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + "restore") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyParams) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyParams) UnmarshalBinary(b []byte) error { - var res CreatePXCClusterParamsBodyParams - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePXCClusterParamsBodyParamsBackup Backup configuration for a database cluster -swagger:model CreatePXCClusterParamsBodyParamsBackup -*/ -type CreatePXCClusterParamsBodyParamsBackup struct { - // Backup Location id of stored backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Keep copies represents how many copies should retain. - KeepCopies int32 `json:"keep_copies,omitempty"` - - // Cron expression represents cron expression - CronExpression string `json:"cron_expression,omitempty"` - - // Service acccount used for backups - ServiceAccount string `json:"service_account,omitempty"` -} - -// Validate validates this create PXC cluster params body params backup -func (o *CreatePXCClusterParamsBodyParamsBackup) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this create PXC cluster params body params backup based on context it is used -func (o *CreatePXCClusterParamsBodyParamsBackup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyParamsBackup) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyParamsBackup) UnmarshalBinary(b []byte) error { - var res CreatePXCClusterParamsBodyParamsBackup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePXCClusterParamsBodyParamsHaproxy HAProxy container parameters. -// NOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it. -swagger:model CreatePXCClusterParamsBodyParamsHaproxy -*/ -type CreatePXCClusterParamsBodyParamsHaproxy struct { - // Docker image used for HAProxy. - Image string `json:"image,omitempty"` - - // compute resources - ComputeResources *CreatePXCClusterParamsBodyParamsHaproxyComputeResources `json:"compute_resources,omitempty"` -} - -// Validate validates this create PXC cluster params body params haproxy -func (o *CreatePXCClusterParamsBodyParamsHaproxy) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateComputeResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePXCClusterParamsBodyParamsHaproxy) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyParamsHaproxy) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyParamsHaproxy) UnmarshalBinary(b []byte) error { - var res CreatePXCClusterParamsBodyParamsHaproxy - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePXCClusterParamsBodyParamsHaproxyComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model CreatePXCClusterParamsBodyParamsHaproxyComputeResources -*/ -type CreatePXCClusterParamsBodyParamsHaproxyComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// Validate validates this create PXC cluster params body params haproxy compute resources -func (o *CreatePXCClusterParamsBodyParamsHaproxyComputeResources) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyParamsHaproxyComputeResources) UnmarshalBinary(b []byte) error { - var res CreatePXCClusterParamsBodyParamsHaproxyComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePXCClusterParamsBodyParamsPXC PXC container parameters. -// TODO Do not use inner messages in all public APIs (for consistency). -swagger:model CreatePXCClusterParamsBodyParamsPXC -*/ -type CreatePXCClusterParamsBodyParamsPXC struct { - // Docker image used for PXC. - Image string `json:"image,omitempty"` - - // Disk size in bytes. - DiskSize string `json:"disk_size,omitempty"` - - // Configuration for PXC cluster - Configuration string `json:"configuration,omitempty"` - - // Storage Class for PXC cluster. - StorageClass string `json:"storage_class,omitempty"` - - // compute resources - ComputeResources *CreatePXCClusterParamsBodyParamsPXCComputeResources `json:"compute_resources,omitempty"` -} - -// Validate validates this create PXC cluster params body params PXC -func (o *CreatePXCClusterParamsBodyParamsPXC) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateComputeResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePXCClusterParamsBodyParamsPXC) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyParamsPXC) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyParamsPXC) UnmarshalBinary(b []byte) error { - var res CreatePXCClusterParamsBodyParamsPXC - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePXCClusterParamsBodyParamsPXCComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model CreatePXCClusterParamsBodyParamsPXCComputeResources -*/ -type CreatePXCClusterParamsBodyParamsPXCComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// Validate validates this create PXC cluster params body params PXC compute resources -func (o *CreatePXCClusterParamsBodyParamsPXCComputeResources) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyParamsPXCComputeResources) UnmarshalBinary(b []byte) error { - var res CreatePXCClusterParamsBodyParamsPXCComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePXCClusterParamsBodyParamsProxysql ProxySQL container parameters. -// TODO Do not use inner messages in all public APIs (for consistency). -swagger:model CreatePXCClusterParamsBodyParamsProxysql -*/ -type CreatePXCClusterParamsBodyParamsProxysql struct { - // Docker image used for ProxySQL. - Image string `json:"image,omitempty"` - - // Disk size in bytes. - DiskSize string `json:"disk_size,omitempty"` - - // compute resources - ComputeResources *CreatePXCClusterParamsBodyParamsProxysqlComputeResources `json:"compute_resources,omitempty"` -} - -// Validate validates this create PXC cluster params body params proxysql -func (o *CreatePXCClusterParamsBodyParamsProxysql) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateComputeResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *CreatePXCClusterParamsBodyParamsProxysql) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyParamsProxysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyParamsProxysql) UnmarshalBinary(b []byte) error { - var res CreatePXCClusterParamsBodyParamsProxysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePXCClusterParamsBodyParamsProxysqlComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model CreatePXCClusterParamsBodyParamsProxysqlComputeResources -*/ -type CreatePXCClusterParamsBodyParamsProxysqlComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// Validate validates this create PXC cluster params body params proxysql compute resources -func (o *CreatePXCClusterParamsBodyParamsProxysqlComputeResources) Validate(formats strfmt.Registry) error { - return nil -} - -// 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 *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 -} - -/* -CreatePXCClusterParamsBodyParamsRestore Restore represents restoration payload to restore a database cluster from backup -swagger:model CreatePXCClusterParamsBodyParamsRestore -*/ -type CreatePXCClusterParamsBodyParamsRestore struct { - // Backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Destination filename. - Destination string `json:"destination,omitempty"` - - // K8s Secrets name. - SecretsName string `json:"secrets_name,omitempty"` -} - -// Validate validates this create PXC cluster params body params restore -func (o *CreatePXCClusterParamsBodyParamsRestore) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this create PXC cluster params body params restore based on context it is used -func (o *CreatePXCClusterParamsBodyParamsRestore) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyParamsRestore) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyParamsRestore) UnmarshalBinary(b []byte) error { - var res CreatePXCClusterParamsBodyParamsRestore - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -CreatePXCClusterParamsBodyTemplate create PXC cluster params body template -swagger:model CreatePXCClusterParamsBodyTemplate -*/ -type CreatePXCClusterParamsBodyTemplate struct { - // Template CR name. - Name string `json:"name,omitempty"` - - // Template CR kind. - Kind string `json:"kind,omitempty"` -} - -// Validate validates this create PXC cluster params body template -func (o *CreatePXCClusterParamsBodyTemplate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this create PXC cluster params body template based on context it is used -func (o *CreatePXCClusterParamsBodyTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyTemplate) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CreatePXCClusterParamsBodyTemplate) UnmarshalBinary(b []byte) error { - var res CreatePXCClusterParamsBodyTemplate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} 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 deleted file mode 100644 index 7c4d2afb1e..0000000000 --- a/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_credentials_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package pxc_clusters - -// 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" -) - -// 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 { - return &GetPXCClusterCredentialsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetPXCClusterCredentialsParamsWithTimeout creates a new GetPXCClusterCredentialsParams object -// with the ability to set a timeout on a request. -func NewGetPXCClusterCredentialsParamsWithTimeout(timeout time.Duration) *GetPXCClusterCredentialsParams { - return &GetPXCClusterCredentialsParams{ - timeout: timeout, - } -} - -// NewGetPXCClusterCredentialsParamsWithContext creates a new GetPXCClusterCredentialsParams object -// with the ability to set a context for a request. -func NewGetPXCClusterCredentialsParamsWithContext(ctx context.Context) *GetPXCClusterCredentialsParams { - return &GetPXCClusterCredentialsParams{ - Context: ctx, - } -} - -// NewGetPXCClusterCredentialsParamsWithHTTPClient creates a new GetPXCClusterCredentialsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetPXCClusterCredentialsParamsWithHTTPClient(client *http.Client) *GetPXCClusterCredentialsParams { - 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. -*/ -type GetPXCClusterCredentialsParams struct { - // Body. - Body GetPXCClusterCredentialsBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the get PXC cluster credentials params -func (o *GetPXCClusterCredentialsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get PXC cluster credentials params -func (o *GetPXCClusterCredentialsParams) WithContext(ctx context.Context) *GetPXCClusterCredentialsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get PXC cluster credentials params -func (o *GetPXCClusterCredentialsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get PXC cluster credentials params -func (o *GetPXCClusterCredentialsParams) WithHTTPClient(client *http.Client) *GetPXCClusterCredentialsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get PXC cluster credentials params -func (o *GetPXCClusterCredentialsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get PXC cluster credentials params -func (o *GetPXCClusterCredentialsParams) WithBody(body GetPXCClusterCredentialsBody) *GetPXCClusterCredentialsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get PXC cluster credentials params -func (o *GetPXCClusterCredentialsParams) SetBody(body GetPXCClusterCredentialsBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetPXCClusterCredentialsParams) 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/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 deleted file mode 100644 index 6273b03f15..0000000000 --- a/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_credentials_responses.go +++ /dev/null @@ -1,435 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package pxc_clusters - -// 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" -) - -// GetPXCClusterCredentialsReader is a Reader for the GetPXCClusterCredentials structure. -type GetPXCClusterCredentialsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetPXCClusterCredentialsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetPXCClusterCredentialsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetPXCClusterCredentialsDefault(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 - } -} - -// NewGetPXCClusterCredentialsOK creates a GetPXCClusterCredentialsOK with default headers values -func NewGetPXCClusterCredentialsOK() *GetPXCClusterCredentialsOK { - return &GetPXCClusterCredentialsOK{} -} - -/* -GetPXCClusterCredentialsOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetPXCClusterCredentialsOK struct { - Payload *GetPXCClusterCredentialsOKBody -} - -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 -} - -func (o *GetPXCClusterCredentialsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetPXCClusterCredentialsOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetPXCClusterCredentialsDefault creates a GetPXCClusterCredentialsDefault with default headers values -func NewGetPXCClusterCredentialsDefault(code int) *GetPXCClusterCredentialsDefault { - return &GetPXCClusterCredentialsDefault{ - _statusCode: code, - } -} - -/* -GetPXCClusterCredentialsDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetPXCClusterCredentialsDefault struct { - _statusCode int - - Payload *GetPXCClusterCredentialsDefaultBody -} - -// Code gets the status code for the get PXC cluster credentials default response -func (o *GetPXCClusterCredentialsDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *GetPXCClusterCredentialsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetPXCClusterCredentialsDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -GetPXCClusterCredentialsBody get PXC cluster credentials body -swagger:model GetPXCClusterCredentialsBody -*/ -type GetPXCClusterCredentialsBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // PXC cluster name. - Name string `json:"name,omitempty"` -} - -// Validate validates this get PXC cluster credentials body -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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCClusterCredentialsBody) UnmarshalBinary(b []byte) error { - var res GetPXCClusterCredentialsBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPXCClusterCredentialsDefaultBody get PXC cluster credentials default body -swagger:model GetPXCClusterCredentialsDefaultBody -*/ -type GetPXCClusterCredentialsDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetPXCClusterCredentialsDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get PXC cluster credentials default body -func (o *GetPXCClusterCredentialsDefaultBody) 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 *GetPXCClusterCredentialsDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPXCClusterCredentialsDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCClusterCredentialsDefaultBody) UnmarshalBinary(b []byte) error { - var res GetPXCClusterCredentialsDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPXCClusterCredentialsDefaultBodyDetailsItems0 get PXC cluster credentials default body details items0 -swagger:model GetPXCClusterCredentialsDefaultBodyDetailsItems0 -*/ -type GetPXCClusterCredentialsDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 -*/ -type GetPXCClusterCredentialsOKBody struct { - // connection credentials - ConnectionCredentials *GetPXCClusterCredentialsOKBodyConnectionCredentials `json:"connection_credentials,omitempty"` -} - -// Validate validates this get PXC cluster credentials OK body -func (o *GetPXCClusterCredentialsOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateConnectionCredentials(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetPXCClusterCredentialsOKBody) validateConnectionCredentials(formats strfmt.Registry) error { - if swag.IsZero(o.ConnectionCredentials) { // not required - return nil - } - - if o.ConnectionCredentials != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPXCClusterCredentialsOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCClusterCredentialsOKBody) UnmarshalBinary(b []byte) error { - var res GetPXCClusterCredentialsOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPXCClusterCredentialsOKBodyConnectionCredentials PXCClusterConnectionCredentials is cluster connection credentials. -swagger:model GetPXCClusterCredentialsOKBodyConnectionCredentials -*/ -type GetPXCClusterCredentialsOKBodyConnectionCredentials struct { - // PXC username. - Username string `json:"username,omitempty"` - - // PXC password. - Password string `json:"password,omitempty"` - - // PXC host. - Host string `json:"host,omitempty"` - - // PXC port. - Port int32 `json:"port,omitempty"` -} - -// Validate validates this get PXC cluster credentials OK body connection credentials -func (o *GetPXCClusterCredentialsOKBodyConnectionCredentials) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCClusterCredentialsOKBodyConnectionCredentials) UnmarshalBinary(b []byte) error { - var res GetPXCClusterCredentialsOKBodyConnectionCredentials - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return 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 deleted file mode 100644 index 12e6ed514f..0000000000 --- a/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_resources_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package pxc_clusters - -// 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" -) - -// 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 { - return &GetPXCClusterResourcesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetPXCClusterResourcesParamsWithTimeout creates a new GetPXCClusterResourcesParams object -// with the ability to set a timeout on a request. -func NewGetPXCClusterResourcesParamsWithTimeout(timeout time.Duration) *GetPXCClusterResourcesParams { - return &GetPXCClusterResourcesParams{ - timeout: timeout, - } -} - -// NewGetPXCClusterResourcesParamsWithContext creates a new GetPXCClusterResourcesParams object -// with the ability to set a context for a request. -func NewGetPXCClusterResourcesParamsWithContext(ctx context.Context) *GetPXCClusterResourcesParams { - return &GetPXCClusterResourcesParams{ - Context: ctx, - } -} - -// NewGetPXCClusterResourcesParamsWithHTTPClient creates a new GetPXCClusterResourcesParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetPXCClusterResourcesParamsWithHTTPClient(client *http.Client) *GetPXCClusterResourcesParams { - 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. -*/ -type GetPXCClusterResourcesParams struct { - // Body. - Body GetPXCClusterResourcesBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the get PXC cluster resources params -func (o *GetPXCClusterResourcesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get PXC cluster resources params -func (o *GetPXCClusterResourcesParams) WithContext(ctx context.Context) *GetPXCClusterResourcesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get PXC cluster resources params -func (o *GetPXCClusterResourcesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get PXC cluster resources params -func (o *GetPXCClusterResourcesParams) WithHTTPClient(client *http.Client) *GetPXCClusterResourcesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get PXC cluster resources params -func (o *GetPXCClusterResourcesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the get PXC cluster resources params -func (o *GetPXCClusterResourcesParams) WithBody(body GetPXCClusterResourcesBody) *GetPXCClusterResourcesParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the get PXC cluster resources params -func (o *GetPXCClusterResourcesParams) SetBody(body GetPXCClusterResourcesBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *GetPXCClusterResourcesParams) 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/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 deleted file mode 100644 index 18085c7e9f..0000000000 --- a/api/managementpb/dbaas/json/client/pxc_clusters/get_pxc_cluster_resources_responses.go +++ /dev/null @@ -1,1254 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package pxc_clusters - -// 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" -) - -// GetPXCClusterResourcesReader is a Reader for the GetPXCClusterResources structure. -type GetPXCClusterResourcesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetPXCClusterResourcesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetPXCClusterResourcesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewGetPXCClusterResourcesDefault(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 - } -} - -// NewGetPXCClusterResourcesOK creates a GetPXCClusterResourcesOK with default headers values -func NewGetPXCClusterResourcesOK() *GetPXCClusterResourcesOK { - return &GetPXCClusterResourcesOK{} -} - -/* -GetPXCClusterResourcesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type GetPXCClusterResourcesOK struct { - Payload *GetPXCClusterResourcesOKBody -} - -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 -} - -func (o *GetPXCClusterResourcesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetPXCClusterResourcesOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetPXCClusterResourcesDefault creates a GetPXCClusterResourcesDefault with default headers values -func NewGetPXCClusterResourcesDefault(code int) *GetPXCClusterResourcesDefault { - return &GetPXCClusterResourcesDefault{ - _statusCode: code, - } -} - -/* -GetPXCClusterResourcesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type GetPXCClusterResourcesDefault struct { - _statusCode int - - Payload *GetPXCClusterResourcesDefaultBody -} - -// Code gets the status code for the get PXC cluster resources default response -func (o *GetPXCClusterResourcesDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *GetPXCClusterResourcesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(GetPXCClusterResourcesDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -GetPXCClusterResourcesBody get PXC cluster resources body -swagger:model GetPXCClusterResourcesBody -*/ -type GetPXCClusterResourcesBody struct { - // params - Params *GetPXCClusterResourcesParamsBodyParams `json:"params,omitempty"` -} - -// Validate validates this get PXC cluster resources body -func (o *GetPXCClusterResourcesBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateParams(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetPXCClusterResourcesBody) 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("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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPXCClusterResourcesBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCClusterResourcesBody) UnmarshalBinary(b []byte) error { - var res GetPXCClusterResourcesBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPXCClusterResourcesDefaultBody get PXC cluster resources default body -swagger:model GetPXCClusterResourcesDefaultBody -*/ -type GetPXCClusterResourcesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*GetPXCClusterResourcesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this get PXC cluster resources default body -func (o *GetPXCClusterResourcesDefaultBody) 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 *GetPXCClusterResourcesDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPXCClusterResourcesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCClusterResourcesDefaultBody) UnmarshalBinary(b []byte) error { - var res GetPXCClusterResourcesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPXCClusterResourcesDefaultBodyDetailsItems0 get PXC cluster resources default body details items0 -swagger:model GetPXCClusterResourcesDefaultBodyDetailsItems0 -*/ -type GetPXCClusterResourcesDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 -*/ -type GetPXCClusterResourcesOKBody struct { - // expected - Expected *GetPXCClusterResourcesOKBodyExpected `json:"expected,omitempty"` -} - -// Validate validates this get PXC cluster resources OK body -func (o *GetPXCClusterResourcesOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateExpected(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetPXCClusterResourcesOKBody) validateExpected(formats strfmt.Registry) error { - if swag.IsZero(o.Expected) { // not required - return nil - } - - if o.Expected != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPXCClusterResourcesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCClusterResourcesOKBody) UnmarshalBinary(b []byte) error { - var res GetPXCClusterResourcesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPXCClusterResourcesOKBodyExpected Resources contains Kubernetes cluster resources. -swagger:model GetPXCClusterResourcesOKBodyExpected -*/ -type GetPXCClusterResourcesOKBodyExpected struct { - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` - - // CPU in millicpus. For example 0.1 of CPU is equivalent to 100 millicpus. - // See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu. - CPUm string `json:"cpu_m,omitempty"` - - // Disk size in bytes. - DiskSize string `json:"disk_size,omitempty"` -} - -// Validate validates this get PXC cluster resources OK body expected -func (o *GetPXCClusterResourcesOKBodyExpected) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCClusterResourcesOKBodyExpected) UnmarshalBinary(b []byte) error { - var res GetPXCClusterResourcesOKBodyExpected - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPXCClusterResourcesParamsBodyParams PXCClusterParams represents PXC cluster parameters that can be updated. -swagger:model GetPXCClusterResourcesParamsBodyParams -*/ -type GetPXCClusterResourcesParamsBodyParams struct { - // Cluster size. - ClusterSize int32 `json:"cluster_size,omitempty"` - - // backup - Backup *GetPXCClusterResourcesParamsBodyParamsBackup `json:"backup,omitempty"` - - // haproxy - Haproxy *GetPXCClusterResourcesParamsBodyParamsHaproxy `json:"haproxy,omitempty"` - - // proxysql - Proxysql *GetPXCClusterResourcesParamsBodyParamsProxysql `json:"proxysql,omitempty"` - - // pxc - PXC *GetPXCClusterResourcesParamsBodyParamsPXC `json:"pxc,omitempty"` - - // restore - Restore *GetPXCClusterResourcesParamsBodyParamsRestore `json:"restore,omitempty"` -} - -// Validate validates this get PXC cluster resources params body params -func (o *GetPXCClusterResourcesParamsBodyParams) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateBackup(formats); err != nil { - res = append(res, err) - } - - if err := o.validateHaproxy(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePXC(formats); err != nil { - res = append(res, err) - } - - if err := o.validateRestore(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetPXCClusterResourcesParamsBodyParams) validateBackup(formats strfmt.Registry) error { - if swag.IsZero(o.Backup) { // not required - return nil - } - - if o.Backup != nil { - if err := o.Backup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + "backup") - } - return err - } - } - - return nil -} - -func (o *GetPXCClusterResourcesParamsBodyParams) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if o.Haproxy != nil { - if err := o.Haproxy.Validate(formats); err != nil { - 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) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if o.Proxysql != nil { - if err := o.Proxysql.Validate(formats); err != nil { - 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) validatePXC(formats strfmt.Registry) error { - if swag.IsZero(o.PXC) { // not required - return nil - } - - if o.PXC != nil { - 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 -} - -func (o *GetPXCClusterResourcesParamsBodyParams) validateRestore(formats strfmt.Registry) error { - if swag.IsZero(o.Restore) { // not required - return nil - } - - if o.Restore != nil { - if err := o.Restore.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + "restore") - } - 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.contextValidateBackup(ctx, formats); err != nil { - res = append(res, err) - } - - 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 err := o.contextValidateRestore(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetPXCClusterResourcesParamsBodyParams) contextValidateBackup(ctx context.Context, formats strfmt.Registry) error { - if o.Backup != nil { - if err := o.Backup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + "backup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + "backup") - } - return err - } - } - - 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 - } - } - - return nil -} - -func (o *GetPXCClusterResourcesParamsBodyParams) contextValidateRestore(ctx context.Context, formats strfmt.Registry) error { - if o.Restore != nil { - if err := o.Restore.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "params" + "." + "restore") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params" + "." + "restore") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPXCClusterResourcesParamsBodyParams) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCClusterResourcesParamsBodyParams) UnmarshalBinary(b []byte) error { - var res GetPXCClusterResourcesParamsBodyParams - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPXCClusterResourcesParamsBodyParamsBackup Backup configuration for a database cluster -swagger:model GetPXCClusterResourcesParamsBodyParamsBackup -*/ -type GetPXCClusterResourcesParamsBodyParamsBackup struct { - // Backup Location id of stored backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Keep copies represents how many copies should retain. - KeepCopies int32 `json:"keep_copies,omitempty"` - - // Cron expression represents cron expression - CronExpression string `json:"cron_expression,omitempty"` - - // Service acccount used for backups - ServiceAccount string `json:"service_account,omitempty"` -} - -// Validate validates this get PXC cluster resources params body params backup -func (o *GetPXCClusterResourcesParamsBodyParamsBackup) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get PXC cluster resources params body params backup based on context it is used -func (o *GetPXCClusterResourcesParamsBodyParamsBackup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetPXCClusterResourcesParamsBodyParamsBackup) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCClusterResourcesParamsBodyParamsBackup) UnmarshalBinary(b []byte) error { - var res GetPXCClusterResourcesParamsBodyParamsBackup - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPXCClusterResourcesParamsBodyParamsHaproxy HAProxy container parameters. -// NOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it. -swagger:model GetPXCClusterResourcesParamsBodyParamsHaproxy -*/ -type GetPXCClusterResourcesParamsBodyParamsHaproxy struct { - // Docker image used for HAProxy. - Image string `json:"image,omitempty"` - - // compute resources - ComputeResources *GetPXCClusterResourcesParamsBodyParamsHaproxyComputeResources `json:"compute_resources,omitempty"` -} - -// Validate validates this get PXC cluster resources params body params haproxy -func (o *GetPXCClusterResourcesParamsBodyParamsHaproxy) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateComputeResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetPXCClusterResourcesParamsBodyParamsHaproxy) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPXCClusterResourcesParamsBodyParamsHaproxy) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCClusterResourcesParamsBodyParamsHaproxy) UnmarshalBinary(b []byte) error { - var res GetPXCClusterResourcesParamsBodyParamsHaproxy - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPXCClusterResourcesParamsBodyParamsHaproxyComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model GetPXCClusterResourcesParamsBodyParamsHaproxyComputeResources -*/ -type GetPXCClusterResourcesParamsBodyParamsHaproxyComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// Validate validates this get PXC cluster resources params body params haproxy compute resources -func (o *GetPXCClusterResourcesParamsBodyParamsHaproxyComputeResources) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCClusterResourcesParamsBodyParamsHaproxyComputeResources) UnmarshalBinary(b []byte) error { - var res GetPXCClusterResourcesParamsBodyParamsHaproxyComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPXCClusterResourcesParamsBodyParamsPXC PXC container parameters. -// TODO Do not use inner messages in all public APIs (for consistency). -swagger:model GetPXCClusterResourcesParamsBodyParamsPXC -*/ -type GetPXCClusterResourcesParamsBodyParamsPXC struct { - // Docker image used for PXC. - Image string `json:"image,omitempty"` - - // Disk size in bytes. - DiskSize string `json:"disk_size,omitempty"` - - // Configuration for PXC cluster - Configuration string `json:"configuration,omitempty"` - - // Storage Class for PXC cluster. - StorageClass string `json:"storage_class,omitempty"` - - // compute resources - ComputeResources *GetPXCClusterResourcesParamsBodyParamsPXCComputeResources `json:"compute_resources,omitempty"` -} - -// Validate validates this get PXC cluster resources params body params PXC -func (o *GetPXCClusterResourcesParamsBodyParamsPXC) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateComputeResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetPXCClusterResourcesParamsBodyParamsPXC) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPXCClusterResourcesParamsBodyParamsPXC) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCClusterResourcesParamsBodyParamsPXC) UnmarshalBinary(b []byte) error { - var res GetPXCClusterResourcesParamsBodyParamsPXC - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPXCClusterResourcesParamsBodyParamsPXCComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model GetPXCClusterResourcesParamsBodyParamsPXCComputeResources -*/ -type GetPXCClusterResourcesParamsBodyParamsPXCComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// Validate validates this get PXC cluster resources params body params PXC compute resources -func (o *GetPXCClusterResourcesParamsBodyParamsPXCComputeResources) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCClusterResourcesParamsBodyParamsPXCComputeResources) UnmarshalBinary(b []byte) error { - var res GetPXCClusterResourcesParamsBodyParamsPXCComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPXCClusterResourcesParamsBodyParamsProxysql ProxySQL container parameters. -// TODO Do not use inner messages in all public APIs (for consistency). -swagger:model GetPXCClusterResourcesParamsBodyParamsProxysql -*/ -type GetPXCClusterResourcesParamsBodyParamsProxysql struct { - // Docker image used for ProxySQL. - Image string `json:"image,omitempty"` - - // Disk size in bytes. - DiskSize string `json:"disk_size,omitempty"` - - // compute resources - ComputeResources *GetPXCClusterResourcesParamsBodyParamsProxysqlComputeResources `json:"compute_resources,omitempty"` -} - -// Validate validates this get PXC cluster resources params body params proxysql -func (o *GetPXCClusterResourcesParamsBodyParamsProxysql) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateComputeResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetPXCClusterResourcesParamsBodyParamsProxysql) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *GetPXCClusterResourcesParamsBodyParamsProxysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCClusterResourcesParamsBodyParamsProxysql) UnmarshalBinary(b []byte) error { - var res GetPXCClusterResourcesParamsBodyParamsProxysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPXCClusterResourcesParamsBodyParamsProxysqlComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model GetPXCClusterResourcesParamsBodyParamsProxysqlComputeResources -*/ -type GetPXCClusterResourcesParamsBodyParamsProxysqlComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// Validate validates this get PXC cluster resources params body params proxysql compute resources -func (o *GetPXCClusterResourcesParamsBodyParamsProxysqlComputeResources) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCClusterResourcesParamsBodyParamsProxysqlComputeResources) UnmarshalBinary(b []byte) error { - var res GetPXCClusterResourcesParamsBodyParamsProxysqlComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -GetPXCClusterResourcesParamsBodyParamsRestore Restore represents restoration payload to restore a database cluster from backup -swagger:model GetPXCClusterResourcesParamsBodyParamsRestore -*/ -type GetPXCClusterResourcesParamsBodyParamsRestore struct { - // Backup location in PMM. - LocationID string `json:"location_id,omitempty"` - - // Destination filename. - Destination string `json:"destination,omitempty"` - - // K8s Secrets name. - SecretsName string `json:"secrets_name,omitempty"` -} - -// Validate validates this get PXC cluster resources params body params restore -func (o *GetPXCClusterResourcesParamsBodyParamsRestore) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this get PXC cluster resources params body params restore based on context it is used -func (o *GetPXCClusterResourcesParamsBodyParamsRestore) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetPXCClusterResourcesParamsBodyParamsRestore) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetPXCClusterResourcesParamsBodyParamsRestore) UnmarshalBinary(b []byte) error { - var res GetPXCClusterResourcesParamsBodyParamsRestore - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return 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 deleted file mode 100644 index 42f0d9fa72..0000000000 --- a/api/managementpb/dbaas/json/client/pxc_clusters/pxc_clusters_client.go +++ /dev/null @@ -1,193 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package pxc_clusters - -// 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 pxc clusters API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for pxc clusters 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 { - CreatePXCCluster(params *CreatePXCClusterParams, opts ...ClientOption) (*CreatePXCClusterOK, error) - - GetPXCClusterCredentials(params *GetPXCClusterCredentialsParams, opts ...ClientOption) (*GetPXCClusterCredentialsOK, error) - - GetPXCClusterResources(params *GetPXCClusterResourcesParams, opts ...ClientOption) (*GetPXCClusterResourcesOK, error) - - UpdatePXCCluster(params *UpdatePXCClusterParams, opts ...ClientOption) (*UpdatePXCClusterOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -CreatePXCCluster creates PXC cluster creates a new PXC cluster -*/ -func (a *Client) CreatePXCCluster(params *CreatePXCClusterParams, opts ...ClientOption) (*CreatePXCClusterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreatePXCClusterParams() - } - op := &runtime.ClientOperation{ - ID: "CreatePXCCluster", - Method: "POST", - PathPattern: "/v1/management/DBaaS/PXCCluster/Create", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*CreatePXCClusterOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*CreatePXCClusterDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetPXCClusterCredentials gets PXC cluster credentials returns a PXC cluster credentials by cluster name -*/ -func (a *Client) GetPXCClusterCredentials(params *GetPXCClusterCredentialsParams, opts ...ClientOption) (*GetPXCClusterCredentialsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetPXCClusterCredentialsParams() - } - op := &runtime.ClientOperation{ - ID: "GetPXCClusterCredentials", - Method: "POST", - PathPattern: "/v1/management/DBaaS/PXCClusters/GetCredentials", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*GetPXCClusterCredentialsOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetPXCClusterCredentialsDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -GetPXCClusterResources gets PXC cluster resources returns expected resources to be consumed by the cluster -*/ -func (a *Client) GetPXCClusterResources(params *GetPXCClusterResourcesParams, opts ...ClientOption) (*GetPXCClusterResourcesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetPXCClusterResourcesParams() - } - op := &runtime.ClientOperation{ - ID: "GetPXCClusterResources", - Method: "POST", - PathPattern: "/v1/management/DBaaS/PXCCluster/Resources/Get", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*GetPXCClusterResourcesOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*GetPXCClusterResourcesDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) -} - -/* -UpdatePXCCluster updates PXC cluster updates existing PXC cluster -*/ -func (a *Client) UpdatePXCCluster(params *UpdatePXCClusterParams, opts ...ClientOption) (*UpdatePXCClusterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdatePXCClusterParams() - } - op := &runtime.ClientOperation{ - ID: "UpdatePXCCluster", - Method: "POST", - PathPattern: "/v1/management/DBaaS/PXCCluster/Update", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - 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 - } - success, ok := result.(*UpdatePXCClusterOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*UpdatePXCClusterDefault) - 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/managementpb/dbaas/json/client/pxc_clusters/update_pxc_cluster_parameters.go b/api/managementpb/dbaas/json/client/pxc_clusters/update_pxc_cluster_parameters.go deleted file mode 100644 index 61a4122345..0000000000 --- a/api/managementpb/dbaas/json/client/pxc_clusters/update_pxc_cluster_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package pxc_clusters - -// 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" -) - -// 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 { - return &UpdatePXCClusterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdatePXCClusterParamsWithTimeout creates a new UpdatePXCClusterParams object -// with the ability to set a timeout on a request. -func NewUpdatePXCClusterParamsWithTimeout(timeout time.Duration) *UpdatePXCClusterParams { - return &UpdatePXCClusterParams{ - timeout: timeout, - } -} - -// NewUpdatePXCClusterParamsWithContext creates a new UpdatePXCClusterParams object -// with the ability to set a context for a request. -func NewUpdatePXCClusterParamsWithContext(ctx context.Context) *UpdatePXCClusterParams { - return &UpdatePXCClusterParams{ - Context: ctx, - } -} - -// NewUpdatePXCClusterParamsWithHTTPClient creates a new UpdatePXCClusterParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdatePXCClusterParamsWithHTTPClient(client *http.Client) *UpdatePXCClusterParams { - 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. -*/ -type UpdatePXCClusterParams struct { - // Body. - Body UpdatePXCClusterBody - - timeout time.Duration - Context context.Context - 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) - return o -} - -// SetTimeout adds the timeout to the update PXC cluster params -func (o *UpdatePXCClusterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update PXC cluster params -func (o *UpdatePXCClusterParams) WithContext(ctx context.Context) *UpdatePXCClusterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update PXC cluster params -func (o *UpdatePXCClusterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update PXC cluster params -func (o *UpdatePXCClusterParams) WithHTTPClient(client *http.Client) *UpdatePXCClusterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update PXC cluster params -func (o *UpdatePXCClusterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the update PXC cluster params -func (o *UpdatePXCClusterParams) WithBody(body UpdatePXCClusterBody) *UpdatePXCClusterParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update PXC cluster params -func (o *UpdatePXCClusterParams) SetBody(body UpdatePXCClusterBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdatePXCClusterParams) 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/managementpb/dbaas/json/client/pxc_clusters/update_pxc_cluster_responses.go b/api/managementpb/dbaas/json/client/pxc_clusters/update_pxc_cluster_responses.go deleted file mode 100644 index 592abcab9e..0000000000 --- a/api/managementpb/dbaas/json/client/pxc_clusters/update_pxc_cluster_responses.go +++ /dev/null @@ -1,1032 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package pxc_clusters - -// 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" -) - -// UpdatePXCClusterReader is a Reader for the UpdatePXCCluster structure. -type UpdatePXCClusterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdatePXCClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdatePXCClusterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewUpdatePXCClusterDefault(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 - } -} - -// NewUpdatePXCClusterOK creates a UpdatePXCClusterOK with default headers values -func NewUpdatePXCClusterOK() *UpdatePXCClusterOK { - return &UpdatePXCClusterOK{} -} - -/* -UpdatePXCClusterOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type UpdatePXCClusterOK struct { - Payload interface{} -} - -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 -} - -func (o *UpdatePXCClusterOK) 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 -} - -// NewUpdatePXCClusterDefault creates a UpdatePXCClusterDefault with default headers values -func NewUpdatePXCClusterDefault(code int) *UpdatePXCClusterDefault { - return &UpdatePXCClusterDefault{ - _statusCode: code, - } -} - -/* -UpdatePXCClusterDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type UpdatePXCClusterDefault struct { - _statusCode int - - Payload *UpdatePXCClusterDefaultBody -} - -// Code gets the status code for the update PXC cluster default response -func (o *UpdatePXCClusterDefault) Code() int { - return o._statusCode -} - -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 -} - -func (o *UpdatePXCClusterDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(UpdatePXCClusterDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -UpdatePXCClusterBody update PXC cluster body -swagger:model UpdatePXCClusterBody -*/ -type UpdatePXCClusterBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // PXC cluster name. - Name string `json:"name,omitempty"` - - // Make DB cluster accessible outside of K8s cluster. - Expose bool `json:"expose,omitempty"` - - // Make DB cluster accessible via public internet. - InternetFacing bool `json:"internet_facing,omitempty"` - - // Apply IP source ranges against the cluster. - SourceRanges []string `json:"source_ranges"` - - // params - Params *UpdatePXCClusterParamsBodyParams `json:"params,omitempty"` - - // template - Template *UpdatePXCClusterParamsBodyTemplate `json:"template,omitempty"` -} - -// Validate validates this update PXC cluster body -func (o *UpdatePXCClusterBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateParams(formats); err != nil { - res = append(res, err) - } - - if err := o.validateTemplate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *UpdatePXCClusterBody) 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("body" + "." + "params") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "params") - } - return err - } - } - - return nil -} - -func (o *UpdatePXCClusterBody) validateTemplate(formats strfmt.Registry) error { - if swag.IsZero(o.Template) { // not required - return nil - } - - if o.Template != nil { - if err := o.Template.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "template") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "template") - } - 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 err := o.contextValidateTemplate(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 - } - } - - return nil -} - -func (o *UpdatePXCClusterBody) contextValidateTemplate(ctx context.Context, formats strfmt.Registry) error { - if o.Template != nil { - if err := o.Template.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("body" + "." + "template") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("body" + "." + "template") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UpdatePXCClusterBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdatePXCClusterBody) UnmarshalBinary(b []byte) error { - var res UpdatePXCClusterBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdatePXCClusterDefaultBody update PXC cluster default body -swagger:model UpdatePXCClusterDefaultBody -*/ -type UpdatePXCClusterDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*UpdatePXCClusterDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this update PXC cluster default body -func (o *UpdatePXCClusterDefaultBody) 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 *UpdatePXCClusterDefaultBody) 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("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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UpdatePXCClusterDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdatePXCClusterDefaultBody) UnmarshalBinary(b []byte) error { - var res UpdatePXCClusterDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdatePXCClusterDefaultBodyDetailsItems0 update PXC cluster default body details items0 -swagger:model UpdatePXCClusterDefaultBodyDetailsItems0 -*/ -type UpdatePXCClusterDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,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 -*/ -type UpdatePXCClusterParamsBodyParams struct { - // Cluster size. - ClusterSize int32 `json:"cluster_size,omitempty"` - - // Suspend cluster `pause: true`. - Suspend bool `json:"suspend,omitempty"` - - // Resume cluster `pause: false`. - Resume bool `json:"resume,omitempty"` - - // haproxy - Haproxy *UpdatePXCClusterParamsBodyParamsHaproxy `json:"haproxy,omitempty"` - - // proxysql - Proxysql *UpdatePXCClusterParamsBodyParamsProxysql `json:"proxysql,omitempty"` - - // pxc - PXC *UpdatePXCClusterParamsBodyParamsPXC `json:"pxc,omitempty"` -} - -// Validate validates this update PXC cluster params body params -func (o *UpdatePXCClusterParamsBodyParams) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateHaproxy(formats); err != nil { - res = append(res, err) - } - - if err := o.validateProxysql(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePXC(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *UpdatePXCClusterParamsBodyParams) validateHaproxy(formats strfmt.Registry) error { - if swag.IsZero(o.Haproxy) { // not required - return nil - } - - if o.Haproxy != nil { - if err := o.Haproxy.Validate(formats); err != nil { - 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) validateProxysql(formats strfmt.Registry) error { - if swag.IsZero(o.Proxysql) { // not required - return nil - } - - if o.Proxysql != nil { - if err := o.Proxysql.Validate(formats); err != nil { - 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) validatePXC(formats strfmt.Registry) error { - if swag.IsZero(o.PXC) { // not required - return nil - } - - if o.PXC != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UpdatePXCClusterParamsBodyParams) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdatePXCClusterParamsBodyParams) UnmarshalBinary(b []byte) error { - var res UpdatePXCClusterParamsBodyParams - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdatePXCClusterParamsBodyParamsHaproxy HAProxy container parameters. -swagger:model UpdatePXCClusterParamsBodyParamsHaproxy -*/ -type UpdatePXCClusterParamsBodyParamsHaproxy struct { - // compute resources - ComputeResources *UpdatePXCClusterParamsBodyParamsHaproxyComputeResources `json:"compute_resources,omitempty"` -} - -// Validate validates this update PXC cluster params body params haproxy -func (o *UpdatePXCClusterParamsBodyParamsHaproxy) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateComputeResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *UpdatePXCClusterParamsBodyParamsHaproxy) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UpdatePXCClusterParamsBodyParamsHaproxy) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdatePXCClusterParamsBodyParamsHaproxy) UnmarshalBinary(b []byte) error { - var res UpdatePXCClusterParamsBodyParamsHaproxy - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdatePXCClusterParamsBodyParamsHaproxyComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model UpdatePXCClusterParamsBodyParamsHaproxyComputeResources -*/ -type UpdatePXCClusterParamsBodyParamsHaproxyComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// Validate validates this update PXC cluster params body params haproxy compute resources -func (o *UpdatePXCClusterParamsBodyParamsHaproxyComputeResources) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdatePXCClusterParamsBodyParamsHaproxyComputeResources) UnmarshalBinary(b []byte) error { - var res UpdatePXCClusterParamsBodyParamsHaproxyComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdatePXCClusterParamsBodyParamsPXC PXC container parameters. -swagger:model UpdatePXCClusterParamsBodyParamsPXC -*/ -type UpdatePXCClusterParamsBodyParamsPXC struct { - // Image to use. If it's the same image but with different version tag, upgrade of database cluster to version - // in given tag is triggered. If entirely different image is given, error is returned. - Image string `json:"image,omitempty"` - - // Configuration for PXC cluster - Configuration string `json:"configuration,omitempty"` - - // Storage Class for PXC cluster. - StorageClass string `json:"storage_class,omitempty"` - - // compute resources - ComputeResources *UpdatePXCClusterParamsBodyParamsPXCComputeResources `json:"compute_resources,omitempty"` -} - -// Validate validates this update PXC cluster params body params PXC -func (o *UpdatePXCClusterParamsBodyParamsPXC) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateComputeResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *UpdatePXCClusterParamsBodyParamsPXC) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UpdatePXCClusterParamsBodyParamsPXC) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdatePXCClusterParamsBodyParamsPXC) UnmarshalBinary(b []byte) error { - var res UpdatePXCClusterParamsBodyParamsPXC - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdatePXCClusterParamsBodyParamsPXCComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model UpdatePXCClusterParamsBodyParamsPXCComputeResources -*/ -type UpdatePXCClusterParamsBodyParamsPXCComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// Validate validates this update PXC cluster params body params PXC compute resources -func (o *UpdatePXCClusterParamsBodyParamsPXCComputeResources) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdatePXCClusterParamsBodyParamsPXCComputeResources) UnmarshalBinary(b []byte) error { - var res UpdatePXCClusterParamsBodyParamsPXCComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdatePXCClusterParamsBodyParamsProxysql ProxySQL container parameters. -swagger:model UpdatePXCClusterParamsBodyParamsProxysql -*/ -type UpdatePXCClusterParamsBodyParamsProxysql struct { - // compute resources - ComputeResources *UpdatePXCClusterParamsBodyParamsProxysqlComputeResources `json:"compute_resources,omitempty"` -} - -// Validate validates this update PXC cluster params body params proxysql -func (o *UpdatePXCClusterParamsBodyParamsProxysql) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateComputeResources(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *UpdatePXCClusterParamsBodyParamsProxysql) validateComputeResources(formats strfmt.Registry) error { - if swag.IsZero(o.ComputeResources) { // not required - return nil - } - - if o.ComputeResources != nil { - 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 - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *UpdatePXCClusterParamsBodyParamsProxysql) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdatePXCClusterParamsBodyParamsProxysql) UnmarshalBinary(b []byte) error { - var res UpdatePXCClusterParamsBodyParamsProxysql - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdatePXCClusterParamsBodyParamsProxysqlComputeResources ComputeResources represents container computer resources requests or limits. -swagger:model UpdatePXCClusterParamsBodyParamsProxysqlComputeResources -*/ -type UpdatePXCClusterParamsBodyParamsProxysqlComputeResources struct { - // CPUs in milliCPUs; 1000m = 1 vCPU. - CPUm int32 `json:"cpu_m,omitempty"` - - // Memory in bytes. - MemoryBytes string `json:"memory_bytes,omitempty"` -} - -// Validate validates this update PXC cluster params body params proxysql compute resources -func (o *UpdatePXCClusterParamsBodyParamsProxysqlComputeResources) Validate(formats strfmt.Registry) error { - 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 { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdatePXCClusterParamsBodyParamsProxysqlComputeResources) UnmarshalBinary(b []byte) error { - var res UpdatePXCClusterParamsBodyParamsProxysqlComputeResources - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -UpdatePXCClusterParamsBodyTemplate update PXC cluster params body template -swagger:model UpdatePXCClusterParamsBodyTemplate -*/ -type UpdatePXCClusterParamsBodyTemplate struct { - // Template CR name. - Name string `json:"name,omitempty"` - - // Template CR kind. - Kind string `json:"kind,omitempty"` -} - -// Validate validates this update PXC cluster params body template -func (o *UpdatePXCClusterParamsBodyTemplate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this update PXC cluster params body template based on context it is used -func (o *UpdatePXCClusterParamsBodyTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdatePXCClusterParamsBodyTemplate) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdatePXCClusterParamsBodyTemplate) UnmarshalBinary(b []byte) error { - var res UpdatePXCClusterParamsBodyTemplate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/dbaas/json/client/templates/list_templates_parameters.go b/api/managementpb/dbaas/json/client/templates/list_templates_parameters.go deleted file mode 100644 index 1c089951ab..0000000000 --- a/api/managementpb/dbaas/json/client/templates/list_templates_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package templates - -// 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" -) - -// NewListTemplatesParams creates a new ListTemplatesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListTemplatesParams() *ListTemplatesParams { - return &ListTemplatesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListTemplatesParamsWithTimeout creates a new ListTemplatesParams object -// with the ability to set a timeout on a request. -func NewListTemplatesParamsWithTimeout(timeout time.Duration) *ListTemplatesParams { - return &ListTemplatesParams{ - timeout: timeout, - } -} - -// NewListTemplatesParamsWithContext creates a new ListTemplatesParams object -// with the ability to set a context for a request. -func NewListTemplatesParamsWithContext(ctx context.Context) *ListTemplatesParams { - return &ListTemplatesParams{ - Context: ctx, - } -} - -// NewListTemplatesParamsWithHTTPClient creates a new ListTemplatesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListTemplatesParamsWithHTTPClient(client *http.Client) *ListTemplatesParams { - return &ListTemplatesParams{ - HTTPClient: client, - } -} - -/* -ListTemplatesParams contains all the parameters to send to the API endpoint - - for the list templates operation. - - Typically these are written to a http.Request. -*/ -type ListTemplatesParams struct { - // Body. - Body ListTemplatesBody - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list templates params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListTemplatesParams) WithDefaults() *ListTemplatesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list templates params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListTemplatesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list templates params -func (o *ListTemplatesParams) WithTimeout(timeout time.Duration) *ListTemplatesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list templates params -func (o *ListTemplatesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list templates params -func (o *ListTemplatesParams) WithContext(ctx context.Context) *ListTemplatesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list templates params -func (o *ListTemplatesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list templates params -func (o *ListTemplatesParams) WithHTTPClient(client *http.Client) *ListTemplatesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list templates params -func (o *ListTemplatesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the list templates params -func (o *ListTemplatesParams) WithBody(body ListTemplatesBody) *ListTemplatesParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the list templates params -func (o *ListTemplatesParams) SetBody(body ListTemplatesBody) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ListTemplatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/api/managementpb/dbaas/json/client/templates/list_templates_responses.go b/api/managementpb/dbaas/json/client/templates/list_templates_responses.go deleted file mode 100644 index 38746d2456..0000000000 --- a/api/managementpb/dbaas/json/client/templates/list_templates_responses.go +++ /dev/null @@ -1,499 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package templates - -// 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" -) - -// ListTemplatesReader is a Reader for the ListTemplates structure. -type ListTemplatesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListTemplatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListTemplatesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewListTemplatesDefault(response.Code()) - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - if response.Code()/100 == 2 { - return result, nil - } - return nil, result - } -} - -// NewListTemplatesOK creates a ListTemplatesOK with default headers values -func NewListTemplatesOK() *ListTemplatesOK { - return &ListTemplatesOK{} -} - -/* -ListTemplatesOK describes a response with status code 200, with default header values. - -A successful response. -*/ -type ListTemplatesOK struct { - Payload *ListTemplatesOKBody -} - -func (o *ListTemplatesOK) Error() string { - return fmt.Sprintf("[POST /v1/management/DBaaS/Templates/List][%d] listTemplatesOk %+v", 200, o.Payload) -} - -func (o *ListTemplatesOK) GetPayload() *ListTemplatesOKBody { - return o.Payload -} - -func (o *ListTemplatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListTemplatesOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListTemplatesDefault creates a ListTemplatesDefault with default headers values -func NewListTemplatesDefault(code int) *ListTemplatesDefault { - return &ListTemplatesDefault{ - _statusCode: code, - } -} - -/* -ListTemplatesDefault describes a response with status code -1, with default header values. - -An unexpected error response. -*/ -type ListTemplatesDefault struct { - _statusCode int - - Payload *ListTemplatesDefaultBody -} - -// Code gets the status code for the list templates default response -func (o *ListTemplatesDefault) Code() int { - return o._statusCode -} - -func (o *ListTemplatesDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/DBaaS/Templates/List][%d] ListTemplates default %+v", o._statusCode, o.Payload) -} - -func (o *ListTemplatesDefault) GetPayload() *ListTemplatesDefaultBody { - return o.Payload -} - -func (o *ListTemplatesDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(ListTemplatesDefaultBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -/* -ListTemplatesBody list templates body -swagger:model ListTemplatesBody -*/ -type ListTemplatesBody struct { - // Kubernetes cluster name. - KubernetesClusterName string `json:"kubernetes_cluster_name,omitempty"` - - // DBClusterType represents database cluster type. - // - // - DB_CLUSTER_TYPE_INVALID: DB_CLUSTER_TYPE_INVALID represents unknown cluster type. - // - DB_CLUSTER_TYPE_PXC: DB_CLUSTER_TYPE_PXC represents pxc cluster type. - // - DB_CLUSTER_TYPE_PSMDB: DB_CLUSTER_TYPE_PSMDB represents psmdb cluster type. - // Enum: [DB_CLUSTER_TYPE_INVALID DB_CLUSTER_TYPE_PXC DB_CLUSTER_TYPE_PSMDB] - ClusterType *string `json:"cluster_type,omitempty"` -} - -// Validate validates this list templates body -func (o *ListTemplatesBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateClusterType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var listTemplatesBodyTypeClusterTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DB_CLUSTER_TYPE_INVALID","DB_CLUSTER_TYPE_PXC","DB_CLUSTER_TYPE_PSMDB"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listTemplatesBodyTypeClusterTypePropEnum = append(listTemplatesBodyTypeClusterTypePropEnum, v) - } -} - -const ( - - // ListTemplatesBodyClusterTypeDBCLUSTERTYPEINVALID captures enum value "DB_CLUSTER_TYPE_INVALID" - ListTemplatesBodyClusterTypeDBCLUSTERTYPEINVALID string = "DB_CLUSTER_TYPE_INVALID" - - // ListTemplatesBodyClusterTypeDBCLUSTERTYPEPXC captures enum value "DB_CLUSTER_TYPE_PXC" - ListTemplatesBodyClusterTypeDBCLUSTERTYPEPXC string = "DB_CLUSTER_TYPE_PXC" - - // ListTemplatesBodyClusterTypeDBCLUSTERTYPEPSMDB captures enum value "DB_CLUSTER_TYPE_PSMDB" - ListTemplatesBodyClusterTypeDBCLUSTERTYPEPSMDB string = "DB_CLUSTER_TYPE_PSMDB" -) - -// prop value enum -func (o *ListTemplatesBody) validateClusterTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listTemplatesBodyTypeClusterTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ListTemplatesBody) validateClusterType(formats strfmt.Registry) error { - if swag.IsZero(o.ClusterType) { // not required - return nil - } - - // value enum - if err := o.validateClusterTypeEnum("body"+"."+"cluster_type", "body", *o.ClusterType); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this list templates body based on context it is used -func (o *ListTemplatesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListTemplatesBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListTemplatesBody) UnmarshalBinary(b []byte) error { - var res ListTemplatesBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListTemplatesDefaultBody list templates default body -swagger:model ListTemplatesDefaultBody -*/ -type ListTemplatesDefaultBody struct { - // code - Code int32 `json:"code,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // details - Details []*ListTemplatesDefaultBodyDetailsItems0 `json:"details"` -} - -// Validate validates this list templates default body -func (o *ListTemplatesDefaultBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateDetails(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListTemplatesDefaultBody) validateDetails(formats strfmt.Registry) error { - if swag.IsZero(o.Details) { // not required - return nil - } - - for i := 0; i < len(o.Details); i++ { - if swag.IsZero(o.Details[i]) { // not required - continue - } - - if o.Details[i] != nil { - if err := o.Details[i].Validate(formats); err != nil { - 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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListTemplatesDefaultBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListTemplatesDefaultBody) UnmarshalBinary(b []byte) error { - var res ListTemplatesDefaultBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListTemplatesDefaultBodyDetailsItems0 list templates default body details items0 -swagger:model ListTemplatesDefaultBodyDetailsItems0 -*/ -type ListTemplatesDefaultBodyDetailsItems0 struct { - // at type - AtType string `json:"@type,omitempty"` -} - -// 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 []*ListTemplatesOKBodyTemplatesItems0 `json:"templates"` -} - -// Validate validates this list templates OK body -func (o *ListTemplatesOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateTemplates(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListTemplatesOKBody) validateTemplates(formats strfmt.Registry) error { - if swag.IsZero(o.Templates) { // not required - return nil - } - - for i := 0; i < len(o.Templates); i++ { - if swag.IsZero(o.Templates[i]) { // not required - continue - } - - if o.Templates[i] != nil { - if err := o.Templates[i].Validate(formats); err != nil { - 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 - } - } - - } - - return nil -} - -// ContextValidate validate this list templates OK body based on the context it is used -func (o *ListTemplatesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := o.contextValidateTemplates(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ListTemplatesOKBody) contextValidateTemplates(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(o.Templates); i++ { - if o.Templates[i] != nil { - if 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 - } - } - } - - return nil -} - -// MarshalBinary interface implementation -func (o *ListTemplatesOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListTemplatesOKBody) UnmarshalBinary(b []byte) error { - var res ListTemplatesOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - -/* -ListTemplatesOKBodyTemplatesItems0 list templates OK body templates items0 -swagger:model ListTemplatesOKBodyTemplatesItems0 -*/ -type ListTemplatesOKBodyTemplatesItems0 struct { - // Template CR name. - Name string `json:"name,omitempty"` - - // Template CR kind. - Kind string `json:"kind,omitempty"` -} - -// Validate validates this list templates OK body templates items0 -func (o *ListTemplatesOKBodyTemplatesItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list templates OK body templates items0 based on context it is used -func (o *ListTemplatesOKBodyTemplatesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ListTemplatesOKBodyTemplatesItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ListTemplatesOKBodyTemplatesItems0) UnmarshalBinary(b []byte) error { - var res ListTemplatesOKBodyTemplatesItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/api/managementpb/dbaas/json/client/templates/templates_client.go b/api/managementpb/dbaas/json/client/templates/templates_client.go deleted file mode 100644 index a26de103cd..0000000000 --- a/api/managementpb/dbaas/json/client/templates/templates_client.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package templates - -// 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 templates API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for templates 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 { - ListTemplates(params *ListTemplatesParams, opts ...ClientOption) (*ListTemplatesOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -ListTemplates lists templates returns a list of all registered templates -*/ -func (a *Client) ListTemplates(params *ListTemplatesParams, opts ...ClientOption) (*ListTemplatesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListTemplatesParams() - } - op := &runtime.ClientOperation{ - ID: "ListTemplates", - Method: "POST", - PathPattern: "/v1/management/DBaaS/Templates/List", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &ListTemplatesReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListTemplatesOK) - if ok { - return success, nil - } - // unexpected success response - unexpectedSuccess := result.(*ListTemplatesDefault) - 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/managementpb/dbaas/json/dbaas.json b/api/managementpb/dbaas/json/dbaas.json deleted file mode 100644 index 2dc661b9c2..0000000000 --- a/api/managementpb/dbaas/json/dbaas.json +++ /dev/null @@ -1,5187 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https", - "http" - ], - "swagger": "2.0", - "info": { - "title": "PMM DBaaS API", - "version": "v1beta1" - }, - "paths": { - "/v1/management/DBaaS/Backups/List": { - "post": { - "tags": [ - "DBClusters" - ], - "summary": "ListS3Backups lists backups stored on s3.", - "operationId": "ListS3Backups", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "location_id": { - "type": "string", - "title": "Backup Location ID to list backups from", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "backups": { - "description": "Backup list.", - "type": "array", - "items": { - "type": "object", - "properties": { - "key": { - "description": "Key of a filename on s3.", - "type": "string", - "x-order": 0 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/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": { - "disable": { - "type": "boolean", - "x-order": 1 - }, - "enable": { - "type": "boolean", - "x-order": 2 - }, - "version": { - "type": "string", - "x-order": 0 - } - } - }, - "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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/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": { - "disable": { - "type": "boolean", - "x-order": 1 - }, - "enable": { - "type": "boolean", - "x-order": 2 - }, - "version": { - "type": "string", - "x-order": 0 - } - } - }, - "x-order": 1 - } - }, - "x-order": 3 - }, - "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": { - "disable": { - "type": "boolean", - "x-order": 1 - }, - "enable": { - "type": "boolean", - "x-order": 2 - }, - "version": { - "type": "string", - "x-order": 0 - } - } - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "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": { - "disable": { - "type": "boolean", - "x-order": 1 - }, - "enable": { - "type": "boolean", - "x-order": 2 - }, - "version": { - "type": "string", - "x-order": 0 - } - } - }, - "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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/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": { - "db_version": { - "description": "Version of DB.", - "type": "string", - "x-order": 1 - }, - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "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": { - "backup": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "image_path": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 5 - }, - "haproxy": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "image_path": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 4 - }, - "log_collector": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "image_path": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 7 - }, - "mongod": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "image_path": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 0 - }, - "operator": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "image_path": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 6 - }, - "pmm": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "image_path": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 2 - }, - "proxysql": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "image_path": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 3 - }, - "pxc": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "image_path": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "operator": { - "type": "string", - "x-order": 1 - }, - "product": { - "type": "string", - "x-order": 0 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/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": { - "db_version": { - "description": "Version of DB.", - "type": "string", - "x-order": 1 - }, - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "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": { - "backup": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "image_path": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 5 - }, - "haproxy": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "image_path": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 4 - }, - "log_collector": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "image_path": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 7 - }, - "mongod": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "image_path": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 0 - }, - "operator": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "image_path": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 6 - }, - "pmm": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "image_path": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 2 - }, - "proxysql": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "image_path": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 3 - }, - "pxc": { - "type": "object", - "additionalProperties": { - "description": "Component contains information about component.", - "type": "object", - "properties": { - "critical": { - "type": "boolean", - "x-order": 3 - }, - "default": { - "type": "boolean", - "x-order": 4 - }, - "disabled": { - "type": "boolean", - "x-order": 5 - }, - "image_hash": { - "type": "string", - "x-order": 1 - }, - "image_path": { - "type": "string", - "x-order": 0 - }, - "status": { - "type": "string", - "x-order": 2 - } - } - }, - "x-order": 1 - } - }, - "x-order": 2 - }, - "operator": { - "type": "string", - "x-order": 1 - }, - "product": { - "type": "string", - "x-order": 0 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/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" - ], - "x-order": 2 - }, - "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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/DBClusters/Get": { - "post": { - "tags": [ - "DBClusters" - ], - "summary": "GetDBCluster returns parameters used to create a database cluster", - "operationId": "GetDBCluster", - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "psmdb_cluster": { - "description": "PSMDBCluster represents PSMDB cluster information.", - "type": "object", - "properties": { - "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 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 8 - }, - "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 - }, - "internet_facing": { - "description": "Is DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 7 - }, - "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 - } - }, - "x-order": 2 - }, - "params": { - "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", - "type": "object", - "properties": { - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 3 - }, - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - }, - "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 - }, - "configuration": { - "type": "string", - "title": "Configuration for PSMDB cluster", - "x-order": 2 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - }, - "storage_class": { - "description": "Storage Class for PSMDB cluster.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 4 - } - }, - "x-order": 3 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 9 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 10 - }, - "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 - }, - "template": { - "type": "object", - "properties": { - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 11 - } - }, - "x-order": 1 - }, - "pxc_cluster": { - "description": "PXCCluster represents PXC cluster information.", - "type": "object", - "properties": { - "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 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 8 - }, - "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 - }, - "internet_facing": { - "description": "Is DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 7 - }, - "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 - } - }, - "x-order": 2 - }, - "params": { - "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", - "type": "object", - "properties": { - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 4 - }, - "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 - } - }, - "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).", - "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": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - }, - "image": { - "description": "Docker image used for ProxySQL.", - "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).", - "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": 1 - }, - "configuration": { - "type": "string", - "title": "Configuration for PXC cluster", - "x-order": 3 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - }, - "image": { - "description": "Docker image used for PXC.", - "type": "string", - "x-order": 0 - }, - "storage_class": { - "description": "Storage Class for PXC cluster.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 1 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 5 - } - }, - "x-order": 3 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 9 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 10 - }, - "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 - }, - "template": { - "type": "object", - "properties": { - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 11 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/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": { - "psmdb_clusters": { - "description": "PSMDB clusters information.", - "type": "array", - "items": { - "description": "PSMDBCluster represents PSMDB cluster information.", - "type": "object", - "properties": { - "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 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 8 - }, - "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 - }, - "internet_facing": { - "description": "Is DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 7 - }, - "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 - } - }, - "x-order": 2 - }, - "params": { - "description": "PSMDBClusterParams represents PSMDB cluster parameters that can be updated.", - "type": "object", - "properties": { - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 3 - }, - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - }, - "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 - }, - "configuration": { - "type": "string", - "title": "Configuration for PSMDB cluster", - "x-order": 2 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - }, - "storage_class": { - "description": "Storage Class for PSMDB cluster.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 4 - } - }, - "x-order": 3 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 9 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 10 - }, - "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 - }, - "template": { - "type": "object", - "properties": { - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 11 - } - } - }, - "x-order": 1 - }, - "pxc_clusters": { - "description": "PXC clusters information.", - "type": "array", - "items": { - "description": "PXCCluster represents PXC cluster information.", - "type": "object", - "properties": { - "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 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 8 - }, - "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 - }, - "internet_facing": { - "description": "Is DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 7 - }, - "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 - } - }, - "x-order": 2 - }, - "params": { - "description": "PXCClusterParams represents PXC cluster parameters that can be updated.", - "type": "object", - "properties": { - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 4 - }, - "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 - } - }, - "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).", - "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": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - }, - "image": { - "description": "Docker image used for ProxySQL.", - "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).", - "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": 1 - }, - "configuration": { - "type": "string", - "title": "Configuration for PXC cluster", - "x-order": 3 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - }, - "image": { - "description": "Docker image used for PXC.", - "type": "string", - "x-order": 0 - }, - "storage_class": { - "description": "Storage Class for PXC cluster.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 1 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 5 - } - }, - "x-order": 3 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 9 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 10 - }, - "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 - }, - "template": { - "type": "object", - "properties": { - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 11 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/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" - ], - "x-order": 2 - }, - "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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/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": { - "cluster_name": { - "description": "DB cluster name.", - "type": "string", - "x-order": 1 - }, - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "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": { - "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 - }, - "pod": { - "description": "Pod name.", - "type": "string", - "x-order": 0 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/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": { - "dbaas": { - "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": 2 - }, - "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 - }, - "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 - } - }, - "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.\n - KUBERNETES_CLUSTER_STATUS_PROVISIONING: KUBERNETES_CLUSTER_STATUS_PROVISIONING represents that Kubernetes cluster is privisioning.", - "type": "string", - "default": "KUBERNETES_CLUSTER_STATUS_INVALID", - "enum": [ - "KUBERNETES_CLUSTER_STATUS_INVALID", - "KUBERNETES_CLUSTER_STATUS_OK", - "KUBERNETES_CLUSTER_STATUS_UNAVAILABLE", - "KUBERNETES_CLUSTER_STATUS_PROVISIONING" - ], - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/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": { - "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 - }, - "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 - }, - "kubernetes_cluster_name": { - "description": "Kubernetes cluster 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": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/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": { - "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 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "uint64", - "x-order": 0 - } - }, - "x-order": 0 - }, - "available": { - "description": "Resources contains Kubernetes cluster resources.", - "type": "object", - "properties": { - "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 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "uint64", - "x-order": 0 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/StorageClasses/List": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "ListStorageClasses returns the names of all storage classes available in a Kubernetes cluster.", - "operationId": "ListStorageClasses", - "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": { - "storage_classes": { - "description": "Kubernetes storage classes names.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/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": { - "force": { - "description": "If true then Kubernetes cluster will be deleted\neven if it contains database clusters.", - "type": "boolean", - "x-order": 1 - }, - "kubernetes_cluster_name": { - "description": "Kubernetes cluster 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": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/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": { - "expose": { - "description": "Make DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 3 - }, - "internet_facing": { - "description": "Make DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 4 - }, - "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": { - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 3 - }, - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - }, - "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 - }, - "configuration": { - "type": "string", - "title": "Configuration for PSMDB cluster", - "x-order": 2 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - }, - "storage_class": { - "description": "Storage Class for PSMDB cluster.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 4 - } - }, - "x-order": 2 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "template": { - "type": "object", - "properties": { - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/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": { - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 3 - }, - "cluster_size": { - "description": "Cluster size.", - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - }, - "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 - }, - "configuration": { - "type": "string", - "title": "Configuration for PSMDB cluster", - "x-order": 2 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 1 - }, - "storage_class": { - "description": "Storage Class for PSMDB cluster.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 4 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "expected": { - "description": "Resources contains Kubernetes cluster resources.", - "type": "object", - "properties": { - "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 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "uint64", - "x-order": 0 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/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": { - "expose": { - "description": "Make DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 3 - }, - "internet_facing": { - "description": "Make DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 4 - }, - "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 - }, - "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 - }, - "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 - }, - "configuration": { - "type": "string", - "title": "Configuration for PSMDB cluster", - "x-order": 1 - }, - "storage_class": { - "description": "Storage Class for PSMDB cluster.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 1 - }, - "resume": { - "description": "Resume cluster `pause: false`.", - "type": "boolean", - "x-order": 3 - }, - "suspend": { - "description": "Suspend cluster `pause: true`.", - "type": "boolean", - "x-order": 2 - } - }, - "x-order": 2 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "template": { - "type": "object", - "properties": { - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/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": { - "host": { - "description": "MongoDB host.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "MongoDB password.", - "type": "string", - "x-order": 1 - }, - "port": { - "description": "MongoDB port.", - "type": "integer", - "format": "int32", - "x-order": 3 - }, - "replicaset": { - "description": "Replicaset name.", - "type": "string", - "x-order": 4 - }, - "username": { - "description": "MongoDB username.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/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": { - "expose": { - "description": "Make DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 3 - }, - "internet_facing": { - "description": "Make DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 4 - }, - "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": { - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 4 - }, - "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 - } - }, - "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).", - "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": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - }, - "image": { - "description": "Docker image used for ProxySQL.", - "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).", - "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": 1 - }, - "configuration": { - "type": "string", - "title": "Configuration for PXC cluster", - "x-order": 3 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - }, - "image": { - "description": "Docker image used for PXC.", - "type": "string", - "x-order": 0 - }, - "storage_class": { - "description": "Storage Class for PXC cluster.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 1 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 5 - } - }, - "x-order": 2 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "template": { - "type": "object", - "properties": { - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/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": { - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 4 - }, - "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 - } - }, - "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).", - "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": 1 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - }, - "image": { - "description": "Docker image used for ProxySQL.", - "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).", - "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": 1 - }, - "configuration": { - "type": "string", - "title": "Configuration for PXC cluster", - "x-order": 3 - }, - "disk_size": { - "description": "Disk size in bytes.", - "type": "string", - "format": "int64", - "x-order": 2 - }, - "image": { - "description": "Docker image used for PXC.", - "type": "string", - "x-order": 0 - }, - "storage_class": { - "description": "Storage Class for PXC cluster.", - "type": "string", - "x-order": 4 - } - }, - "x-order": 1 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 5 - } - }, - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "expected": { - "description": "Resources contains Kubernetes cluster resources.", - "type": "object", - "properties": { - "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 - }, - "memory_bytes": { - "description": "Memory in bytes.", - "type": "string", - "format": "uint64", - "x-order": 0 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/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": { - "expose": { - "description": "Make DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 3 - }, - "internet_facing": { - "description": "Make DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 4 - }, - "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 - }, - "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 - }, - "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 - }, - "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 - }, - "configuration": { - "type": "string", - "title": "Configuration for PXC cluster", - "x-order": 2 - }, - "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 - }, - "storage_class": { - "description": "Storage Class for PXC cluster.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - }, - "resume": { - "description": "Resume cluster `pause: false`.", - "type": "boolean", - "x-order": 4 - }, - "suspend": { - "description": "Suspend cluster `pause: true`.", - "type": "boolean", - "x-order": 3 - } - }, - "x-order": 2 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "template": { - "type": "object", - "properties": { - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/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": { - "host": { - "description": "PXC host.", - "type": "string", - "x-order": 2 - }, - "password": { - "description": "PXC password.", - "type": "string", - "x-order": 1 - }, - "port": { - "description": "PXC port.", - "type": "integer", - "format": "int32", - "x-order": 3 - }, - "username": { - "description": "PXC username.", - "type": "string", - "x-order": 0 - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Secrets/List": { - "post": { - "tags": [ - "DBClusters" - ], - "summary": "ListSecrets returns a list of secrets from k8s", - "operationId": "ListSecrets", - "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": { - "secrets": { - "description": "Secret list.", - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Name of a secret", - "x-order": 0 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Templates/List": { - "post": { - "tags": [ - "Templates" - ], - "summary": "ListTemplates returns a list of all registered templates.", - "operationId": "ListTemplates", - "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" - ], - "x-order": 1 - }, - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "templates": { - "type": "array", - "items": { - "type": "object", - "properties": { - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - }, - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - }, - "message": { - "type": "string", - "x-order": 1 - } - } - } - } - } - } - } - }, - "tags": [ - { - "name": "Components" - }, - { - "name": "DBClusters" - }, - { - "name": "Kubernetes" - }, - { - "name": "LogsAPI" - }, - { - "name": "PSMDBClusters" - }, - { - "name": "PXCClusters" - }, - { - "name": "Templates" - } - ] -} \ No newline at end of file diff --git a/api/managementpb/dbaas/json/header.json b/api/managementpb/dbaas/json/header.json deleted file mode 100644 index 38cb8b73ce..0000000000 --- a/api/managementpb/dbaas/json/header.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "PMM DBaaS API", - "version": "v1beta1" - }, - "schemes": [ - "https", - "http" - ] -} diff --git a/api/managementpb/dbaas/kubernetes.pb.go b/api/managementpb/dbaas/kubernetes.pb.go deleted file mode 100644 index 9151332ae2..0000000000 --- a/api/managementpb/dbaas/kubernetes.pb.go +++ /dev/null @@ -1,1411 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: managementpb/dbaas/kubernetes.proto - -package dbaasv1beta1 - -import ( - reflect "reflect" - sync "sync" - - _ "github.com/envoyproxy/protoc-gen-validate/validate" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// KubernetesClusterStatus defines status of Kubernetes cluster. -type KubernetesClusterStatus int32 - -const ( - // KUBERNETES_CLUSTER_STATUS_INVALID represents unknown state. - KubernetesClusterStatus_KUBERNETES_CLUSTER_STATUS_INVALID KubernetesClusterStatus = 0 - // KUBERNETES_CLUSTER_STATUS_OK represents that Kubernetes cluster is accessible. - KubernetesClusterStatus_KUBERNETES_CLUSTER_STATUS_OK KubernetesClusterStatus = 1 - // KUBERNETES_CLUSTER_STATUS_UNAVAILABLE represents that Kubernetes cluster is not accessible. - KubernetesClusterStatus_KUBERNETES_CLUSTER_STATUS_UNAVAILABLE KubernetesClusterStatus = 2 - // KUBERNETES_CLUSTER_STATUS_PROVISIONING represents that Kubernetes cluster is privisioning. - KubernetesClusterStatus_KUBERNETES_CLUSTER_STATUS_PROVISIONING KubernetesClusterStatus = 4 -) - -// Enum value maps for KubernetesClusterStatus. -var ( - KubernetesClusterStatus_name = map[int32]string{ - 0: "KUBERNETES_CLUSTER_STATUS_INVALID", - 1: "KUBERNETES_CLUSTER_STATUS_OK", - 2: "KUBERNETES_CLUSTER_STATUS_UNAVAILABLE", - 4: "KUBERNETES_CLUSTER_STATUS_PROVISIONING", - } - KubernetesClusterStatus_value = map[string]int32{ - "KUBERNETES_CLUSTER_STATUS_INVALID": 0, - "KUBERNETES_CLUSTER_STATUS_OK": 1, - "KUBERNETES_CLUSTER_STATUS_UNAVAILABLE": 2, - "KUBERNETES_CLUSTER_STATUS_PROVISIONING": 4, - } -) - -func (x KubernetesClusterStatus) Enum() *KubernetesClusterStatus { - p := new(KubernetesClusterStatus) - *p = x - return p -} - -func (x KubernetesClusterStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (KubernetesClusterStatus) Descriptor() protoreflect.EnumDescriptor { - return file_managementpb_dbaas_kubernetes_proto_enumTypes[0].Descriptor() -} - -func (KubernetesClusterStatus) Type() protoreflect.EnumType { - return &file_managementpb_dbaas_kubernetes_proto_enumTypes[0] -} - -func (x KubernetesClusterStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use KubernetesClusterStatus.Descriptor instead. -func (KubernetesClusterStatus) EnumDescriptor() ([]byte, []int) { - return file_managementpb_dbaas_kubernetes_proto_rawDescGZIP(), []int{0} -} - -// KubeAuth represents Kubernetes / kubectl authentication and authorization information. -type KubeAuth struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubeconfig file content. - Kubeconfig string `protobuf:"bytes,1,opt,name=kubeconfig,proto3" json:"kubeconfig,omitempty"` -} - -func (x *KubeAuth) Reset() { - *x = KubeAuth{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *KubeAuth) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KubeAuth) ProtoMessage() {} - -func (x *KubeAuth) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use KubeAuth.ProtoReflect.Descriptor instead. -func (*KubeAuth) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_kubernetes_proto_rawDescGZIP(), []int{0} -} - -func (x *KubeAuth) GetKubeconfig() string { - if x != nil { - return x.Kubeconfig - } - return "" -} - -// Operator contains all information about operator installed in Kubernetes cluster. -type Operator struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status OperatorsStatus `protobuf:"varint,1,opt,name=status,proto3,enum=dbaas.v1beta1.OperatorsStatus" json:"status,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *Operator) Reset() { - *x = Operator{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Operator) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Operator) ProtoMessage() {} - -func (x *Operator) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Operator.ProtoReflect.Descriptor instead. -func (*Operator) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_kubernetes_proto_rawDescGZIP(), []int{1} -} - -func (x *Operator) GetStatus() OperatorsStatus { - if x != nil { - return x.Status - } - return OperatorsStatus_OPERATORS_STATUS_INVALID -} - -func (x *Operator) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -// Operators contains list of operators installed in Kubernetes cluster. -type Operators struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Percona PXC Cluster Operator. - Pxc *Operator `protobuf:"bytes,1,opt,name=pxc,proto3" json:"pxc,omitempty"` - // Percona Server for MongoDB Operator. - Psmdb *Operator `protobuf:"bytes,2,opt,name=psmdb,proto3" json:"psmdb,omitempty"` - // DBaaS operator. - Dbaas *Operator `protobuf:"bytes,3,opt,name=dbaas,proto3" json:"dbaas,omitempty"` -} - -func (x *Operators) Reset() { - *x = Operators{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Operators) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Operators) ProtoMessage() {} - -func (x *Operators) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Operators.ProtoReflect.Descriptor instead. -func (*Operators) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_kubernetes_proto_rawDescGZIP(), []int{2} -} - -func (x *Operators) GetPxc() *Operator { - if x != nil { - return x.Pxc - } - return nil -} - -func (x *Operators) GetPsmdb() *Operator { - if x != nil { - return x.Psmdb - } - return nil -} - -func (x *Operators) GetDbaas() *Operator { - if x != nil { - return x.Dbaas - } - return nil -} - -type ListKubernetesClustersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ListKubernetesClustersRequest) Reset() { - *x = ListKubernetesClustersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListKubernetesClustersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListKubernetesClustersRequest) ProtoMessage() {} - -func (x *ListKubernetesClustersRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListKubernetesClustersRequest.ProtoReflect.Descriptor instead. -func (*ListKubernetesClustersRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_kubernetes_proto_rawDescGZIP(), []int{3} -} - -type ListKubernetesClustersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes clusters. - KubernetesClusters []*ListKubernetesClustersResponse_Cluster `protobuf:"bytes,1,rep,name=kubernetes_clusters,json=kubernetesClusters,proto3" json:"kubernetes_clusters,omitempty"` -} - -func (x *ListKubernetesClustersResponse) Reset() { - *x = ListKubernetesClustersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListKubernetesClustersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListKubernetesClustersResponse) ProtoMessage() {} - -func (x *ListKubernetesClustersResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListKubernetesClustersResponse.ProtoReflect.Descriptor instead. -func (*ListKubernetesClustersResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_kubernetes_proto_rawDescGZIP(), []int{4} -} - -func (x *ListKubernetesClustersResponse) GetKubernetesClusters() []*ListKubernetesClustersResponse_Cluster { - if x != nil { - return x.KubernetesClusters - } - return nil -} - -type RegisterKubernetesClusterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - // Kubernetes auth. - KubeAuth *KubeAuth `protobuf:"bytes,2,opt,name=kube_auth,json=kubeAuth,proto3" json:"kube_auth,omitempty"` - // AWS access key id, only needed when registering EKS cluster and kubeconfig does not contain it. - AwsAccessKeyId string `protobuf:"bytes,3,opt,name=aws_access_key_id,json=awsAccessKeyId,proto3" json:"aws_access_key_id,omitempty"` - // AWS secret access key, only needed when registering EKS cluster and kubeconfig does not contain it. - AwsSecretAccessKey string `protobuf:"bytes,4,opt,name=aws_secret_access_key,json=awsSecretAccessKey,proto3" json:"aws_secret_access_key,omitempty"` -} - -func (x *RegisterKubernetesClusterRequest) Reset() { - *x = RegisterKubernetesClusterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegisterKubernetesClusterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterKubernetesClusterRequest) ProtoMessage() {} - -func (x *RegisterKubernetesClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RegisterKubernetesClusterRequest.ProtoReflect.Descriptor instead. -func (*RegisterKubernetesClusterRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_kubernetes_proto_rawDescGZIP(), []int{5} -} - -func (x *RegisterKubernetesClusterRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *RegisterKubernetesClusterRequest) GetKubeAuth() *KubeAuth { - if x != nil { - return x.KubeAuth - } - return nil -} - -func (x *RegisterKubernetesClusterRequest) GetAwsAccessKeyId() string { - if x != nil { - return x.AwsAccessKeyId - } - return "" -} - -func (x *RegisterKubernetesClusterRequest) GetAwsSecretAccessKey() string { - if x != nil { - return x.AwsSecretAccessKey - } - return "" -} - -type RegisterKubernetesClusterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RegisterKubernetesClusterResponse) Reset() { - *x = RegisterKubernetesClusterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegisterKubernetesClusterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterKubernetesClusterResponse) ProtoMessage() {} - -func (x *RegisterKubernetesClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RegisterKubernetesClusterResponse.ProtoReflect.Descriptor instead. -func (*RegisterKubernetesClusterResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_kubernetes_proto_rawDescGZIP(), []int{6} -} - -type UnregisterKubernetesClusterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - // If true then Kubernetes cluster will be deleted - // even if it contains database clusters. - Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"` -} - -func (x *UnregisterKubernetesClusterRequest) Reset() { - *x = UnregisterKubernetesClusterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UnregisterKubernetesClusterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UnregisterKubernetesClusterRequest) ProtoMessage() {} - -func (x *UnregisterKubernetesClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UnregisterKubernetesClusterRequest.ProtoReflect.Descriptor instead. -func (*UnregisterKubernetesClusterRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_kubernetes_proto_rawDescGZIP(), []int{7} -} - -func (x *UnregisterKubernetesClusterRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *UnregisterKubernetesClusterRequest) GetForce() bool { - if x != nil { - return x.Force - } - return false -} - -type UnregisterKubernetesClusterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UnregisterKubernetesClusterResponse) Reset() { - *x = UnregisterKubernetesClusterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UnregisterKubernetesClusterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UnregisterKubernetesClusterResponse) ProtoMessage() {} - -func (x *UnregisterKubernetesClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UnregisterKubernetesClusterResponse.ProtoReflect.Descriptor instead. -func (*UnregisterKubernetesClusterResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_kubernetes_proto_rawDescGZIP(), []int{8} -} - -type GetKubernetesClusterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` -} - -func (x *GetKubernetesClusterRequest) Reset() { - *x = GetKubernetesClusterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetKubernetesClusterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetKubernetesClusterRequest) ProtoMessage() {} - -func (x *GetKubernetesClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetKubernetesClusterRequest.ProtoReflect.Descriptor instead. -func (*GetKubernetesClusterRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_kubernetes_proto_rawDescGZIP(), []int{9} -} - -func (x *GetKubernetesClusterRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -type GetKubernetesClusterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes auth. - KubeAuth *KubeAuth `protobuf:"bytes,1,opt,name=kube_auth,json=kubeAuth,proto3" json:"kube_auth,omitempty"` -} - -func (x *GetKubernetesClusterResponse) Reset() { - *x = GetKubernetesClusterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetKubernetesClusterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetKubernetesClusterResponse) ProtoMessage() {} - -func (x *GetKubernetesClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetKubernetesClusterResponse.ProtoReflect.Descriptor instead. -func (*GetKubernetesClusterResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_kubernetes_proto_rawDescGZIP(), []int{10} -} - -func (x *GetKubernetesClusterResponse) GetKubeAuth() *KubeAuth { - if x != nil { - return x.KubeAuth - } - return nil -} - -type GetResourcesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` -} - -func (x *GetResourcesRequest) Reset() { - *x = GetResourcesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResourcesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResourcesRequest) ProtoMessage() {} - -func (x *GetResourcesRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResourcesRequest.ProtoReflect.Descriptor instead. -func (*GetResourcesRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_kubernetes_proto_rawDescGZIP(), []int{11} -} - -func (x *GetResourcesRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -type GetResourcesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The total amount of resources of the Kubernetes cluster. - All *Resources `protobuf:"bytes,1,opt,name=all,proto3" json:"all,omitempty"` - // The amount of resources that is available for consumption by future Kubernetes workloads. - Available *Resources `protobuf:"bytes,2,opt,name=available,proto3" json:"available,omitempty"` -} - -func (x *GetResourcesResponse) Reset() { - *x = GetResourcesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResourcesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResourcesResponse) ProtoMessage() {} - -func (x *GetResourcesResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResourcesResponse.ProtoReflect.Descriptor instead. -func (*GetResourcesResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_kubernetes_proto_rawDescGZIP(), []int{12} -} - -func (x *GetResourcesResponse) GetAll() *Resources { - if x != nil { - return x.All - } - return nil -} - -func (x *GetResourcesResponse) GetAvailable() *Resources { - if x != nil { - return x.Available - } - return nil -} - -type ListStorageClassesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` -} - -func (x *ListStorageClassesRequest) Reset() { - *x = ListStorageClassesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListStorageClassesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListStorageClassesRequest) ProtoMessage() {} - -func (x *ListStorageClassesRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListStorageClassesRequest.ProtoReflect.Descriptor instead. -func (*ListStorageClassesRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_kubernetes_proto_rawDescGZIP(), []int{13} -} - -func (x *ListStorageClassesRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -type ListStorageClassesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes storage classes names. - StorageClasses []string `protobuf:"bytes,1,rep,name=storage_classes,json=storageClasses,proto3" json:"storage_classes,omitempty"` -} - -func (x *ListStorageClassesResponse) Reset() { - *x = ListStorageClassesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListStorageClassesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListStorageClassesResponse) ProtoMessage() {} - -func (x *ListStorageClassesResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListStorageClassesResponse.ProtoReflect.Descriptor instead. -func (*ListStorageClassesResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_kubernetes_proto_rawDescGZIP(), []int{14} -} - -func (x *ListStorageClassesResponse) GetStorageClasses() []string { - if x != nil { - return x.StorageClasses - } - return nil -} - -// Cluster contains public info about Kubernetes cluster. -// TODO Do not use inner messages in all public APIs (for consistency). -type ListKubernetesClustersResponse_Cluster struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - // Installed operators. - Operators *Operators `protobuf:"bytes,2,opt,name=operators,proto3" json:"operators,omitempty"` - // Status of Kubernetes cluster. - Status KubernetesClusterStatus `protobuf:"varint,3,opt,name=status,proto3,enum=dbaas.v1beta1.KubernetesClusterStatus" json:"status,omitempty"` -} - -func (x *ListKubernetesClustersResponse_Cluster) Reset() { - *x = ListKubernetesClustersResponse_Cluster{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListKubernetesClustersResponse_Cluster) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListKubernetesClustersResponse_Cluster) ProtoMessage() {} - -func (x *ListKubernetesClustersResponse_Cluster) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_kubernetes_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListKubernetesClustersResponse_Cluster.ProtoReflect.Descriptor instead. -func (*ListKubernetesClustersResponse_Cluster) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_kubernetes_proto_rawDescGZIP(), []int{4, 0} -} - -func (x *ListKubernetesClustersResponse_Cluster) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *ListKubernetesClustersResponse_Cluster) GetOperators() *Operators { - if x != nil { - return x.Operators - } - return nil -} - -func (x *ListKubernetesClustersResponse_Cluster) GetStatus() KubernetesClusterStatus { - if x != nil { - return x.Status - } - return KubernetesClusterStatus_KUBERNETES_CLUSTER_STATUS_INVALID -} - -var File_managementpb_dbaas_kubernetes_proto protoreflect.FileDescriptor - -var file_managementpb_dbaas_kubernetes_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, - 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x33, 0x0a, 0x08, 0x4b, - 0x75, 0x62, 0x65, 0x41, 0x75, 0x74, 0x68, 0x12, 0x27, 0x0a, 0x0a, 0x6b, 0x75, 0x62, 0x65, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, - 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x6b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x22, 0x5c, 0x0a, 0x08, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x94, - 0x01, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x29, 0x0a, 0x03, - 0x70, 0x78, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x62, 0x61, 0x61, - 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x6f, 0x72, 0x52, 0x03, 0x70, 0x78, 0x63, 0x12, 0x2d, 0x0a, 0x05, 0x70, 0x73, 0x6d, 0x64, 0x62, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, - 0x05, 0x70, 0x73, 0x6d, 0x64, 0x62, 0x12, 0x2d, 0x0a, 0x05, 0x64, 0x62, 0x61, 0x61, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x05, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x22, 0x1f, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x75, 0x62, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xc4, 0x02, 0x0a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x4b, - 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x13, 0x6b, 0x75, 0x62, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x75, 0x62, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x12, 0x6b, - 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x73, 0x1a, 0xb9, 0x01, 0x0a, 0x07, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x36, 0x0a, - 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, - 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, - 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, - 0x72, 0x73, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x3e, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4b, 0x75, - 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x81, 0x02, - 0x0a, 0x20, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, - 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x15, 0x6b, 0x75, - 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x09, 0x6b, 0x75, 0x62, 0x65, 0x5f, 0x61, 0x75, 0x74, 0x68, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4b, 0x75, 0x62, 0x65, 0x41, 0x75, 0x74, 0x68, 0x42, - 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6b, 0x75, 0x62, 0x65, 0x41, - 0x75, 0x74, 0x68, 0x12, 0x29, 0x0a, 0x11, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x61, 0x77, 0x73, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x12, 0x31, - 0x0a, 0x15, 0x61, 0x77, 0x73, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x61, - 0x77, 0x73, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, - 0x79, 0x22, 0x23, 0x0a, 0x21, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x75, 0x62, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7b, 0x0a, 0x22, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x17, - 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, - 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x15, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, - 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, - 0x72, 0x63, 0x65, 0x22, 0x25, 0x0a, 0x23, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5e, 0x0a, 0x1b, 0x47, 0x65, - 0x74, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x17, 0x6b, 0x75, 0x62, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, - 0x02, 0x10, 0x01, 0x52, 0x15, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x54, 0x0a, 0x1c, 0x47, 0x65, - 0x74, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x6b, 0x75, - 0x62, 0x65, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4b, 0x75, - 0x62, 0x65, 0x41, 0x75, 0x74, 0x68, 0x52, 0x08, 0x6b, 0x75, 0x62, 0x65, 0x41, 0x75, 0x74, 0x68, - 0x22, 0x56, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, - 0x01, 0x52, 0x15, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x7a, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2a, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x36, 0x0a, 0x09, - 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x18, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x09, 0x61, 0x76, 0x61, 0x69, 0x6c, - 0x61, 0x62, 0x6c, 0x65, 0x22, 0x5c, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x3f, 0x0a, 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, - 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x15, 0x6b, 0x75, 0x62, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, - 0x6d, 0x65, 0x22, 0x45, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, - 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x2a, 0xb9, 0x01, 0x0a, 0x17, 0x4b, 0x75, - 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x25, 0x0a, 0x21, 0x4b, 0x55, 0x42, 0x45, 0x52, 0x4e, 0x45, - 0x54, 0x45, 0x53, 0x5f, 0x43, 0x4c, 0x55, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x20, 0x0a, 0x1c, - 0x4b, 0x55, 0x42, 0x45, 0x52, 0x4e, 0x45, 0x54, 0x45, 0x53, 0x5f, 0x43, 0x4c, 0x55, 0x53, 0x54, - 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x29, - 0x0a, 0x25, 0x4b, 0x55, 0x42, 0x45, 0x52, 0x4e, 0x45, 0x54, 0x45, 0x53, 0x5f, 0x43, 0x4c, 0x55, - 0x53, 0x54, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x41, 0x56, - 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x02, 0x12, 0x2a, 0x0a, 0x26, 0x4b, 0x55, 0x42, - 0x45, 0x52, 0x4e, 0x45, 0x54, 0x45, 0x53, 0x5f, 0x43, 0x4c, 0x55, 0x53, 0x54, 0x45, 0x52, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x53, 0x49, 0x4f, 0x4e, - 0x49, 0x4e, 0x47, 0x10, 0x04, 0x32, 0x8b, 0x08, 0x0a, 0x0a, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x65, 0x73, 0x12, 0xa6, 0x01, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x75, 0x62, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, - 0x2c, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, 0x2f, 0x4b, 0x75, - 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0xb3, 0x01, - 0x0a, 0x19, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x2f, 0x2e, 0x64, 0x62, - 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x01, 0x2a, 0x22, 0x28, 0x2f, 0x76, 0x31, 0x2f, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, 0x2f, - 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2f, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x12, 0xbb, 0x01, 0x0a, 0x1b, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x12, 0x31, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x75, - 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x2f, 0x3a, 0x01, 0x2a, 0x22, 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, 0x2f, 0x4b, 0x75, 0x62, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2f, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x12, 0x9f, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, - 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x2a, 0x2e, 0x64, 0x62, 0x61, - 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x75, - 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x22, 0x23, - 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, - 0x42, 0x61, 0x61, 0x53, 0x2f, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2f, - 0x47, 0x65, 0x74, 0x12, 0x91, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x12, 0x22, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x3a, 0x01, 0x2a, 0x22, 0x2d, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, 0x2f, 0x4b, - 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x12, 0xa9, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, - 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x12, 0x28, - 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x3a, 0x01, 0x2a, 0x22, 0x33, - 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, - 0x42, 0x61, 0x61, 0x53, 0x2f, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x2f, - 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x2f, 0x4c, - 0x69, 0x73, 0x74, 0x42, 0xb5, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x62, 0x61, 0x61, - 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0f, 0x4b, 0x75, 0x62, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, - 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x3b, 0x64, 0x62, 0x61, 0x61, - 0x73, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, - 0x0d, 0x44, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, - 0x0d, 0x44, 0x62, 0x61, 0x61, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, - 0x19, 0x44, 0x62, 0x61, 0x61, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x44, 0x62, 0x61, - 0x61, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_managementpb_dbaas_kubernetes_proto_rawDescOnce sync.Once - file_managementpb_dbaas_kubernetes_proto_rawDescData = file_managementpb_dbaas_kubernetes_proto_rawDesc -) - -func file_managementpb_dbaas_kubernetes_proto_rawDescGZIP() []byte { - file_managementpb_dbaas_kubernetes_proto_rawDescOnce.Do(func() { - file_managementpb_dbaas_kubernetes_proto_rawDescData = protoimpl.X.CompressGZIP(file_managementpb_dbaas_kubernetes_proto_rawDescData) - }) - return file_managementpb_dbaas_kubernetes_proto_rawDescData -} - -var ( - file_managementpb_dbaas_kubernetes_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_managementpb_dbaas_kubernetes_proto_msgTypes = make([]protoimpl.MessageInfo, 16) - file_managementpb_dbaas_kubernetes_proto_goTypes = []interface{}{ - (KubernetesClusterStatus)(0), // 0: dbaas.v1beta1.KubernetesClusterStatus - (*KubeAuth)(nil), // 1: dbaas.v1beta1.KubeAuth - (*Operator)(nil), // 2: dbaas.v1beta1.Operator - (*Operators)(nil), // 3: dbaas.v1beta1.Operators - (*ListKubernetesClustersRequest)(nil), // 4: dbaas.v1beta1.ListKubernetesClustersRequest - (*ListKubernetesClustersResponse)(nil), // 5: dbaas.v1beta1.ListKubernetesClustersResponse - (*RegisterKubernetesClusterRequest)(nil), // 6: dbaas.v1beta1.RegisterKubernetesClusterRequest - (*RegisterKubernetesClusterResponse)(nil), // 7: dbaas.v1beta1.RegisterKubernetesClusterResponse - (*UnregisterKubernetesClusterRequest)(nil), // 8: dbaas.v1beta1.UnregisterKubernetesClusterRequest - (*UnregisterKubernetesClusterResponse)(nil), // 9: dbaas.v1beta1.UnregisterKubernetesClusterResponse - (*GetKubernetesClusterRequest)(nil), // 10: dbaas.v1beta1.GetKubernetesClusterRequest - (*GetKubernetesClusterResponse)(nil), // 11: dbaas.v1beta1.GetKubernetesClusterResponse - (*GetResourcesRequest)(nil), // 12: dbaas.v1beta1.GetResourcesRequest - (*GetResourcesResponse)(nil), // 13: dbaas.v1beta1.GetResourcesResponse - (*ListStorageClassesRequest)(nil), // 14: dbaas.v1beta1.ListStorageClassesRequest - (*ListStorageClassesResponse)(nil), // 15: dbaas.v1beta1.ListStorageClassesResponse - (*ListKubernetesClustersResponse_Cluster)(nil), // 16: dbaas.v1beta1.ListKubernetesClustersResponse.Cluster - (OperatorsStatus)(0), // 17: dbaas.v1beta1.OperatorsStatus - (*Resources)(nil), // 18: dbaas.v1beta1.Resources - } -) - -var file_managementpb_dbaas_kubernetes_proto_depIdxs = []int32{ - 17, // 0: dbaas.v1beta1.Operator.status:type_name -> dbaas.v1beta1.OperatorsStatus - 2, // 1: dbaas.v1beta1.Operators.pxc:type_name -> dbaas.v1beta1.Operator - 2, // 2: dbaas.v1beta1.Operators.psmdb:type_name -> dbaas.v1beta1.Operator - 2, // 3: dbaas.v1beta1.Operators.dbaas:type_name -> dbaas.v1beta1.Operator - 16, // 4: dbaas.v1beta1.ListKubernetesClustersResponse.kubernetes_clusters:type_name -> dbaas.v1beta1.ListKubernetesClustersResponse.Cluster - 1, // 5: dbaas.v1beta1.RegisterKubernetesClusterRequest.kube_auth:type_name -> dbaas.v1beta1.KubeAuth - 1, // 6: dbaas.v1beta1.GetKubernetesClusterResponse.kube_auth:type_name -> dbaas.v1beta1.KubeAuth - 18, // 7: dbaas.v1beta1.GetResourcesResponse.all:type_name -> dbaas.v1beta1.Resources - 18, // 8: dbaas.v1beta1.GetResourcesResponse.available:type_name -> dbaas.v1beta1.Resources - 3, // 9: dbaas.v1beta1.ListKubernetesClustersResponse.Cluster.operators:type_name -> dbaas.v1beta1.Operators - 0, // 10: dbaas.v1beta1.ListKubernetesClustersResponse.Cluster.status:type_name -> dbaas.v1beta1.KubernetesClusterStatus - 4, // 11: dbaas.v1beta1.Kubernetes.ListKubernetesClusters:input_type -> dbaas.v1beta1.ListKubernetesClustersRequest - 6, // 12: dbaas.v1beta1.Kubernetes.RegisterKubernetesCluster:input_type -> dbaas.v1beta1.RegisterKubernetesClusterRequest - 8, // 13: dbaas.v1beta1.Kubernetes.UnregisterKubernetesCluster:input_type -> dbaas.v1beta1.UnregisterKubernetesClusterRequest - 10, // 14: dbaas.v1beta1.Kubernetes.GetKubernetesCluster:input_type -> dbaas.v1beta1.GetKubernetesClusterRequest - 12, // 15: dbaas.v1beta1.Kubernetes.GetResources:input_type -> dbaas.v1beta1.GetResourcesRequest - 14, // 16: dbaas.v1beta1.Kubernetes.ListStorageClasses:input_type -> dbaas.v1beta1.ListStorageClassesRequest - 5, // 17: dbaas.v1beta1.Kubernetes.ListKubernetesClusters:output_type -> dbaas.v1beta1.ListKubernetesClustersResponse - 7, // 18: dbaas.v1beta1.Kubernetes.RegisterKubernetesCluster:output_type -> dbaas.v1beta1.RegisterKubernetesClusterResponse - 9, // 19: dbaas.v1beta1.Kubernetes.UnregisterKubernetesCluster:output_type -> dbaas.v1beta1.UnregisterKubernetesClusterResponse - 11, // 20: dbaas.v1beta1.Kubernetes.GetKubernetesCluster:output_type -> dbaas.v1beta1.GetKubernetesClusterResponse - 13, // 21: dbaas.v1beta1.Kubernetes.GetResources:output_type -> dbaas.v1beta1.GetResourcesResponse - 15, // 22: dbaas.v1beta1.Kubernetes.ListStorageClasses:output_type -> dbaas.v1beta1.ListStorageClassesResponse - 17, // [17:23] is the sub-list for method output_type - 11, // [11:17] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name -} - -func init() { file_managementpb_dbaas_kubernetes_proto_init() } -func file_managementpb_dbaas_kubernetes_proto_init() { - if File_managementpb_dbaas_kubernetes_proto != nil { - return - } - file_managementpb_dbaas_dbaas_proto_init() - if !protoimpl.UnsafeEnabled { - file_managementpb_dbaas_kubernetes_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KubeAuth); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_kubernetes_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Operator); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_kubernetes_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Operators); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_kubernetes_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListKubernetesClustersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_kubernetes_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListKubernetesClustersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_kubernetes_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterKubernetesClusterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_kubernetes_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterKubernetesClusterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_kubernetes_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnregisterKubernetesClusterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_kubernetes_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnregisterKubernetesClusterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_kubernetes_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetKubernetesClusterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_kubernetes_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetKubernetesClusterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_kubernetes_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResourcesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_kubernetes_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResourcesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_kubernetes_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListStorageClassesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_kubernetes_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListStorageClassesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_kubernetes_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListKubernetesClustersResponse_Cluster); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_managementpb_dbaas_kubernetes_proto_rawDesc, - NumEnums: 1, - NumMessages: 16, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_managementpb_dbaas_kubernetes_proto_goTypes, - DependencyIndexes: file_managementpb_dbaas_kubernetes_proto_depIdxs, - EnumInfos: file_managementpb_dbaas_kubernetes_proto_enumTypes, - MessageInfos: file_managementpb_dbaas_kubernetes_proto_msgTypes, - }.Build() - File_managementpb_dbaas_kubernetes_proto = out.File - file_managementpb_dbaas_kubernetes_proto_rawDesc = nil - file_managementpb_dbaas_kubernetes_proto_goTypes = nil - file_managementpb_dbaas_kubernetes_proto_depIdxs = nil -} diff --git a/api/managementpb/dbaas/kubernetes.pb.gw.go b/api/managementpb/dbaas/kubernetes.pb.gw.go deleted file mode 100644 index 6e48eb285c..0000000000 --- a/api/managementpb/dbaas/kubernetes.pb.gw.go +++ /dev/null @@ -1,572 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: managementpb/dbaas/kubernetes.proto - -/* -Package dbaasv1beta1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package dbaasv1beta1 - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_Kubernetes_ListKubernetesClusters_0(ctx context.Context, marshaler runtime.Marshaler, client KubernetesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListKubernetesClustersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListKubernetesClusters(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Kubernetes_ListKubernetesClusters_0(ctx context.Context, marshaler runtime.Marshaler, server KubernetesServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListKubernetesClustersRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListKubernetesClusters(ctx, &protoReq) - return msg, metadata, err -} - -func request_Kubernetes_RegisterKubernetesCluster_0(ctx context.Context, marshaler runtime.Marshaler, client KubernetesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RegisterKubernetesClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.RegisterKubernetesCluster(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Kubernetes_RegisterKubernetesCluster_0(ctx context.Context, marshaler runtime.Marshaler, server KubernetesServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RegisterKubernetesClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.RegisterKubernetesCluster(ctx, &protoReq) - return msg, metadata, err -} - -func request_Kubernetes_UnregisterKubernetesCluster_0(ctx context.Context, marshaler runtime.Marshaler, client KubernetesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UnregisterKubernetesClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.UnregisterKubernetesCluster(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Kubernetes_UnregisterKubernetesCluster_0(ctx context.Context, marshaler runtime.Marshaler, server KubernetesServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UnregisterKubernetesClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.UnregisterKubernetesCluster(ctx, &protoReq) - return msg, metadata, err -} - -func request_Kubernetes_GetKubernetesCluster_0(ctx context.Context, marshaler runtime.Marshaler, client KubernetesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetKubernetesClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetKubernetesCluster(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Kubernetes_GetKubernetesCluster_0(ctx context.Context, marshaler runtime.Marshaler, server KubernetesServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetKubernetesClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetKubernetesCluster(ctx, &protoReq) - return msg, metadata, err -} - -func request_Kubernetes_GetResources_0(ctx context.Context, marshaler runtime.Marshaler, client KubernetesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetResourcesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetResources(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Kubernetes_GetResources_0(ctx context.Context, marshaler runtime.Marshaler, server KubernetesServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetResourcesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetResources(ctx, &protoReq) - return msg, metadata, err -} - -func request_Kubernetes_ListStorageClasses_0(ctx context.Context, marshaler runtime.Marshaler, client KubernetesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListStorageClassesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListStorageClasses(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Kubernetes_ListStorageClasses_0(ctx context.Context, marshaler runtime.Marshaler, server KubernetesServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListStorageClassesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListStorageClasses(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterKubernetesHandlerServer registers the http handlers for service Kubernetes to "mux". -// UnaryRPC :call KubernetesServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterKubernetesHandlerFromEndpoint instead. -func RegisterKubernetesHandlerServer(ctx context.Context, mux *runtime.ServeMux, server KubernetesServer) error { - mux.Handle("POST", pattern_Kubernetes_ListKubernetesClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.Kubernetes/ListKubernetesClusters", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Kubernetes/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Kubernetes_ListKubernetesClusters_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Kubernetes_ListKubernetesClusters_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Kubernetes_RegisterKubernetesCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.Kubernetes/RegisterKubernetesCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Kubernetes/Register")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Kubernetes_RegisterKubernetesCluster_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Kubernetes_RegisterKubernetesCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Kubernetes_UnregisterKubernetesCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.Kubernetes/UnregisterKubernetesCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Kubernetes/Unregister")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Kubernetes_UnregisterKubernetesCluster_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Kubernetes_UnregisterKubernetesCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Kubernetes_GetKubernetesCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.Kubernetes/GetKubernetesCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Kubernetes/Get")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Kubernetes_GetKubernetesCluster_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Kubernetes_GetKubernetesCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Kubernetes_GetResources_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.Kubernetes/GetResources", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Kubernetes/Resources/Get")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Kubernetes_GetResources_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Kubernetes_GetResources_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Kubernetes_ListStorageClasses_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.Kubernetes/ListStorageClasses", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Kubernetes/StorageClasses/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Kubernetes_ListStorageClasses_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Kubernetes_ListStorageClasses_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterKubernetesHandlerFromEndpoint is same as RegisterKubernetesHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterKubernetesHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterKubernetesHandler(ctx, mux, conn) -} - -// RegisterKubernetesHandler registers the http handlers for service Kubernetes to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterKubernetesHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterKubernetesHandlerClient(ctx, mux, NewKubernetesClient(conn)) -} - -// RegisterKubernetesHandlerClient registers the http handlers for service Kubernetes -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "KubernetesClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "KubernetesClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "KubernetesClient" to call the correct interceptors. -func RegisterKubernetesHandlerClient(ctx context.Context, mux *runtime.ServeMux, client KubernetesClient) error { - mux.Handle("POST", pattern_Kubernetes_ListKubernetesClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.Kubernetes/ListKubernetesClusters", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Kubernetes/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Kubernetes_ListKubernetesClusters_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Kubernetes_ListKubernetesClusters_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Kubernetes_RegisterKubernetesCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.Kubernetes/RegisterKubernetesCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Kubernetes/Register")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Kubernetes_RegisterKubernetesCluster_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Kubernetes_RegisterKubernetesCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Kubernetes_UnregisterKubernetesCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.Kubernetes/UnregisterKubernetesCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Kubernetes/Unregister")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Kubernetes_UnregisterKubernetesCluster_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Kubernetes_UnregisterKubernetesCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Kubernetes_GetKubernetesCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.Kubernetes/GetKubernetesCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Kubernetes/Get")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Kubernetes_GetKubernetesCluster_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Kubernetes_GetKubernetesCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Kubernetes_GetResources_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.Kubernetes/GetResources", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Kubernetes/Resources/Get")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Kubernetes_GetResources_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Kubernetes_GetResources_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Kubernetes_ListStorageClasses_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.Kubernetes/ListStorageClasses", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Kubernetes/StorageClasses/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Kubernetes_ListStorageClasses_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Kubernetes_ListStorageClasses_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -var ( - pattern_Kubernetes_ListKubernetesClusters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "Kubernetes", "List"}, "")) - - pattern_Kubernetes_RegisterKubernetesCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "Kubernetes", "Register"}, "")) - - pattern_Kubernetes_UnregisterKubernetesCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "Kubernetes", "Unregister"}, "")) - - pattern_Kubernetes_GetKubernetesCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "Kubernetes", "Get"}, "")) - - pattern_Kubernetes_GetResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"v1", "management", "DBaaS", "Kubernetes", "Resources", "Get"}, "")) - - pattern_Kubernetes_ListStorageClasses_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"v1", "management", "DBaaS", "Kubernetes", "StorageClasses", "List"}, "")) -) - -var ( - forward_Kubernetes_ListKubernetesClusters_0 = runtime.ForwardResponseMessage - - forward_Kubernetes_RegisterKubernetesCluster_0 = runtime.ForwardResponseMessage - - forward_Kubernetes_UnregisterKubernetesCluster_0 = runtime.ForwardResponseMessage - - forward_Kubernetes_GetKubernetesCluster_0 = runtime.ForwardResponseMessage - - forward_Kubernetes_GetResources_0 = runtime.ForwardResponseMessage - - forward_Kubernetes_ListStorageClasses_0 = runtime.ForwardResponseMessage -) diff --git a/api/managementpb/dbaas/kubernetes.pb.validate.go b/api/managementpb/dbaas/kubernetes.pb.validate.go deleted file mode 100644 index e3393c2291..0000000000 --- a/api/managementpb/dbaas/kubernetes.pb.validate.go +++ /dev/null @@ -1,2036 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: managementpb/dbaas/kubernetes.proto - -package dbaasv1beta1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on KubeAuth with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *KubeAuth) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on KubeAuth with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in KubeAuthMultiError, or nil -// if none found. -func (m *KubeAuth) ValidateAll() error { - return m.validate(true) -} - -func (m *KubeAuth) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubeconfig()) < 1 { - err := KubeAuthValidationError{ - field: "Kubeconfig", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return KubeAuthMultiError(errors) - } - - return nil -} - -// KubeAuthMultiError is an error wrapping multiple validation errors returned -// by KubeAuth.ValidateAll() if the designated constraints aren't met. -type KubeAuthMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m KubeAuthMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m KubeAuthMultiError) AllErrors() []error { return m } - -// KubeAuthValidationError is the validation error returned by -// KubeAuth.Validate if the designated constraints aren't met. -type KubeAuthValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e KubeAuthValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e KubeAuthValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e KubeAuthValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e KubeAuthValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e KubeAuthValidationError) ErrorName() string { return "KubeAuthValidationError" } - -// Error satisfies the builtin error interface -func (e KubeAuthValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sKubeAuth.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = KubeAuthValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = KubeAuthValidationError{} - -// Validate checks the field values on Operator with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Operator) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Operator with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in OperatorMultiError, or nil -// if none found. -func (m *Operator) ValidateAll() error { - return m.validate(true) -} - -func (m *Operator) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Status - - // no validation rules for Version - - if len(errors) > 0 { - return OperatorMultiError(errors) - } - - return nil -} - -// OperatorMultiError is an error wrapping multiple validation errors returned -// by Operator.ValidateAll() if the designated constraints aren't met. -type OperatorMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m OperatorMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m OperatorMultiError) AllErrors() []error { return m } - -// OperatorValidationError is the validation error returned by -// Operator.Validate if the designated constraints aren't met. -type OperatorValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e OperatorValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e OperatorValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e OperatorValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e OperatorValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e OperatorValidationError) ErrorName() string { return "OperatorValidationError" } - -// Error satisfies the builtin error interface -func (e OperatorValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sOperator.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = OperatorValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = OperatorValidationError{} - -// Validate checks the field values on Operators with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Operators) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Operators with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in OperatorsMultiError, or nil -// if none found. -func (m *Operators) ValidateAll() error { - return m.validate(true) -} - -func (m *Operators) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetPxc()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, OperatorsValidationError{ - field: "Pxc", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, OperatorsValidationError{ - field: "Pxc", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPxc()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return OperatorsValidationError{ - field: "Pxc", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetPsmdb()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, OperatorsValidationError{ - field: "Psmdb", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, OperatorsValidationError{ - field: "Psmdb", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPsmdb()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return OperatorsValidationError{ - field: "Psmdb", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetDbaas()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, OperatorsValidationError{ - field: "Dbaas", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, OperatorsValidationError{ - field: "Dbaas", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetDbaas()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return OperatorsValidationError{ - field: "Dbaas", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return OperatorsMultiError(errors) - } - - return nil -} - -// OperatorsMultiError is an error wrapping multiple validation errors returned -// by Operators.ValidateAll() if the designated constraints aren't met. -type OperatorsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m OperatorsMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m OperatorsMultiError) AllErrors() []error { return m } - -// OperatorsValidationError is the validation error returned by -// Operators.Validate if the designated constraints aren't met. -type OperatorsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e OperatorsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e OperatorsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e OperatorsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e OperatorsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e OperatorsValidationError) ErrorName() string { return "OperatorsValidationError" } - -// Error satisfies the builtin error interface -func (e OperatorsValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sOperators.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = OperatorsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = OperatorsValidationError{} - -// Validate checks the field values on ListKubernetesClustersRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ListKubernetesClustersRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListKubernetesClustersRequest with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// ListKubernetesClustersRequestMultiError, or nil if none found. -func (m *ListKubernetesClustersRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListKubernetesClustersRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ListKubernetesClustersRequestMultiError(errors) - } - - return nil -} - -// ListKubernetesClustersRequestMultiError is an error wrapping multiple -// validation errors returned by ListKubernetesClustersRequest.ValidateAll() -// if the designated constraints aren't met. -type ListKubernetesClustersRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListKubernetesClustersRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListKubernetesClustersRequestMultiError) AllErrors() []error { return m } - -// ListKubernetesClustersRequestValidationError is the validation error -// returned by ListKubernetesClustersRequest.Validate if the designated -// constraints aren't met. -type ListKubernetesClustersRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListKubernetesClustersRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListKubernetesClustersRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListKubernetesClustersRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListKubernetesClustersRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListKubernetesClustersRequestValidationError) ErrorName() string { - return "ListKubernetesClustersRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListKubernetesClustersRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListKubernetesClustersRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListKubernetesClustersRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListKubernetesClustersRequestValidationError{} - -// Validate checks the field values on ListKubernetesClustersResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ListKubernetesClustersResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListKubernetesClustersResponse with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// ListKubernetesClustersResponseMultiError, or nil if none found. -func (m *ListKubernetesClustersResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListKubernetesClustersResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetKubernetesClusters() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListKubernetesClustersResponseValidationError{ - field: fmt.Sprintf("KubernetesClusters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListKubernetesClustersResponseValidationError{ - field: fmt.Sprintf("KubernetesClusters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListKubernetesClustersResponseValidationError{ - field: fmt.Sprintf("KubernetesClusters[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListKubernetesClustersResponseMultiError(errors) - } - - return nil -} - -// ListKubernetesClustersResponseMultiError is an error wrapping multiple -// validation errors returned by ListKubernetesClustersResponse.ValidateAll() -// if the designated constraints aren't met. -type ListKubernetesClustersResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListKubernetesClustersResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListKubernetesClustersResponseMultiError) AllErrors() []error { return m } - -// ListKubernetesClustersResponseValidationError is the validation error -// returned by ListKubernetesClustersResponse.Validate if the designated -// constraints aren't met. -type ListKubernetesClustersResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListKubernetesClustersResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListKubernetesClustersResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListKubernetesClustersResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListKubernetesClustersResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListKubernetesClustersResponseValidationError) ErrorName() string { - return "ListKubernetesClustersResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListKubernetesClustersResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListKubernetesClustersResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListKubernetesClustersResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListKubernetesClustersResponseValidationError{} - -// Validate checks the field values on RegisterKubernetesClusterRequest with -// the rules defined in the proto definition for this message. If any rules -// are violated, the first error encountered is returned, or nil if there are -// no violations. -func (m *RegisterKubernetesClusterRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RegisterKubernetesClusterRequest with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// RegisterKubernetesClusterRequestMultiError, or nil if none found. -func (m *RegisterKubernetesClusterRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *RegisterKubernetesClusterRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := RegisterKubernetesClusterRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if m.GetKubeAuth() == nil { - err := RegisterKubernetesClusterRequestValidationError{ - field: "KubeAuth", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetKubeAuth()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, RegisterKubernetesClusterRequestValidationError{ - field: "KubeAuth", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, RegisterKubernetesClusterRequestValidationError{ - field: "KubeAuth", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetKubeAuth()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return RegisterKubernetesClusterRequestValidationError{ - field: "KubeAuth", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for AwsAccessKeyId - - // no validation rules for AwsSecretAccessKey - - if len(errors) > 0 { - return RegisterKubernetesClusterRequestMultiError(errors) - } - - return nil -} - -// RegisterKubernetesClusterRequestMultiError is an error wrapping multiple -// validation errors returned by -// RegisterKubernetesClusterRequest.ValidateAll() if the designated -// constraints aren't met. -type RegisterKubernetesClusterRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RegisterKubernetesClusterRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m RegisterKubernetesClusterRequestMultiError) AllErrors() []error { return m } - -// RegisterKubernetesClusterRequestValidationError is the validation error -// returned by RegisterKubernetesClusterRequest.Validate if the designated -// constraints aren't met. -type RegisterKubernetesClusterRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RegisterKubernetesClusterRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RegisterKubernetesClusterRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RegisterKubernetesClusterRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RegisterKubernetesClusterRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RegisterKubernetesClusterRequestValidationError) ErrorName() string { - return "RegisterKubernetesClusterRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e RegisterKubernetesClusterRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sRegisterKubernetesClusterRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RegisterKubernetesClusterRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RegisterKubernetesClusterRequestValidationError{} - -// Validate checks the field values on RegisterKubernetesClusterResponse with -// the rules defined in the proto definition for this message. If any rules -// are violated, the first error encountered is returned, or nil if there are -// no violations. -func (m *RegisterKubernetesClusterResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RegisterKubernetesClusterResponse -// with the rules defined in the proto definition for this message. If any -// rules are violated, the result is a list of violation errors wrapped in -// RegisterKubernetesClusterResponseMultiError, or nil if none found. -func (m *RegisterKubernetesClusterResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *RegisterKubernetesClusterResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return RegisterKubernetesClusterResponseMultiError(errors) - } - - return nil -} - -// RegisterKubernetesClusterResponseMultiError is an error wrapping multiple -// validation errors returned by -// RegisterKubernetesClusterResponse.ValidateAll() if the designated -// constraints aren't met. -type RegisterKubernetesClusterResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m RegisterKubernetesClusterResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m RegisterKubernetesClusterResponseMultiError) AllErrors() []error { return m } - -// RegisterKubernetesClusterResponseValidationError is the validation error -// returned by RegisterKubernetesClusterResponse.Validate if the designated -// constraints aren't met. -type RegisterKubernetesClusterResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e RegisterKubernetesClusterResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e RegisterKubernetesClusterResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e RegisterKubernetesClusterResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e RegisterKubernetesClusterResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e RegisterKubernetesClusterResponseValidationError) ErrorName() string { - return "RegisterKubernetesClusterResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e RegisterKubernetesClusterResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sRegisterKubernetesClusterResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = RegisterKubernetesClusterResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = RegisterKubernetesClusterResponseValidationError{} - -// Validate checks the field values on UnregisterKubernetesClusterRequest with -// the rules defined in the proto definition for this message. If any rules -// are violated, the first error encountered is returned, or nil if there are -// no violations. -func (m *UnregisterKubernetesClusterRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UnregisterKubernetesClusterRequest -// with the rules defined in the proto definition for this message. If any -// rules are violated, the result is a list of violation errors wrapped in -// UnregisterKubernetesClusterRequestMultiError, or nil if none found. -func (m *UnregisterKubernetesClusterRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *UnregisterKubernetesClusterRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := UnregisterKubernetesClusterRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Force - - if len(errors) > 0 { - return UnregisterKubernetesClusterRequestMultiError(errors) - } - - return nil -} - -// UnregisterKubernetesClusterRequestMultiError is an error wrapping multiple -// validation errors returned by -// UnregisterKubernetesClusterRequest.ValidateAll() if the designated -// constraints aren't met. -type UnregisterKubernetesClusterRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UnregisterKubernetesClusterRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UnregisterKubernetesClusterRequestMultiError) AllErrors() []error { return m } - -// UnregisterKubernetesClusterRequestValidationError is the validation error -// returned by UnregisterKubernetesClusterRequest.Validate if the designated -// constraints aren't met. -type UnregisterKubernetesClusterRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UnregisterKubernetesClusterRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UnregisterKubernetesClusterRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UnregisterKubernetesClusterRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UnregisterKubernetesClusterRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UnregisterKubernetesClusterRequestValidationError) ErrorName() string { - return "UnregisterKubernetesClusterRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e UnregisterKubernetesClusterRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUnregisterKubernetesClusterRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UnregisterKubernetesClusterRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UnregisterKubernetesClusterRequestValidationError{} - -// Validate checks the field values on UnregisterKubernetesClusterResponse with -// the rules defined in the proto definition for this message. If any rules -// are violated, the first error encountered is returned, or nil if there are -// no violations. -func (m *UnregisterKubernetesClusterResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UnregisterKubernetesClusterResponse -// with the rules defined in the proto definition for this message. If any -// rules are violated, the result is a list of violation errors wrapped in -// UnregisterKubernetesClusterResponseMultiError, or nil if none found. -func (m *UnregisterKubernetesClusterResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *UnregisterKubernetesClusterResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return UnregisterKubernetesClusterResponseMultiError(errors) - } - - return nil -} - -// UnregisterKubernetesClusterResponseMultiError is an error wrapping multiple -// validation errors returned by -// UnregisterKubernetesClusterResponse.ValidateAll() if the designated -// constraints aren't met. -type UnregisterKubernetesClusterResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UnregisterKubernetesClusterResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UnregisterKubernetesClusterResponseMultiError) AllErrors() []error { return m } - -// UnregisterKubernetesClusterResponseValidationError is the validation error -// returned by UnregisterKubernetesClusterResponse.Validate if the designated -// constraints aren't met. -type UnregisterKubernetesClusterResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UnregisterKubernetesClusterResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UnregisterKubernetesClusterResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UnregisterKubernetesClusterResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UnregisterKubernetesClusterResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UnregisterKubernetesClusterResponseValidationError) ErrorName() string { - return "UnregisterKubernetesClusterResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e UnregisterKubernetesClusterResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUnregisterKubernetesClusterResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UnregisterKubernetesClusterResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UnregisterKubernetesClusterResponseValidationError{} - -// Validate checks the field values on GetKubernetesClusterRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *GetKubernetesClusterRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetKubernetesClusterRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// GetKubernetesClusterRequestMultiError, or nil if none found. -func (m *GetKubernetesClusterRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetKubernetesClusterRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := GetKubernetesClusterRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return GetKubernetesClusterRequestMultiError(errors) - } - - return nil -} - -// GetKubernetesClusterRequestMultiError is an error wrapping multiple -// validation errors returned by GetKubernetesClusterRequest.ValidateAll() if -// the designated constraints aren't met. -type GetKubernetesClusterRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetKubernetesClusterRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetKubernetesClusterRequestMultiError) AllErrors() []error { return m } - -// GetKubernetesClusterRequestValidationError is the validation error returned -// by GetKubernetesClusterRequest.Validate if the designated constraints -// aren't met. -type GetKubernetesClusterRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetKubernetesClusterRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetKubernetesClusterRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetKubernetesClusterRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetKubernetesClusterRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetKubernetesClusterRequestValidationError) ErrorName() string { - return "GetKubernetesClusterRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetKubernetesClusterRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetKubernetesClusterRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetKubernetesClusterRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetKubernetesClusterRequestValidationError{} - -// Validate checks the field values on GetKubernetesClusterResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *GetKubernetesClusterResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetKubernetesClusterResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// GetKubernetesClusterResponseMultiError, or nil if none found. -func (m *GetKubernetesClusterResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetKubernetesClusterResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetKubeAuth()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetKubernetesClusterResponseValidationError{ - field: "KubeAuth", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetKubernetesClusterResponseValidationError{ - field: "KubeAuth", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetKubeAuth()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetKubernetesClusterResponseValidationError{ - field: "KubeAuth", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return GetKubernetesClusterResponseMultiError(errors) - } - - return nil -} - -// GetKubernetesClusterResponseMultiError is an error wrapping multiple -// validation errors returned by GetKubernetesClusterResponse.ValidateAll() if -// the designated constraints aren't met. -type GetKubernetesClusterResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetKubernetesClusterResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetKubernetesClusterResponseMultiError) AllErrors() []error { return m } - -// GetKubernetesClusterResponseValidationError is the validation error returned -// by GetKubernetesClusterResponse.Validate if the designated constraints -// aren't met. -type GetKubernetesClusterResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetKubernetesClusterResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetKubernetesClusterResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetKubernetesClusterResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetKubernetesClusterResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetKubernetesClusterResponseValidationError) ErrorName() string { - return "GetKubernetesClusterResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetKubernetesClusterResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetKubernetesClusterResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetKubernetesClusterResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetKubernetesClusterResponseValidationError{} - -// Validate checks the field values on GetResourcesRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *GetResourcesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetResourcesRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// GetResourcesRequestMultiError, or nil if none found. -func (m *GetResourcesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetResourcesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := GetResourcesRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return GetResourcesRequestMultiError(errors) - } - - return nil -} - -// GetResourcesRequestMultiError is an error wrapping multiple validation -// errors returned by GetResourcesRequest.ValidateAll() if the designated -// constraints aren't met. -type GetResourcesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetResourcesRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetResourcesRequestMultiError) AllErrors() []error { return m } - -// GetResourcesRequestValidationError is the validation error returned by -// GetResourcesRequest.Validate if the designated constraints aren't met. -type GetResourcesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetResourcesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetResourcesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetResourcesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetResourcesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetResourcesRequestValidationError) ErrorName() string { - return "GetResourcesRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetResourcesRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetResourcesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetResourcesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetResourcesRequestValidationError{} - -// Validate checks the field values on GetResourcesResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *GetResourcesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetResourcesResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// GetResourcesResponseMultiError, or nil if none found. -func (m *GetResourcesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetResourcesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetAll()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetResourcesResponseValidationError{ - field: "All", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetResourcesResponseValidationError{ - field: "All", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAll()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetResourcesResponseValidationError{ - field: "All", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetAvailable()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetResourcesResponseValidationError{ - field: "Available", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetResourcesResponseValidationError{ - field: "Available", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAvailable()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetResourcesResponseValidationError{ - field: "Available", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return GetResourcesResponseMultiError(errors) - } - - return nil -} - -// GetResourcesResponseMultiError is an error wrapping multiple validation -// errors returned by GetResourcesResponse.ValidateAll() if the designated -// constraints aren't met. -type GetResourcesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetResourcesResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetResourcesResponseMultiError) AllErrors() []error { return m } - -// GetResourcesResponseValidationError is the validation error returned by -// GetResourcesResponse.Validate if the designated constraints aren't met. -type GetResourcesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetResourcesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetResourcesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetResourcesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetResourcesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetResourcesResponseValidationError) ErrorName() string { - return "GetResourcesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetResourcesResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetResourcesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetResourcesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetResourcesResponseValidationError{} - -// Validate checks the field values on ListStorageClassesRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ListStorageClassesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListStorageClassesRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ListStorageClassesRequestMultiError, or nil if none found. -func (m *ListStorageClassesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListStorageClassesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := ListStorageClassesRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return ListStorageClassesRequestMultiError(errors) - } - - return nil -} - -// ListStorageClassesRequestMultiError is an error wrapping multiple validation -// errors returned by ListStorageClassesRequest.ValidateAll() if the -// designated constraints aren't met. -type ListStorageClassesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListStorageClassesRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListStorageClassesRequestMultiError) AllErrors() []error { return m } - -// ListStorageClassesRequestValidationError is the validation error returned by -// ListStorageClassesRequest.Validate if the designated constraints aren't met. -type ListStorageClassesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListStorageClassesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListStorageClassesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListStorageClassesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListStorageClassesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListStorageClassesRequestValidationError) ErrorName() string { - return "ListStorageClassesRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListStorageClassesRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListStorageClassesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListStorageClassesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListStorageClassesRequestValidationError{} - -// Validate checks the field values on ListStorageClassesResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ListStorageClassesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListStorageClassesResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ListStorageClassesResponseMultiError, or nil if none found. -func (m *ListStorageClassesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListStorageClassesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return ListStorageClassesResponseMultiError(errors) - } - - return nil -} - -// ListStorageClassesResponseMultiError is an error wrapping multiple -// validation errors returned by ListStorageClassesResponse.ValidateAll() if -// the designated constraints aren't met. -type ListStorageClassesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListStorageClassesResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListStorageClassesResponseMultiError) AllErrors() []error { return m } - -// ListStorageClassesResponseValidationError is the validation error returned -// by ListStorageClassesResponse.Validate if the designated constraints aren't met. -type ListStorageClassesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListStorageClassesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListStorageClassesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListStorageClassesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListStorageClassesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListStorageClassesResponseValidationError) ErrorName() string { - return "ListStorageClassesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListStorageClassesResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListStorageClassesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListStorageClassesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListStorageClassesResponseValidationError{} - -// Validate checks the field values on ListKubernetesClustersResponse_Cluster -// with the rules defined in the proto definition for this message. If any -// rules are violated, the first error encountered is returned, or nil if -// there are no violations. -func (m *ListKubernetesClustersResponse_Cluster) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// ListKubernetesClustersResponse_Cluster with the rules defined in the proto -// definition for this message. If any rules are violated, the result is a -// list of violation errors wrapped in -// ListKubernetesClustersResponse_ClusterMultiError, or nil if none found. -func (m *ListKubernetesClustersResponse_Cluster) ValidateAll() error { - return m.validate(true) -} - -func (m *ListKubernetesClustersResponse_Cluster) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for KubernetesClusterName - - if all { - switch v := interface{}(m.GetOperators()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListKubernetesClustersResponse_ClusterValidationError{ - field: "Operators", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListKubernetesClustersResponse_ClusterValidationError{ - field: "Operators", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetOperators()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListKubernetesClustersResponse_ClusterValidationError{ - field: "Operators", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Status - - if len(errors) > 0 { - return ListKubernetesClustersResponse_ClusterMultiError(errors) - } - - return nil -} - -// ListKubernetesClustersResponse_ClusterMultiError is an error wrapping -// multiple validation errors returned by -// ListKubernetesClustersResponse_Cluster.ValidateAll() if the designated -// constraints aren't met. -type ListKubernetesClustersResponse_ClusterMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListKubernetesClustersResponse_ClusterMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListKubernetesClustersResponse_ClusterMultiError) AllErrors() []error { return m } - -// ListKubernetesClustersResponse_ClusterValidationError is the validation -// error returned by ListKubernetesClustersResponse_Cluster.Validate if the -// designated constraints aren't met. -type ListKubernetesClustersResponse_ClusterValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListKubernetesClustersResponse_ClusterValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListKubernetesClustersResponse_ClusterValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListKubernetesClustersResponse_ClusterValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListKubernetesClustersResponse_ClusterValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListKubernetesClustersResponse_ClusterValidationError) ErrorName() string { - return "ListKubernetesClustersResponse_ClusterValidationError" -} - -// Error satisfies the builtin error interface -func (e ListKubernetesClustersResponse_ClusterValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListKubernetesClustersResponse_Cluster.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListKubernetesClustersResponse_ClusterValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListKubernetesClustersResponse_ClusterValidationError{} diff --git a/api/managementpb/dbaas/kubernetes.proto b/api/managementpb/dbaas/kubernetes.proto deleted file mode 100644 index 5a1185bed5..0000000000 --- a/api/managementpb/dbaas/kubernetes.proto +++ /dev/null @@ -1,164 +0,0 @@ -syntax = "proto3"; - -package dbaas.v1beta1; - -import "google/api/annotations.proto"; -import "managementpb/dbaas/dbaas.proto"; -import "validate/validate.proto"; - -option go_package = "api/managementpb/dbaas;dbaasv1beta1"; - -// KubeAuth represents Kubernetes / kubectl authentication and authorization information. -message KubeAuth { - // Kubeconfig file content. - string kubeconfig = 1 [(validate.rules).string.min_len = 1]; -} - -// KubernetesClusterStatus defines status of Kubernetes cluster. -enum KubernetesClusterStatus { - // KUBERNETES_CLUSTER_STATUS_INVALID represents unknown state. - KUBERNETES_CLUSTER_STATUS_INVALID = 0; - // KUBERNETES_CLUSTER_STATUS_OK represents that Kubernetes cluster is accessible. - KUBERNETES_CLUSTER_STATUS_OK = 1; - // KUBERNETES_CLUSTER_STATUS_UNAVAILABLE represents that Kubernetes cluster is not accessible. - KUBERNETES_CLUSTER_STATUS_UNAVAILABLE = 2; - // KUBERNETES_CLUSTER_STATUS_PROVISIONING represents that Kubernetes cluster is privisioning. - KUBERNETES_CLUSTER_STATUS_PROVISIONING = 4; -} - -// Operator contains all information about operator installed in Kubernetes cluster. -message Operator { - OperatorsStatus status = 1; - string version = 2; -} - -// Operators contains list of operators installed in Kubernetes cluster. -message Operators { - // Percona PXC Cluster Operator. - Operator pxc = 1; - // Percona Server for MongoDB Operator. - Operator psmdb = 2; - // DBaaS operator. - Operator dbaas = 3; -} - -message ListKubernetesClustersRequest {} - -message ListKubernetesClustersResponse { - // Cluster contains public info about Kubernetes cluster. - // TODO Do not use inner messages in all public APIs (for consistency). - message Cluster { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1; - // Installed operators. - Operators operators = 2; - // Status of Kubernetes cluster. - KubernetesClusterStatus status = 3; - } - // Kubernetes clusters. - repeated Cluster kubernetes_clusters = 1; -} - -message RegisterKubernetesClusterRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; - // Kubernetes auth. - KubeAuth kube_auth = 2 [(validate.rules).message.required = true]; - // AWS access key id, only needed when registering EKS cluster and kubeconfig does not contain it. - string aws_access_key_id = 3; - // AWS secret access key, only needed when registering EKS cluster and kubeconfig does not contain it. - string aws_secret_access_key = 4; -} - -message RegisterKubernetesClusterResponse {} - -message UnregisterKubernetesClusterRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; - // If true then Kubernetes cluster will be deleted - // even if it contains database clusters. - bool force = 2; -} - -message UnregisterKubernetesClusterResponse {} - -message GetKubernetesClusterRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; -} - -message GetKubernetesClusterResponse { - // Kubernetes auth. - KubeAuth kube_auth = 1; -} - -message GetResourcesRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; -} - -message GetResourcesResponse { - // The total amount of resources of the Kubernetes cluster. - Resources all = 1; - // The amount of resources that is available for consumption by future Kubernetes workloads. - Resources available = 2; -} - -message ListStorageClassesRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; -} - -message ListStorageClassesResponse { - // Kubernetes storage classes names. - repeated string storage_classes = 1; -} - -// Kubernetes service provides public methods for managing Kubernetes clusters. -service Kubernetes { - // ListKubernetesClusters returns a list of all registered Kubernetes clusters. - rpc ListKubernetesClusters(ListKubernetesClustersRequest) returns (ListKubernetesClustersResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/Kubernetes/List" - body: "*" - }; - } - // RegisterKubernetesCluster registers an existing Kubernetes cluster in PMM. - rpc RegisterKubernetesCluster(RegisterKubernetesClusterRequest) returns (RegisterKubernetesClusterResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/Kubernetes/Register" - body: "*" - }; - } - // UnregisterKubernetesCluster removes a registered Kubernetes cluster from PMM. - rpc UnregisterKubernetesCluster(UnregisterKubernetesClusterRequest) returns (UnregisterKubernetesClusterResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/Kubernetes/Unregister" - body: "*" - }; - } - // GetKubernetesCluster return KubeAuth with Kubernetes config. - rpc GetKubernetesCluster(GetKubernetesClusterRequest) returns (GetKubernetesClusterResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/Kubernetes/Get" - body: "*" - }; - } - // GetResources returns all and available resources of a Kubernetes cluster. - // NOTE: 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. - rpc GetResources(GetResourcesRequest) returns (GetResourcesResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/Kubernetes/Resources/Get" - body: "*" - }; - } - // ListStorageClasses returns the names of all storage classes available in a Kubernetes cluster. - rpc ListStorageClasses(ListStorageClassesRequest) returns (ListStorageClassesResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/Kubernetes/StorageClasses/List" - body: "*" - }; - } -} diff --git a/api/managementpb/dbaas/kubernetes_grpc.pb.go b/api/managementpb/dbaas/kubernetes_grpc.pb.go deleted file mode 100644 index a622af13ca..0000000000 --- a/api/managementpb/dbaas/kubernetes_grpc.pb.go +++ /dev/null @@ -1,319 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: managementpb/dbaas/kubernetes.proto - -package dbaasv1beta1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - Kubernetes_ListKubernetesClusters_FullMethodName = "/dbaas.v1beta1.Kubernetes/ListKubernetesClusters" - Kubernetes_RegisterKubernetesCluster_FullMethodName = "/dbaas.v1beta1.Kubernetes/RegisterKubernetesCluster" - Kubernetes_UnregisterKubernetesCluster_FullMethodName = "/dbaas.v1beta1.Kubernetes/UnregisterKubernetesCluster" - Kubernetes_GetKubernetesCluster_FullMethodName = "/dbaas.v1beta1.Kubernetes/GetKubernetesCluster" - Kubernetes_GetResources_FullMethodName = "/dbaas.v1beta1.Kubernetes/GetResources" - Kubernetes_ListStorageClasses_FullMethodName = "/dbaas.v1beta1.Kubernetes/ListStorageClasses" -) - -// KubernetesClient is the client API for Kubernetes service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type KubernetesClient interface { - // ListKubernetesClusters returns a list of all registered Kubernetes clusters. - ListKubernetesClusters(ctx context.Context, in *ListKubernetesClustersRequest, opts ...grpc.CallOption) (*ListKubernetesClustersResponse, error) - // RegisterKubernetesCluster registers an existing Kubernetes cluster in PMM. - RegisterKubernetesCluster(ctx context.Context, in *RegisterKubernetesClusterRequest, opts ...grpc.CallOption) (*RegisterKubernetesClusterResponse, error) - // UnregisterKubernetesCluster removes a registered Kubernetes cluster from PMM. - UnregisterKubernetesCluster(ctx context.Context, in *UnregisterKubernetesClusterRequest, opts ...grpc.CallOption) (*UnregisterKubernetesClusterResponse, error) - // GetKubernetesCluster return KubeAuth with Kubernetes config. - GetKubernetesCluster(ctx context.Context, in *GetKubernetesClusterRequest, opts ...grpc.CallOption) (*GetKubernetesClusterResponse, error) - // GetResources returns all and available resources of a Kubernetes cluster. - // NOTE: 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. - GetResources(ctx context.Context, in *GetResourcesRequest, opts ...grpc.CallOption) (*GetResourcesResponse, error) - // ListStorageClasses returns the names of all storage classes available in a Kubernetes cluster. - ListStorageClasses(ctx context.Context, in *ListStorageClassesRequest, opts ...grpc.CallOption) (*ListStorageClassesResponse, error) -} - -type kubernetesClient struct { - cc grpc.ClientConnInterface -} - -func NewKubernetesClient(cc grpc.ClientConnInterface) KubernetesClient { - return &kubernetesClient{cc} -} - -func (c *kubernetesClient) ListKubernetesClusters(ctx context.Context, in *ListKubernetesClustersRequest, opts ...grpc.CallOption) (*ListKubernetesClustersResponse, error) { - out := new(ListKubernetesClustersResponse) - err := c.cc.Invoke(ctx, Kubernetes_ListKubernetesClusters_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kubernetesClient) RegisterKubernetesCluster(ctx context.Context, in *RegisterKubernetesClusterRequest, opts ...grpc.CallOption) (*RegisterKubernetesClusterResponse, error) { - out := new(RegisterKubernetesClusterResponse) - err := c.cc.Invoke(ctx, Kubernetes_RegisterKubernetesCluster_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kubernetesClient) UnregisterKubernetesCluster(ctx context.Context, in *UnregisterKubernetesClusterRequest, opts ...grpc.CallOption) (*UnregisterKubernetesClusterResponse, error) { - out := new(UnregisterKubernetesClusterResponse) - err := c.cc.Invoke(ctx, Kubernetes_UnregisterKubernetesCluster_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kubernetesClient) GetKubernetesCluster(ctx context.Context, in *GetKubernetesClusterRequest, opts ...grpc.CallOption) (*GetKubernetesClusterResponse, error) { - out := new(GetKubernetesClusterResponse) - err := c.cc.Invoke(ctx, Kubernetes_GetKubernetesCluster_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kubernetesClient) GetResources(ctx context.Context, in *GetResourcesRequest, opts ...grpc.CallOption) (*GetResourcesResponse, error) { - out := new(GetResourcesResponse) - err := c.cc.Invoke(ctx, Kubernetes_GetResources_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kubernetesClient) ListStorageClasses(ctx context.Context, in *ListStorageClassesRequest, opts ...grpc.CallOption) (*ListStorageClassesResponse, error) { - out := new(ListStorageClassesResponse) - err := c.cc.Invoke(ctx, Kubernetes_ListStorageClasses_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// KubernetesServer is the server API for Kubernetes service. -// All implementations must embed UnimplementedKubernetesServer -// for forward compatibility -type KubernetesServer interface { - // ListKubernetesClusters returns a list of all registered Kubernetes clusters. - ListKubernetesClusters(context.Context, *ListKubernetesClustersRequest) (*ListKubernetesClustersResponse, error) - // RegisterKubernetesCluster registers an existing Kubernetes cluster in PMM. - RegisterKubernetesCluster(context.Context, *RegisterKubernetesClusterRequest) (*RegisterKubernetesClusterResponse, error) - // UnregisterKubernetesCluster removes a registered Kubernetes cluster from PMM. - UnregisterKubernetesCluster(context.Context, *UnregisterKubernetesClusterRequest) (*UnregisterKubernetesClusterResponse, error) - // GetKubernetesCluster return KubeAuth with Kubernetes config. - GetKubernetesCluster(context.Context, *GetKubernetesClusterRequest) (*GetKubernetesClusterResponse, error) - // GetResources returns all and available resources of a Kubernetes cluster. - // NOTE: 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. - GetResources(context.Context, *GetResourcesRequest) (*GetResourcesResponse, error) - // ListStorageClasses returns the names of all storage classes available in a Kubernetes cluster. - ListStorageClasses(context.Context, *ListStorageClassesRequest) (*ListStorageClassesResponse, error) - mustEmbedUnimplementedKubernetesServer() -} - -// UnimplementedKubernetesServer must be embedded to have forward compatible implementations. -type UnimplementedKubernetesServer struct{} - -func (UnimplementedKubernetesServer) ListKubernetesClusters(context.Context, *ListKubernetesClustersRequest) (*ListKubernetesClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListKubernetesClusters not implemented") -} - -func (UnimplementedKubernetesServer) RegisterKubernetesCluster(context.Context, *RegisterKubernetesClusterRequest) (*RegisterKubernetesClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterKubernetesCluster not implemented") -} - -func (UnimplementedKubernetesServer) UnregisterKubernetesCluster(context.Context, *UnregisterKubernetesClusterRequest) (*UnregisterKubernetesClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UnregisterKubernetesCluster not implemented") -} - -func (UnimplementedKubernetesServer) GetKubernetesCluster(context.Context, *GetKubernetesClusterRequest) (*GetKubernetesClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetKubernetesCluster not implemented") -} - -func (UnimplementedKubernetesServer) GetResources(context.Context, *GetResourcesRequest) (*GetResourcesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetResources not implemented") -} - -func (UnimplementedKubernetesServer) ListStorageClasses(context.Context, *ListStorageClassesRequest) (*ListStorageClassesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListStorageClasses not implemented") -} -func (UnimplementedKubernetesServer) mustEmbedUnimplementedKubernetesServer() {} - -// UnsafeKubernetesServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to KubernetesServer will -// result in compilation errors. -type UnsafeKubernetesServer interface { - mustEmbedUnimplementedKubernetesServer() -} - -func RegisterKubernetesServer(s grpc.ServiceRegistrar, srv KubernetesServer) { - s.RegisterService(&Kubernetes_ServiceDesc, srv) -} - -func _Kubernetes_ListKubernetesClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListKubernetesClustersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KubernetesServer).ListKubernetesClusters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Kubernetes_ListKubernetesClusters_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KubernetesServer).ListKubernetesClusters(ctx, req.(*ListKubernetesClustersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Kubernetes_RegisterKubernetesCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RegisterKubernetesClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KubernetesServer).RegisterKubernetesCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Kubernetes_RegisterKubernetesCluster_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KubernetesServer).RegisterKubernetesCluster(ctx, req.(*RegisterKubernetesClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Kubernetes_UnregisterKubernetesCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UnregisterKubernetesClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KubernetesServer).UnregisterKubernetesCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Kubernetes_UnregisterKubernetesCluster_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KubernetesServer).UnregisterKubernetesCluster(ctx, req.(*UnregisterKubernetesClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Kubernetes_GetKubernetesCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetKubernetesClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KubernetesServer).GetKubernetesCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Kubernetes_GetKubernetesCluster_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KubernetesServer).GetKubernetesCluster(ctx, req.(*GetKubernetesClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Kubernetes_GetResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetResourcesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KubernetesServer).GetResources(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Kubernetes_GetResources_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KubernetesServer).GetResources(ctx, req.(*GetResourcesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Kubernetes_ListStorageClasses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListStorageClassesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KubernetesServer).ListStorageClasses(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Kubernetes_ListStorageClasses_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KubernetesServer).ListStorageClasses(ctx, req.(*ListStorageClassesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Kubernetes_ServiceDesc is the grpc.ServiceDesc for Kubernetes service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Kubernetes_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "dbaas.v1beta1.Kubernetes", - HandlerType: (*KubernetesServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListKubernetesClusters", - Handler: _Kubernetes_ListKubernetesClusters_Handler, - }, - { - MethodName: "RegisterKubernetesCluster", - Handler: _Kubernetes_RegisterKubernetesCluster_Handler, - }, - { - MethodName: "UnregisterKubernetesCluster", - Handler: _Kubernetes_UnregisterKubernetesCluster_Handler, - }, - { - MethodName: "GetKubernetesCluster", - Handler: _Kubernetes_GetKubernetesCluster_Handler, - }, - { - MethodName: "GetResources", - Handler: _Kubernetes_GetResources_Handler, - }, - { - MethodName: "ListStorageClasses", - Handler: _Kubernetes_ListStorageClasses_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "managementpb/dbaas/kubernetes.proto", -} diff --git a/api/managementpb/dbaas/logs.pb.go b/api/managementpb/dbaas/logs.pb.go deleted file mode 100644 index e24145f79e..0000000000 --- a/api/managementpb/dbaas/logs.pb.go +++ /dev/null @@ -1,341 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: managementpb/dbaas/logs.proto - -package dbaasv1beta1 - -import ( - reflect "reflect" - sync "sync" - - _ "github.com/envoyproxy/protoc-gen-validate/validate" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Logs contain logs for certain pod's container. If container is an empty -// string, logs contain pod's events. -type Logs struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Pod name. - Pod string `protobuf:"bytes,1,opt,name=pod,proto3" json:"pod,omitempty"` - // Container name. - Container string `protobuf:"bytes,2,opt,name=container,proto3" json:"container,omitempty"` - // Content of container's log or pod's events. - Logs []string `protobuf:"bytes,3,rep,name=logs,proto3" json:"logs,omitempty"` -} - -func (x *Logs) Reset() { - *x = Logs{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_logs_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Logs) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Logs) ProtoMessage() {} - -func (x *Logs) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_logs_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Logs.ProtoReflect.Descriptor instead. -func (*Logs) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_logs_proto_rawDescGZIP(), []int{0} -} - -func (x *Logs) GetPod() string { - if x != nil { - return x.Pod - } - return "" -} - -func (x *Logs) GetContainer() string { - if x != nil { - return x.Container - } - return "" -} - -func (x *Logs) GetLogs() []string { - if x != nil { - return x.Logs - } - return nil -} - -type GetLogsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - // DB cluster name. - ClusterName string `protobuf:"bytes,2,opt,name=cluster_name,json=clusterName,proto3" json:"cluster_name,omitempty"` -} - -func (x *GetLogsRequest) Reset() { - *x = GetLogsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_logs_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetLogsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLogsRequest) ProtoMessage() {} - -func (x *GetLogsRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_logs_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetLogsRequest.ProtoReflect.Descriptor instead. -func (*GetLogsRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_logs_proto_rawDescGZIP(), []int{1} -} - -func (x *GetLogsRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *GetLogsRequest) GetClusterName() string { - if x != nil { - return x.ClusterName - } - return "" -} - -type GetLogsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Log represents list of logs. Each entry contains either container's logs or, - // when container field is empty, pod's events. - Logs []*Logs `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"` -} - -func (x *GetLogsResponse) Reset() { - *x = GetLogsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_logs_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetLogsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLogsResponse) ProtoMessage() {} - -func (x *GetLogsResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_logs_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetLogsResponse.ProtoReflect.Descriptor instead. -func (*GetLogsResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_logs_proto_rawDescGZIP(), []int{2} -} - -func (x *GetLogsResponse) GetLogs() []*Logs { - if x != nil { - return x.Logs - } - return nil -} - -var File_managementpb_dbaas_logs_proto protoreflect.FileDescriptor - -var file_managementpb_dbaas_logs_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2f, 0x6c, 0x6f, 0x67, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x0d, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4a, 0x0a, 0x04, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x10, 0x0a, - 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x12, - 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, - 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x6f, 0x67, - 0x73, 0x22, 0x7d, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, - 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x15, 0x6b, - 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, - 0x02, 0x10, 0x01, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, - 0x22, 0x3a, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x32, 0x7c, 0x0a, 0x07, - 0x4c, 0x6f, 0x67, 0x73, 0x41, 0x50, 0x49, 0x12, 0x71, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4c, 0x6f, - 0x67, 0x73, 0x12, 0x1d, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1e, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, 0x2f, 0x76, - 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, - 0x61, 0x53, 0x2f, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x42, 0xaf, 0x01, 0x0a, 0x11, 0x63, - 0x6f, 0x6d, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x42, 0x09, 0x4c, 0x6f, 0x67, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, - 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x3b, 0x64, 0x62, 0x61, - 0x61, 0x73, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, - 0x02, 0x0d, 0x44, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, - 0x02, 0x0d, 0x44, 0x62, 0x61, 0x61, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, - 0x02, 0x19, 0x44, 0x62, 0x61, 0x61, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x44, 0x62, - 0x61, 0x61, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_managementpb_dbaas_logs_proto_rawDescOnce sync.Once - file_managementpb_dbaas_logs_proto_rawDescData = file_managementpb_dbaas_logs_proto_rawDesc -) - -func file_managementpb_dbaas_logs_proto_rawDescGZIP() []byte { - file_managementpb_dbaas_logs_proto_rawDescOnce.Do(func() { - file_managementpb_dbaas_logs_proto_rawDescData = protoimpl.X.CompressGZIP(file_managementpb_dbaas_logs_proto_rawDescData) - }) - return file_managementpb_dbaas_logs_proto_rawDescData -} - -var ( - file_managementpb_dbaas_logs_proto_msgTypes = make([]protoimpl.MessageInfo, 3) - file_managementpb_dbaas_logs_proto_goTypes = []interface{}{ - (*Logs)(nil), // 0: dbaas.v1beta1.Logs - (*GetLogsRequest)(nil), // 1: dbaas.v1beta1.GetLogsRequest - (*GetLogsResponse)(nil), // 2: dbaas.v1beta1.GetLogsResponse - } -) - -var file_managementpb_dbaas_logs_proto_depIdxs = []int32{ - 0, // 0: dbaas.v1beta1.GetLogsResponse.logs:type_name -> dbaas.v1beta1.Logs - 1, // 1: dbaas.v1beta1.LogsAPI.GetLogs:input_type -> dbaas.v1beta1.GetLogsRequest - 2, // 2: dbaas.v1beta1.LogsAPI.GetLogs:output_type -> dbaas.v1beta1.GetLogsResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_managementpb_dbaas_logs_proto_init() } -func file_managementpb_dbaas_logs_proto_init() { - if File_managementpb_dbaas_logs_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_managementpb_dbaas_logs_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Logs); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_logs_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLogsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_logs_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLogsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_managementpb_dbaas_logs_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_managementpb_dbaas_logs_proto_goTypes, - DependencyIndexes: file_managementpb_dbaas_logs_proto_depIdxs, - MessageInfos: file_managementpb_dbaas_logs_proto_msgTypes, - }.Build() - File_managementpb_dbaas_logs_proto = out.File - file_managementpb_dbaas_logs_proto_rawDesc = nil - file_managementpb_dbaas_logs_proto_goTypes = nil - file_managementpb_dbaas_logs_proto_depIdxs = nil -} diff --git a/api/managementpb/dbaas/logs.pb.gw.go b/api/managementpb/dbaas/logs.pb.gw.go deleted file mode 100644 index e6161d8e30..0000000000 --- a/api/managementpb/dbaas/logs.pb.gw.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: managementpb/dbaas/logs.proto - -/* -Package dbaasv1beta1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package dbaasv1beta1 - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_LogsAPI_GetLogs_0(ctx context.Context, marshaler runtime.Marshaler, client LogsAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetLogsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetLogs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_LogsAPI_GetLogs_0(ctx context.Context, marshaler runtime.Marshaler, server LogsAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetLogsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetLogs(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterLogsAPIHandlerServer registers the http handlers for service LogsAPI to "mux". -// UnaryRPC :call LogsAPIServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterLogsAPIHandlerFromEndpoint instead. -func RegisterLogsAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LogsAPIServer) error { - mux.Handle("POST", pattern_LogsAPI_GetLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.LogsAPI/GetLogs", runtime.WithHTTPPathPattern("/v1/management/DBaaS/GetLogs")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_LogsAPI_GetLogs_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_LogsAPI_GetLogs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterLogsAPIHandlerFromEndpoint is same as RegisterLogsAPIHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterLogsAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterLogsAPIHandler(ctx, mux, conn) -} - -// RegisterLogsAPIHandler registers the http handlers for service LogsAPI to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterLogsAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterLogsAPIHandlerClient(ctx, mux, NewLogsAPIClient(conn)) -} - -// RegisterLogsAPIHandlerClient registers the http handlers for service LogsAPI -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "LogsAPIClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LogsAPIClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "LogsAPIClient" to call the correct interceptors. -func RegisterLogsAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LogsAPIClient) error { - mux.Handle("POST", pattern_LogsAPI_GetLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.LogsAPI/GetLogs", runtime.WithHTTPPathPattern("/v1/management/DBaaS/GetLogs")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_LogsAPI_GetLogs_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_LogsAPI_GetLogs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -var pattern_LogsAPI_GetLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "management", "DBaaS", "GetLogs"}, "")) - -var forward_LogsAPI_GetLogs_0 = runtime.ForwardResponseMessage diff --git a/api/managementpb/dbaas/logs.pb.validate.go b/api/managementpb/dbaas/logs.pb.validate.go deleted file mode 100644 index 667deacae0..0000000000 --- a/api/managementpb/dbaas/logs.pb.validate.go +++ /dev/null @@ -1,394 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: managementpb/dbaas/logs.proto - -package dbaasv1beta1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on Logs with the rules defined in the proto -// definition for this message. If any rules are violated, the first error -// encountered is returned, or nil if there are no violations. -func (m *Logs) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Logs with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in LogsMultiError, or nil if none found. -func (m *Logs) ValidateAll() error { - return m.validate(true) -} - -func (m *Logs) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Pod - - // no validation rules for Container - - if len(errors) > 0 { - return LogsMultiError(errors) - } - - return nil -} - -// LogsMultiError is an error wrapping multiple validation errors returned by -// Logs.ValidateAll() if the designated constraints aren't met. -type LogsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m LogsMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m LogsMultiError) AllErrors() []error { return m } - -// LogsValidationError is the validation error returned by Logs.Validate if the -// designated constraints aren't met. -type LogsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e LogsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e LogsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e LogsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e LogsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e LogsValidationError) ErrorName() string { return "LogsValidationError" } - -// Error satisfies the builtin error interface -func (e LogsValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sLogs.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = LogsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = LogsValidationError{} - -// Validate checks the field values on GetLogsRequest with the rules defined in -// the proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *GetLogsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetLogsRequest with the rules defined -// in the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in GetLogsRequestMultiError, -// or nil if none found. -func (m *GetLogsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetLogsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := GetLogsRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetClusterName()) < 1 { - err := GetLogsRequestValidationError{ - field: "ClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return GetLogsRequestMultiError(errors) - } - - return nil -} - -// GetLogsRequestMultiError is an error wrapping multiple validation errors -// returned by GetLogsRequest.ValidateAll() if the designated constraints -// aren't met. -type GetLogsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetLogsRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetLogsRequestMultiError) AllErrors() []error { return m } - -// GetLogsRequestValidationError is the validation error returned by -// GetLogsRequest.Validate if the designated constraints aren't met. -type GetLogsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetLogsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetLogsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetLogsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetLogsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetLogsRequestValidationError) ErrorName() string { return "GetLogsRequestValidationError" } - -// Error satisfies the builtin error interface -func (e GetLogsRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetLogsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetLogsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetLogsRequestValidationError{} - -// Validate checks the field values on GetLogsResponse with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *GetLogsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetLogsResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// GetLogsResponseMultiError, or nil if none found. -func (m *GetLogsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetLogsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetLogs() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetLogsResponseValidationError{ - field: fmt.Sprintf("Logs[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetLogsResponseValidationError{ - field: fmt.Sprintf("Logs[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetLogsResponseValidationError{ - field: fmt.Sprintf("Logs[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return GetLogsResponseMultiError(errors) - } - - return nil -} - -// GetLogsResponseMultiError is an error wrapping multiple validation errors -// returned by GetLogsResponse.ValidateAll() if the designated constraints -// aren't met. -type GetLogsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetLogsResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetLogsResponseMultiError) AllErrors() []error { return m } - -// GetLogsResponseValidationError is the validation error returned by -// GetLogsResponse.Validate if the designated constraints aren't met. -type GetLogsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetLogsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetLogsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetLogsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetLogsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetLogsResponseValidationError) ErrorName() string { return "GetLogsResponseValidationError" } - -// Error satisfies the builtin error interface -func (e GetLogsResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetLogsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetLogsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetLogsResponseValidationError{} diff --git a/api/managementpb/dbaas/logs.proto b/api/managementpb/dbaas/logs.proto deleted file mode 100644 index d9d153530d..0000000000 --- a/api/managementpb/dbaas/logs.proto +++ /dev/null @@ -1,43 +0,0 @@ -syntax = "proto3"; - -package dbaas.v1beta1; - -import "google/api/annotations.proto"; -import "validate/validate.proto"; - -option go_package = "api/managementpb/dbaas;dbaasv1beta1"; - -// Logs contain logs for certain pod's container. If container is an empty -// string, logs contain pod's events. -message Logs { - // Pod name. - string pod = 1; - // Container name. - string container = 2; - // Content of container's log or pod's events. - repeated string logs = 3; -} - -message GetLogsRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; - // DB cluster name. - string cluster_name = 2 [(validate.rules).string.min_len = 1]; -} - -message GetLogsResponse { - // Log represents list of logs. Each entry contains either container's logs or, - // when container field is empty, pod's events. - repeated Logs logs = 1; -} - -// LogsAPI provides APIs for reading logs. -service LogsAPI { - // GetLogs gets all logs from db cluster. - rpc GetLogs(GetLogsRequest) returns (GetLogsResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/GetLogs" - body: "*" - }; - } -} diff --git a/api/managementpb/dbaas/logs_grpc.pb.go b/api/managementpb/dbaas/logs_grpc.pb.go deleted file mode 100644 index 217d7a0dfb..0000000000 --- a/api/managementpb/dbaas/logs_grpc.pb.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: managementpb/dbaas/logs.proto - -package dbaasv1beta1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - LogsAPI_GetLogs_FullMethodName = "/dbaas.v1beta1.LogsAPI/GetLogs" -) - -// LogsAPIClient is the client API for LogsAPI service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type LogsAPIClient interface { - // GetLogs gets all logs from db cluster. - GetLogs(ctx context.Context, in *GetLogsRequest, opts ...grpc.CallOption) (*GetLogsResponse, error) -} - -type logsAPIClient struct { - cc grpc.ClientConnInterface -} - -func NewLogsAPIClient(cc grpc.ClientConnInterface) LogsAPIClient { - return &logsAPIClient{cc} -} - -func (c *logsAPIClient) GetLogs(ctx context.Context, in *GetLogsRequest, opts ...grpc.CallOption) (*GetLogsResponse, error) { - out := new(GetLogsResponse) - err := c.cc.Invoke(ctx, LogsAPI_GetLogs_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// LogsAPIServer is the server API for LogsAPI service. -// All implementations must embed UnimplementedLogsAPIServer -// for forward compatibility -type LogsAPIServer interface { - // GetLogs gets all logs from db cluster. - GetLogs(context.Context, *GetLogsRequest) (*GetLogsResponse, error) - mustEmbedUnimplementedLogsAPIServer() -} - -// UnimplementedLogsAPIServer must be embedded to have forward compatible implementations. -type UnimplementedLogsAPIServer struct{} - -func (UnimplementedLogsAPIServer) GetLogs(context.Context, *GetLogsRequest) (*GetLogsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetLogs not implemented") -} -func (UnimplementedLogsAPIServer) mustEmbedUnimplementedLogsAPIServer() {} - -// UnsafeLogsAPIServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to LogsAPIServer will -// result in compilation errors. -type UnsafeLogsAPIServer interface { - mustEmbedUnimplementedLogsAPIServer() -} - -func RegisterLogsAPIServer(s grpc.ServiceRegistrar, srv LogsAPIServer) { - s.RegisterService(&LogsAPI_ServiceDesc, srv) -} - -func _LogsAPI_GetLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetLogsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LogsAPIServer).GetLogs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: LogsAPI_GetLogs_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LogsAPIServer).GetLogs(ctx, req.(*GetLogsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// LogsAPI_ServiceDesc is the grpc.ServiceDesc for LogsAPI service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var LogsAPI_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "dbaas.v1beta1.LogsAPI", - HandlerType: (*LogsAPIServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetLogs", - Handler: _LogsAPI_GetLogs_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "managementpb/dbaas/logs.proto", -} diff --git a/api/managementpb/dbaas/psmdb_clusters.pb.go b/api/managementpb/dbaas/psmdb_clusters.pb.go deleted file mode 100644 index 4dda99c751..0000000000 --- a/api/managementpb/dbaas/psmdb_clusters.pb.go +++ /dev/null @@ -1,1373 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: managementpb/dbaas/psmdb_clusters.proto - -package dbaasv1beta1 - -import ( - reflect "reflect" - sync "sync" - - _ "github.com/envoyproxy/protoc-gen-validate/validate" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// PSMDBClusterParams represents PSMDB cluster parameters that can be updated. -type PSMDBClusterParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Cluster size. - ClusterSize int32 `protobuf:"varint,1,opt,name=cluster_size,json=clusterSize,proto3" json:"cluster_size,omitempty"` - // ReplicaSet container parameters. - Replicaset *PSMDBClusterParams_ReplicaSet `protobuf:"bytes,2,opt,name=replicaset,proto3" json:"replicaset,omitempty"` - // Docker image used for PSMDB. - Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` - // Backup configuration parameters. - Backup *Backup `protobuf:"bytes,4,opt,name=backup,proto3" json:"backup,omitempty"` - // Restore configuration parameters. - Restore *Restore `protobuf:"bytes,5,opt,name=restore,proto3" json:"restore,omitempty"` -} - -func (x *PSMDBClusterParams) Reset() { - *x = PSMDBClusterParams{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PSMDBClusterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PSMDBClusterParams) ProtoMessage() {} - -func (x *PSMDBClusterParams) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PSMDBClusterParams.ProtoReflect.Descriptor instead. -func (*PSMDBClusterParams) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_psmdb_clusters_proto_rawDescGZIP(), []int{0} -} - -func (x *PSMDBClusterParams) GetClusterSize() int32 { - if x != nil { - return x.ClusterSize - } - return 0 -} - -func (x *PSMDBClusterParams) GetReplicaset() *PSMDBClusterParams_ReplicaSet { - if x != nil { - return x.Replicaset - } - return nil -} - -func (x *PSMDBClusterParams) GetImage() string { - if x != nil { - return x.Image - } - return "" -} - -func (x *PSMDBClusterParams) GetBackup() *Backup { - if x != nil { - return x.Backup - } - return nil -} - -func (x *PSMDBClusterParams) GetRestore() *Restore { - if x != nil { - return x.Restore - } - return nil -} - -type GetPSMDBClusterCredentialsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - // PSMDB cluster name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *GetPSMDBClusterCredentialsRequest) Reset() { - *x = GetPSMDBClusterCredentialsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPSMDBClusterCredentialsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPSMDBClusterCredentialsRequest) ProtoMessage() {} - -func (x *GetPSMDBClusterCredentialsRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPSMDBClusterCredentialsRequest.ProtoReflect.Descriptor instead. -func (*GetPSMDBClusterCredentialsRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_psmdb_clusters_proto_rawDescGZIP(), []int{1} -} - -func (x *GetPSMDBClusterCredentialsRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *GetPSMDBClusterCredentialsRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type GetPSMDBClusterCredentialsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ConnectionCredentials *GetPSMDBClusterCredentialsResponse_PSMDBCredentials `protobuf:"bytes,1,opt,name=connection_credentials,json=connectionCredentials,proto3" json:"connection_credentials,omitempty"` -} - -func (x *GetPSMDBClusterCredentialsResponse) Reset() { - *x = GetPSMDBClusterCredentialsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPSMDBClusterCredentialsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPSMDBClusterCredentialsResponse) ProtoMessage() {} - -func (x *GetPSMDBClusterCredentialsResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPSMDBClusterCredentialsResponse.ProtoReflect.Descriptor instead. -func (*GetPSMDBClusterCredentialsResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_psmdb_clusters_proto_rawDescGZIP(), []int{2} -} - -func (x *GetPSMDBClusterCredentialsResponse) GetConnectionCredentials() *GetPSMDBClusterCredentialsResponse_PSMDBCredentials { - if x != nil { - return x.ConnectionCredentials - } - return nil -} - -type CreatePSMDBClusterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - // PSMDB cluster name. - // a DNS-1035 label must consist of lower case alphanumeric characters or '-', - // start with an alphabetic character, and end with an alphanumeric character - // (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?') - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Cluster parameters. - Params *PSMDBClusterParams `protobuf:"bytes,3,opt,name=params,proto3" json:"params,omitempty"` - // Make DB cluster accessible outside of K8s cluster. - Expose bool `protobuf:"varint,4,opt,name=expose,proto3" json:"expose,omitempty"` - // Make DB cluster accessible via public internet. - InternetFacing bool `protobuf:"varint,5,opt,name=internet_facing,json=internetFacing,proto3" json:"internet_facing,omitempty"` - // Apply IP source ranges against the cluster. - SourceRanges []string `protobuf:"bytes,6,rep,name=source_ranges,json=sourceRanges,proto3" json:"source_ranges,omitempty"` - // Configuration template. - Template *Template `protobuf:"bytes,7,opt,name=template,proto3" json:"template,omitempty"` -} - -func (x *CreatePSMDBClusterRequest) Reset() { - *x = CreatePSMDBClusterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreatePSMDBClusterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePSMDBClusterRequest) ProtoMessage() {} - -func (x *CreatePSMDBClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreatePSMDBClusterRequest.ProtoReflect.Descriptor instead. -func (*CreatePSMDBClusterRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_psmdb_clusters_proto_rawDescGZIP(), []int{3} -} - -func (x *CreatePSMDBClusterRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *CreatePSMDBClusterRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreatePSMDBClusterRequest) GetParams() *PSMDBClusterParams { - if x != nil { - return x.Params - } - return nil -} - -func (x *CreatePSMDBClusterRequest) GetExpose() bool { - if x != nil { - return x.Expose - } - return false -} - -func (x *CreatePSMDBClusterRequest) GetInternetFacing() bool { - if x != nil { - return x.InternetFacing - } - return false -} - -func (x *CreatePSMDBClusterRequest) GetSourceRanges() []string { - if x != nil { - return x.SourceRanges - } - return nil -} - -func (x *CreatePSMDBClusterRequest) GetTemplate() *Template { - if x != nil { - return x.Template - } - return nil -} - -type CreatePSMDBClusterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *CreatePSMDBClusterResponse) Reset() { - *x = CreatePSMDBClusterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreatePSMDBClusterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePSMDBClusterResponse) ProtoMessage() {} - -func (x *CreatePSMDBClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreatePSMDBClusterResponse.ProtoReflect.Descriptor instead. -func (*CreatePSMDBClusterResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_psmdb_clusters_proto_rawDescGZIP(), []int{4} -} - -type UpdatePSMDBClusterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - // PSMDB cluster name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Cluster parameters. - Params *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams `protobuf:"bytes,3,opt,name=params,proto3" json:"params,omitempty"` - // Make DB cluster accessible outside of K8s cluster. - Expose bool `protobuf:"varint,4,opt,name=expose,proto3" json:"expose,omitempty"` - // Make DB cluster accessible via public internet. - InternetFacing bool `protobuf:"varint,5,opt,name=internet_facing,json=internetFacing,proto3" json:"internet_facing,omitempty"` - // Apply IP source ranges against the cluster. - SourceRanges []string `protobuf:"bytes,6,rep,name=source_ranges,json=sourceRanges,proto3" json:"source_ranges,omitempty"` - // Configuration template. - Template *Template `protobuf:"bytes,7,opt,name=template,proto3" json:"template,omitempty"` -} - -func (x *UpdatePSMDBClusterRequest) Reset() { - *x = UpdatePSMDBClusterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdatePSMDBClusterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdatePSMDBClusterRequest) ProtoMessage() {} - -func (x *UpdatePSMDBClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdatePSMDBClusterRequest.ProtoReflect.Descriptor instead. -func (*UpdatePSMDBClusterRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_psmdb_clusters_proto_rawDescGZIP(), []int{5} -} - -func (x *UpdatePSMDBClusterRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *UpdatePSMDBClusterRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *UpdatePSMDBClusterRequest) GetParams() *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams { - if x != nil { - return x.Params - } - return nil -} - -func (x *UpdatePSMDBClusterRequest) GetExpose() bool { - if x != nil { - return x.Expose - } - return false -} - -func (x *UpdatePSMDBClusterRequest) GetInternetFacing() bool { - if x != nil { - return x.InternetFacing - } - return false -} - -func (x *UpdatePSMDBClusterRequest) GetSourceRanges() []string { - if x != nil { - return x.SourceRanges - } - return nil -} - -func (x *UpdatePSMDBClusterRequest) GetTemplate() *Template { - if x != nil { - return x.Template - } - return nil -} - -type UpdatePSMDBClusterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdatePSMDBClusterResponse) Reset() { - *x = UpdatePSMDBClusterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdatePSMDBClusterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdatePSMDBClusterResponse) ProtoMessage() {} - -func (x *UpdatePSMDBClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdatePSMDBClusterResponse.ProtoReflect.Descriptor instead. -func (*UpdatePSMDBClusterResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_psmdb_clusters_proto_rawDescGZIP(), []int{6} -} - -type GetPSMDBClusterResourcesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Cluster parameters. - Params *PSMDBClusterParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` -} - -func (x *GetPSMDBClusterResourcesRequest) Reset() { - *x = GetPSMDBClusterResourcesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPSMDBClusterResourcesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPSMDBClusterResourcesRequest) ProtoMessage() {} - -func (x *GetPSMDBClusterResourcesRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPSMDBClusterResourcesRequest.ProtoReflect.Descriptor instead. -func (*GetPSMDBClusterResourcesRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_psmdb_clusters_proto_rawDescGZIP(), []int{7} -} - -func (x *GetPSMDBClusterResourcesRequest) GetParams() *PSMDBClusterParams { - if x != nil { - return x.Params - } - return nil -} - -type GetPSMDBClusterResourcesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Expected resources to be consumed by the cluster. - Expected *Resources `protobuf:"bytes,1,opt,name=expected,proto3" json:"expected,omitempty"` -} - -func (x *GetPSMDBClusterResourcesResponse) Reset() { - *x = GetPSMDBClusterResourcesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPSMDBClusterResourcesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPSMDBClusterResourcesResponse) ProtoMessage() {} - -func (x *GetPSMDBClusterResourcesResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPSMDBClusterResourcesResponse.ProtoReflect.Descriptor instead. -func (*GetPSMDBClusterResourcesResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_psmdb_clusters_proto_rawDescGZIP(), []int{8} -} - -func (x *GetPSMDBClusterResourcesResponse) GetExpected() *Resources { - if x != nil { - return x.Expected - } - return nil -} - -// ReplicaSet container parameters. -// TODO Do not use inner messages in all public APIs (for consistency). -type PSMDBClusterParams_ReplicaSet struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Requested compute resources. - ComputeResources *ComputeResources `protobuf:"bytes,1,opt,name=compute_resources,json=computeResources,proto3" json:"compute_resources,omitempty"` - // Disk size in bytes. - DiskSize int64 `protobuf:"varint,2,opt,name=disk_size,json=diskSize,proto3" json:"disk_size,omitempty"` - // Configuration for PSMDB cluster - Configuration string `protobuf:"bytes,4,opt,name=configuration,proto3" json:"configuration,omitempty"` - // Storage Class for PSMDB cluster. - StorageClass string `protobuf:"bytes,5,opt,name=storage_class,json=storageClass,proto3" json:"storage_class,omitempty"` -} - -func (x *PSMDBClusterParams_ReplicaSet) Reset() { - *x = PSMDBClusterParams_ReplicaSet{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PSMDBClusterParams_ReplicaSet) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PSMDBClusterParams_ReplicaSet) ProtoMessage() {} - -func (x *PSMDBClusterParams_ReplicaSet) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PSMDBClusterParams_ReplicaSet.ProtoReflect.Descriptor instead. -func (*PSMDBClusterParams_ReplicaSet) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_psmdb_clusters_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *PSMDBClusterParams_ReplicaSet) GetComputeResources() *ComputeResources { - if x != nil { - return x.ComputeResources - } - return nil -} - -func (x *PSMDBClusterParams_ReplicaSet) GetDiskSize() int64 { - if x != nil { - return x.DiskSize - } - return 0 -} - -func (x *PSMDBClusterParams_ReplicaSet) GetConfiguration() string { - if x != nil { - return x.Configuration - } - return "" -} - -func (x *PSMDBClusterParams_ReplicaSet) GetStorageClass() string { - if x != nil { - return x.StorageClass - } - return "" -} - -// PSMDBCredentials is a credentials to connect to PSMDB. -// TODO Do not use inner messages in all public APIs (for consistency). -type GetPSMDBClusterCredentialsResponse_PSMDBCredentials struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // MongoDB username. - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - // MongoDB password. - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - // MongoDB host. - Host string `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"` - // MongoDB port. - Port int32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"` - // Replicaset name. - Replicaset string `protobuf:"bytes,5,opt,name=replicaset,proto3" json:"replicaset,omitempty"` -} - -func (x *GetPSMDBClusterCredentialsResponse_PSMDBCredentials) Reset() { - *x = GetPSMDBClusterCredentialsResponse_PSMDBCredentials{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPSMDBClusterCredentialsResponse_PSMDBCredentials) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPSMDBClusterCredentialsResponse_PSMDBCredentials) ProtoMessage() {} - -func (x *GetPSMDBClusterCredentialsResponse_PSMDBCredentials) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPSMDBClusterCredentialsResponse_PSMDBCredentials.ProtoReflect.Descriptor instead. -func (*GetPSMDBClusterCredentialsResponse_PSMDBCredentials) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_psmdb_clusters_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *GetPSMDBClusterCredentialsResponse_PSMDBCredentials) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *GetPSMDBClusterCredentialsResponse_PSMDBCredentials) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *GetPSMDBClusterCredentialsResponse_PSMDBCredentials) GetHost() string { - if x != nil { - return x.Host - } - return "" -} - -func (x *GetPSMDBClusterCredentialsResponse_PSMDBCredentials) GetPort() int32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *GetPSMDBClusterCredentialsResponse_PSMDBCredentials) GetReplicaset() string { - if x != nil { - return x.Replicaset - } - return "" -} - -// UpdatePSMDBClusterParams represents PSMDB cluster parameters that can be updated. -type UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Cluster size. - ClusterSize int32 `protobuf:"varint,1,opt,name=cluster_size,json=clusterSize,proto3" json:"cluster_size,omitempty"` - // ReplicaSet container parameters. - Replicaset *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet `protobuf:"bytes,2,opt,name=replicaset,proto3" json:"replicaset,omitempty"` - // Suspend cluster `pause: true`. - Suspend bool `protobuf:"varint,3,opt,name=suspend,proto3" json:"suspend,omitempty"` - // Resume cluster `pause: false`. - Resume bool `protobuf:"varint,4,opt,name=resume,proto3" json:"resume,omitempty"` - // PSMDB image to use. If it's the same image but with different version tag, upgrade of database cluster to version - // in given tag is triggered. If entirely different image is given, error is returned. - Image string `protobuf:"bytes,5,opt,name=image,proto3" json:"image,omitempty"` -} - -func (x *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams) Reset() { - *x = UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams) ProtoMessage() {} - -func (x *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams.ProtoReflect.Descriptor instead. -func (*UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_psmdb_clusters_proto_rawDescGZIP(), []int{5, 0} -} - -func (x *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams) GetClusterSize() int32 { - if x != nil { - return x.ClusterSize - } - return 0 -} - -func (x *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams) GetReplicaset() *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet { - if x != nil { - return x.Replicaset - } - return nil -} - -func (x *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams) GetSuspend() bool { - if x != nil { - return x.Suspend - } - return false -} - -func (x *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams) GetResume() bool { - if x != nil { - return x.Resume - } - return false -} - -func (x *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams) GetImage() string { - if x != nil { - return x.Image - } - return "" -} - -// ReplicaSet container parameters. -type UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Requested compute resources. - ComputeResources *ComputeResources `protobuf:"bytes,1,opt,name=compute_resources,json=computeResources,proto3" json:"compute_resources,omitempty"` - // Configuration for PSMDB cluster - Configuration string `protobuf:"bytes,4,opt,name=configuration,proto3" json:"configuration,omitempty"` - // Storage Class for PSMDB cluster. - StorageClass string `protobuf:"bytes,5,opt,name=storage_class,json=storageClass,proto3" json:"storage_class,omitempty"` -} - -func (x *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet) Reset() { - *x = UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet) ProtoMessage() {} - -func (x *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet.ProtoReflect.Descriptor instead. -func (*UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_psmdb_clusters_proto_rawDescGZIP(), []int{5, 0, 0} -} - -func (x *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet) GetComputeResources() *ComputeResources { - if x != nil { - return x.ComputeResources - } - return nil -} - -func (x *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet) GetConfiguration() string { - if x != nil { - return x.Configuration - } - return "" -} - -func (x *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet) GetStorageClass() string { - if x != nil { - return x.StorageClass - } - return "" -} - -var File_managementpb_dbaas_psmdb_clusters_proto protoreflect.FileDescriptor - -var file_managementpb_dbaas_psmdb_clusters_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2f, 0x70, 0x73, 0x6d, 0x64, 0x62, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x64, 0x62, 0x61, 0x61, 0x73, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xc1, 0x03, 0x0a, 0x12, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x4c, 0x0a, - 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2c, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x53, 0x65, 0x74, 0x52, - 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, - 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x06, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, - 0x12, 0x30, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x07, 0x72, 0x65, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x1a, 0xc2, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x53, 0x65, - 0x74, 0x12, 0x4c, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, - 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x10, 0x63, - 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, - 0x1b, 0x0a, 0x09, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x08, 0x64, 0x69, 0x73, 0x6b, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x24, 0x0a, 0x0d, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, - 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x50, - 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x43, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, - 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, - 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x15, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, - 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, - 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xb4, 0x02, 0x0a, 0x22, - 0x47, 0x65, 0x74, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x43, - 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x79, 0x0a, 0x16, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x15, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x1a, 0x92, 0x01, - 0x0a, 0x10, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, - 0x6c, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, - 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, - 0x72, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x65, 0x74, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, - 0x65, 0x74, 0x22, 0xc6, 0x02, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x53, 0x4d, - 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x3f, 0x0a, 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x63, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x15, 0x6b, 0x75, 0x62, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x06, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x5f, 0x66, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x46, 0x61, 0x63, 0x69, 0x6e, - 0x67, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8d, 0x06, 0x0a, 0x19, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, - 0x01, 0x52, 0x15, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x59, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x53, 0x4d, 0x44, - 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x06, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x5f, 0x66, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x46, 0x61, 0x63, 0x69, 0x6e, - 0x67, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x1a, 0x9b, 0x03, 0x0a, 0x18, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, - 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x6c, 0x0a, 0x0a, 0x72, - 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x4c, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x53, 0x65, 0x74, 0x52, 0x0a, 0x72, - 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x73, - 0x70, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x73, 0x70, - 0x65, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, - 0x6d, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x1a, 0xa5, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x53, 0x65, 0x74, - 0x12, 0x4c, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x64, 0x62, - 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, - 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x10, 0x63, 0x6f, - 0x6d, 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x24, - 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, - 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x1c, 0x0a, 0x1a, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5c, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x50, 0x53, - 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x64, 0x62, 0x61, - 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x53, 0x4d, 0x44, 0x42, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x58, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x50, 0x53, 0x4d, 0x44, - 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x08, 0x65, 0x78, 0x70, - 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x64, 0x62, - 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x08, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x32, - 0xcd, 0x05, 0x0a, 0x0d, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x73, 0x12, 0xbf, 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, - 0x12, 0x30, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x3a, 0x01, 0x2a, - 0x22, 0x31, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, 0x2f, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x73, 0x12, 0x9e, 0x01, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x53, - 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x28, 0x2e, 0x64, 0x62, 0x61, - 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x53, 0x4d, 0x44, 0x42, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x01, 0x2a, 0x22, 0x28, 0x2f, 0x76, 0x31, 0x2f, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, - 0x2f, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x12, 0x9e, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x28, 0x2e, 0x64, 0x62, - 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x53, 0x4d, 0x44, - 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x01, 0x2a, 0x22, 0x28, 0x2f, 0x76, 0x31, - 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, 0x61, - 0x53, 0x2f, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0xb7, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x50, 0x53, 0x4d, - 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x12, 0x2e, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x3a, 0x01, 0x2a, 0x22, 0x2f, - 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, - 0x42, 0x61, 0x61, 0x53, 0x2f, 0x50, 0x53, 0x4d, 0x44, 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x2f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x42, - 0xb8, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x12, 0x50, 0x73, 0x6d, 0x64, 0x62, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, - 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x3b, 0x64, 0x62, 0x61, 0x61, 0x73, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x0d, - 0x44, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x0d, - 0x44, 0x62, 0x61, 0x61, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x19, - 0x44, 0x62, 0x61, 0x61, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x44, 0x62, 0x61, 0x61, - 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_managementpb_dbaas_psmdb_clusters_proto_rawDescOnce sync.Once - file_managementpb_dbaas_psmdb_clusters_proto_rawDescData = file_managementpb_dbaas_psmdb_clusters_proto_rawDesc -) - -func file_managementpb_dbaas_psmdb_clusters_proto_rawDescGZIP() []byte { - file_managementpb_dbaas_psmdb_clusters_proto_rawDescOnce.Do(func() { - file_managementpb_dbaas_psmdb_clusters_proto_rawDescData = protoimpl.X.CompressGZIP(file_managementpb_dbaas_psmdb_clusters_proto_rawDescData) - }) - return file_managementpb_dbaas_psmdb_clusters_proto_rawDescData -} - -var ( - file_managementpb_dbaas_psmdb_clusters_proto_msgTypes = make([]protoimpl.MessageInfo, 13) - file_managementpb_dbaas_psmdb_clusters_proto_goTypes = []interface{}{ - (*PSMDBClusterParams)(nil), // 0: dbaas.v1beta1.PSMDBClusterParams - (*GetPSMDBClusterCredentialsRequest)(nil), // 1: dbaas.v1beta1.GetPSMDBClusterCredentialsRequest - (*GetPSMDBClusterCredentialsResponse)(nil), // 2: dbaas.v1beta1.GetPSMDBClusterCredentialsResponse - (*CreatePSMDBClusterRequest)(nil), // 3: dbaas.v1beta1.CreatePSMDBClusterRequest - (*CreatePSMDBClusterResponse)(nil), // 4: dbaas.v1beta1.CreatePSMDBClusterResponse - (*UpdatePSMDBClusterRequest)(nil), // 5: dbaas.v1beta1.UpdatePSMDBClusterRequest - (*UpdatePSMDBClusterResponse)(nil), // 6: dbaas.v1beta1.UpdatePSMDBClusterResponse - (*GetPSMDBClusterResourcesRequest)(nil), // 7: dbaas.v1beta1.GetPSMDBClusterResourcesRequest - (*GetPSMDBClusterResourcesResponse)(nil), // 8: dbaas.v1beta1.GetPSMDBClusterResourcesResponse - (*PSMDBClusterParams_ReplicaSet)(nil), // 9: dbaas.v1beta1.PSMDBClusterParams.ReplicaSet - (*GetPSMDBClusterCredentialsResponse_PSMDBCredentials)(nil), // 10: dbaas.v1beta1.GetPSMDBClusterCredentialsResponse.PSMDBCredentials - (*UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams)(nil), // 11: dbaas.v1beta1.UpdatePSMDBClusterRequest.UpdatePSMDBClusterParams - (*UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet)(nil), // 12: dbaas.v1beta1.UpdatePSMDBClusterRequest.UpdatePSMDBClusterParams.ReplicaSet - (*Backup)(nil), // 13: dbaas.v1beta1.Backup - (*Restore)(nil), // 14: dbaas.v1beta1.Restore - (*Template)(nil), // 15: dbaas.v1beta1.Template - (*Resources)(nil), // 16: dbaas.v1beta1.Resources - (*ComputeResources)(nil), // 17: dbaas.v1beta1.ComputeResources - } -) - -var file_managementpb_dbaas_psmdb_clusters_proto_depIdxs = []int32{ - 9, // 0: dbaas.v1beta1.PSMDBClusterParams.replicaset:type_name -> dbaas.v1beta1.PSMDBClusterParams.ReplicaSet - 13, // 1: dbaas.v1beta1.PSMDBClusterParams.backup:type_name -> dbaas.v1beta1.Backup - 14, // 2: dbaas.v1beta1.PSMDBClusterParams.restore:type_name -> dbaas.v1beta1.Restore - 10, // 3: dbaas.v1beta1.GetPSMDBClusterCredentialsResponse.connection_credentials:type_name -> dbaas.v1beta1.GetPSMDBClusterCredentialsResponse.PSMDBCredentials - 0, // 4: dbaas.v1beta1.CreatePSMDBClusterRequest.params:type_name -> dbaas.v1beta1.PSMDBClusterParams - 15, // 5: dbaas.v1beta1.CreatePSMDBClusterRequest.template:type_name -> dbaas.v1beta1.Template - 11, // 6: dbaas.v1beta1.UpdatePSMDBClusterRequest.params:type_name -> dbaas.v1beta1.UpdatePSMDBClusterRequest.UpdatePSMDBClusterParams - 15, // 7: dbaas.v1beta1.UpdatePSMDBClusterRequest.template:type_name -> dbaas.v1beta1.Template - 0, // 8: dbaas.v1beta1.GetPSMDBClusterResourcesRequest.params:type_name -> dbaas.v1beta1.PSMDBClusterParams - 16, // 9: dbaas.v1beta1.GetPSMDBClusterResourcesResponse.expected:type_name -> dbaas.v1beta1.Resources - 17, // 10: dbaas.v1beta1.PSMDBClusterParams.ReplicaSet.compute_resources:type_name -> dbaas.v1beta1.ComputeResources - 12, // 11: dbaas.v1beta1.UpdatePSMDBClusterRequest.UpdatePSMDBClusterParams.replicaset:type_name -> dbaas.v1beta1.UpdatePSMDBClusterRequest.UpdatePSMDBClusterParams.ReplicaSet - 17, // 12: dbaas.v1beta1.UpdatePSMDBClusterRequest.UpdatePSMDBClusterParams.ReplicaSet.compute_resources:type_name -> dbaas.v1beta1.ComputeResources - 1, // 13: dbaas.v1beta1.PSMDBClusters.GetPSMDBClusterCredentials:input_type -> dbaas.v1beta1.GetPSMDBClusterCredentialsRequest - 3, // 14: dbaas.v1beta1.PSMDBClusters.CreatePSMDBCluster:input_type -> dbaas.v1beta1.CreatePSMDBClusterRequest - 5, // 15: dbaas.v1beta1.PSMDBClusters.UpdatePSMDBCluster:input_type -> dbaas.v1beta1.UpdatePSMDBClusterRequest - 7, // 16: dbaas.v1beta1.PSMDBClusters.GetPSMDBClusterResources:input_type -> dbaas.v1beta1.GetPSMDBClusterResourcesRequest - 2, // 17: dbaas.v1beta1.PSMDBClusters.GetPSMDBClusterCredentials:output_type -> dbaas.v1beta1.GetPSMDBClusterCredentialsResponse - 4, // 18: dbaas.v1beta1.PSMDBClusters.CreatePSMDBCluster:output_type -> dbaas.v1beta1.CreatePSMDBClusterResponse - 6, // 19: dbaas.v1beta1.PSMDBClusters.UpdatePSMDBCluster:output_type -> dbaas.v1beta1.UpdatePSMDBClusterResponse - 8, // 20: dbaas.v1beta1.PSMDBClusters.GetPSMDBClusterResources:output_type -> dbaas.v1beta1.GetPSMDBClusterResourcesResponse - 17, // [17:21] is the sub-list for method output_type - 13, // [13:17] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name -} - -func init() { file_managementpb_dbaas_psmdb_clusters_proto_init() } -func file_managementpb_dbaas_psmdb_clusters_proto_init() { - if File_managementpb_dbaas_psmdb_clusters_proto != nil { - return - } - file_managementpb_dbaas_dbaas_proto_init() - file_managementpb_dbaas_templates_proto_init() - if !protoimpl.UnsafeEnabled { - file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PSMDBClusterParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPSMDBClusterCredentialsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPSMDBClusterCredentialsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreatePSMDBClusterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreatePSMDBClusterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdatePSMDBClusterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdatePSMDBClusterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPSMDBClusterResourcesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPSMDBClusterResourcesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PSMDBClusterParams_ReplicaSet); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPSMDBClusterCredentialsResponse_PSMDBCredentials); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_psmdb_clusters_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_managementpb_dbaas_psmdb_clusters_proto_rawDesc, - NumEnums: 0, - NumMessages: 13, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_managementpb_dbaas_psmdb_clusters_proto_goTypes, - DependencyIndexes: file_managementpb_dbaas_psmdb_clusters_proto_depIdxs, - MessageInfos: file_managementpb_dbaas_psmdb_clusters_proto_msgTypes, - }.Build() - File_managementpb_dbaas_psmdb_clusters_proto = out.File - file_managementpb_dbaas_psmdb_clusters_proto_rawDesc = nil - file_managementpb_dbaas_psmdb_clusters_proto_goTypes = nil - file_managementpb_dbaas_psmdb_clusters_proto_depIdxs = nil -} diff --git a/api/managementpb/dbaas/psmdb_clusters.pb.gw.go b/api/managementpb/dbaas/psmdb_clusters.pb.gw.go deleted file mode 100644 index 74d5c1eb87..0000000000 --- a/api/managementpb/dbaas/psmdb_clusters.pb.gw.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: managementpb/dbaas/psmdb_clusters.proto - -/* -Package dbaasv1beta1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package dbaasv1beta1 - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_PSMDBClusters_GetPSMDBClusterCredentials_0(ctx context.Context, marshaler runtime.Marshaler, client PSMDBClustersClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetPSMDBClusterCredentialsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetPSMDBClusterCredentials(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_PSMDBClusters_GetPSMDBClusterCredentials_0(ctx context.Context, marshaler runtime.Marshaler, server PSMDBClustersServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetPSMDBClusterCredentialsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetPSMDBClusterCredentials(ctx, &protoReq) - return msg, metadata, err -} - -func request_PSMDBClusters_CreatePSMDBCluster_0(ctx context.Context, marshaler runtime.Marshaler, client PSMDBClustersClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreatePSMDBClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreatePSMDBCluster(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_PSMDBClusters_CreatePSMDBCluster_0(ctx context.Context, marshaler runtime.Marshaler, server PSMDBClustersServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreatePSMDBClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreatePSMDBCluster(ctx, &protoReq) - return msg, metadata, err -} - -func request_PSMDBClusters_UpdatePSMDBCluster_0(ctx context.Context, marshaler runtime.Marshaler, client PSMDBClustersClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdatePSMDBClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.UpdatePSMDBCluster(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_PSMDBClusters_UpdatePSMDBCluster_0(ctx context.Context, marshaler runtime.Marshaler, server PSMDBClustersServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdatePSMDBClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.UpdatePSMDBCluster(ctx, &protoReq) - return msg, metadata, err -} - -func request_PSMDBClusters_GetPSMDBClusterResources_0(ctx context.Context, marshaler runtime.Marshaler, client PSMDBClustersClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetPSMDBClusterResourcesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetPSMDBClusterResources(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_PSMDBClusters_GetPSMDBClusterResources_0(ctx context.Context, marshaler runtime.Marshaler, server PSMDBClustersServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetPSMDBClusterResourcesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetPSMDBClusterResources(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterPSMDBClustersHandlerServer registers the http handlers for service PSMDBClusters to "mux". -// UnaryRPC :call PSMDBClustersServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPSMDBClustersHandlerFromEndpoint instead. -func RegisterPSMDBClustersHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PSMDBClustersServer) error { - mux.Handle("POST", pattern_PSMDBClusters_GetPSMDBClusterCredentials_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.PSMDBClusters/GetPSMDBClusterCredentials", runtime.WithHTTPPathPattern("/v1/management/DBaaS/PSMDBClusters/GetCredentials")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_PSMDBClusters_GetPSMDBClusterCredentials_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_PSMDBClusters_GetPSMDBClusterCredentials_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_PSMDBClusters_CreatePSMDBCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.PSMDBClusters/CreatePSMDBCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/PSMDBCluster/Create")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_PSMDBClusters_CreatePSMDBCluster_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_PSMDBClusters_CreatePSMDBCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_PSMDBClusters_UpdatePSMDBCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.PSMDBClusters/UpdatePSMDBCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/PSMDBCluster/Update")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_PSMDBClusters_UpdatePSMDBCluster_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_PSMDBClusters_UpdatePSMDBCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_PSMDBClusters_GetPSMDBClusterResources_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.PSMDBClusters/GetPSMDBClusterResources", runtime.WithHTTPPathPattern("/v1/management/DBaaS/PSMDBCluster/Resources/Get")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_PSMDBClusters_GetPSMDBClusterResources_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_PSMDBClusters_GetPSMDBClusterResources_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterPSMDBClustersHandlerFromEndpoint is same as RegisterPSMDBClustersHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterPSMDBClustersHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterPSMDBClustersHandler(ctx, mux, conn) -} - -// RegisterPSMDBClustersHandler registers the http handlers for service PSMDBClusters to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterPSMDBClustersHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterPSMDBClustersHandlerClient(ctx, mux, NewPSMDBClustersClient(conn)) -} - -// RegisterPSMDBClustersHandlerClient registers the http handlers for service PSMDBClusters -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PSMDBClustersClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PSMDBClustersClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "PSMDBClustersClient" to call the correct interceptors. -func RegisterPSMDBClustersHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PSMDBClustersClient) error { - mux.Handle("POST", pattern_PSMDBClusters_GetPSMDBClusterCredentials_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.PSMDBClusters/GetPSMDBClusterCredentials", runtime.WithHTTPPathPattern("/v1/management/DBaaS/PSMDBClusters/GetCredentials")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_PSMDBClusters_GetPSMDBClusterCredentials_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_PSMDBClusters_GetPSMDBClusterCredentials_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_PSMDBClusters_CreatePSMDBCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.PSMDBClusters/CreatePSMDBCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/PSMDBCluster/Create")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_PSMDBClusters_CreatePSMDBCluster_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_PSMDBClusters_CreatePSMDBCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_PSMDBClusters_UpdatePSMDBCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.PSMDBClusters/UpdatePSMDBCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/PSMDBCluster/Update")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_PSMDBClusters_UpdatePSMDBCluster_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_PSMDBClusters_UpdatePSMDBCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_PSMDBClusters_GetPSMDBClusterResources_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.PSMDBClusters/GetPSMDBClusterResources", runtime.WithHTTPPathPattern("/v1/management/DBaaS/PSMDBCluster/Resources/Get")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_PSMDBClusters_GetPSMDBClusterResources_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_PSMDBClusters_GetPSMDBClusterResources_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -var ( - pattern_PSMDBClusters_GetPSMDBClusterCredentials_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "PSMDBClusters", "GetCredentials"}, "")) - - pattern_PSMDBClusters_CreatePSMDBCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "PSMDBCluster", "Create"}, "")) - - pattern_PSMDBClusters_UpdatePSMDBCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "PSMDBCluster", "Update"}, "")) - - pattern_PSMDBClusters_GetPSMDBClusterResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"v1", "management", "DBaaS", "PSMDBCluster", "Resources", "Get"}, "")) -) - -var ( - forward_PSMDBClusters_GetPSMDBClusterCredentials_0 = runtime.ForwardResponseMessage - - forward_PSMDBClusters_CreatePSMDBCluster_0 = runtime.ForwardResponseMessage - - forward_PSMDBClusters_UpdatePSMDBCluster_0 = runtime.ForwardResponseMessage - - forward_PSMDBClusters_GetPSMDBClusterResources_0 = runtime.ForwardResponseMessage -) diff --git a/api/managementpb/dbaas/psmdb_clusters.pb.validate.go b/api/managementpb/dbaas/psmdb_clusters.pb.validate.go deleted file mode 100644 index 0e5e6983f5..0000000000 --- a/api/managementpb/dbaas/psmdb_clusters.pb.validate.go +++ /dev/null @@ -1,1887 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: managementpb/dbaas/psmdb_clusters.proto - -package dbaasv1beta1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on PSMDBClusterParams with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *PSMDBClusterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PSMDBClusterParams with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// PSMDBClusterParamsMultiError, or nil if none found. -func (m *PSMDBClusterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *PSMDBClusterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ClusterSize - - if all { - switch v := interface{}(m.GetReplicaset()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PSMDBClusterParamsValidationError{ - field: "Replicaset", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PSMDBClusterParamsValidationError{ - field: "Replicaset", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetReplicaset()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PSMDBClusterParamsValidationError{ - field: "Replicaset", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Image - - if all { - switch v := interface{}(m.GetBackup()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PSMDBClusterParamsValidationError{ - field: "Backup", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PSMDBClusterParamsValidationError{ - field: "Backup", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetBackup()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PSMDBClusterParamsValidationError{ - field: "Backup", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetRestore()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PSMDBClusterParamsValidationError{ - field: "Restore", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PSMDBClusterParamsValidationError{ - field: "Restore", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRestore()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PSMDBClusterParamsValidationError{ - field: "Restore", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return PSMDBClusterParamsMultiError(errors) - } - - return nil -} - -// PSMDBClusterParamsMultiError is an error wrapping multiple validation errors -// returned by PSMDBClusterParams.ValidateAll() if the designated constraints -// aren't met. -type PSMDBClusterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PSMDBClusterParamsMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m PSMDBClusterParamsMultiError) AllErrors() []error { return m } - -// PSMDBClusterParamsValidationError is the validation error returned by -// PSMDBClusterParams.Validate if the designated constraints aren't met. -type PSMDBClusterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PSMDBClusterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PSMDBClusterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PSMDBClusterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PSMDBClusterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PSMDBClusterParamsValidationError) ErrorName() string { - return "PSMDBClusterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e PSMDBClusterParamsValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sPSMDBClusterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PSMDBClusterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PSMDBClusterParamsValidationError{} - -// Validate checks the field values on GetPSMDBClusterCredentialsRequest with -// the rules defined in the proto definition for this message. If any rules -// are violated, the first error encountered is returned, or nil if there are -// no violations. -func (m *GetPSMDBClusterCredentialsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetPSMDBClusterCredentialsRequest -// with the rules defined in the proto definition for this message. If any -// rules are violated, the result is a list of violation errors wrapped in -// GetPSMDBClusterCredentialsRequestMultiError, or nil if none found. -func (m *GetPSMDBClusterCredentialsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetPSMDBClusterCredentialsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := GetPSMDBClusterCredentialsRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetName()) < 1 { - err := GetPSMDBClusterCredentialsRequestValidationError{ - field: "Name", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return GetPSMDBClusterCredentialsRequestMultiError(errors) - } - - return nil -} - -// GetPSMDBClusterCredentialsRequestMultiError is an error wrapping multiple -// validation errors returned by -// GetPSMDBClusterCredentialsRequest.ValidateAll() if the designated -// constraints aren't met. -type GetPSMDBClusterCredentialsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetPSMDBClusterCredentialsRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetPSMDBClusterCredentialsRequestMultiError) AllErrors() []error { return m } - -// GetPSMDBClusterCredentialsRequestValidationError is the validation error -// returned by GetPSMDBClusterCredentialsRequest.Validate if the designated -// constraints aren't met. -type GetPSMDBClusterCredentialsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetPSMDBClusterCredentialsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetPSMDBClusterCredentialsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetPSMDBClusterCredentialsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetPSMDBClusterCredentialsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetPSMDBClusterCredentialsRequestValidationError) ErrorName() string { - return "GetPSMDBClusterCredentialsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetPSMDBClusterCredentialsRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetPSMDBClusterCredentialsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetPSMDBClusterCredentialsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetPSMDBClusterCredentialsRequestValidationError{} - -// Validate checks the field values on GetPSMDBClusterCredentialsResponse with -// the rules defined in the proto definition for this message. If any rules -// are violated, the first error encountered is returned, or nil if there are -// no violations. -func (m *GetPSMDBClusterCredentialsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetPSMDBClusterCredentialsResponse -// with the rules defined in the proto definition for this message. If any -// rules are violated, the result is a list of violation errors wrapped in -// GetPSMDBClusterCredentialsResponseMultiError, or nil if none found. -func (m *GetPSMDBClusterCredentialsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetPSMDBClusterCredentialsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetConnectionCredentials()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetPSMDBClusterCredentialsResponseValidationError{ - field: "ConnectionCredentials", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetPSMDBClusterCredentialsResponseValidationError{ - field: "ConnectionCredentials", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetConnectionCredentials()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetPSMDBClusterCredentialsResponseValidationError{ - field: "ConnectionCredentials", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return GetPSMDBClusterCredentialsResponseMultiError(errors) - } - - return nil -} - -// GetPSMDBClusterCredentialsResponseMultiError is an error wrapping multiple -// validation errors returned by -// GetPSMDBClusterCredentialsResponse.ValidateAll() if the designated -// constraints aren't met. -type GetPSMDBClusterCredentialsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetPSMDBClusterCredentialsResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetPSMDBClusterCredentialsResponseMultiError) AllErrors() []error { return m } - -// GetPSMDBClusterCredentialsResponseValidationError is the validation error -// returned by GetPSMDBClusterCredentialsResponse.Validate if the designated -// constraints aren't met. -type GetPSMDBClusterCredentialsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetPSMDBClusterCredentialsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetPSMDBClusterCredentialsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetPSMDBClusterCredentialsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetPSMDBClusterCredentialsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetPSMDBClusterCredentialsResponseValidationError) ErrorName() string { - return "GetPSMDBClusterCredentialsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetPSMDBClusterCredentialsResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetPSMDBClusterCredentialsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetPSMDBClusterCredentialsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetPSMDBClusterCredentialsResponseValidationError{} - -// Validate checks the field values on CreatePSMDBClusterRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *CreatePSMDBClusterRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CreatePSMDBClusterRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// CreatePSMDBClusterRequestMultiError, or nil if none found. -func (m *CreatePSMDBClusterRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *CreatePSMDBClusterRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := CreatePSMDBClusterRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Name - - if all { - switch v := interface{}(m.GetParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CreatePSMDBClusterRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CreatePSMDBClusterRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CreatePSMDBClusterRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Expose - - // no validation rules for InternetFacing - - if all { - switch v := interface{}(m.GetTemplate()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CreatePSMDBClusterRequestValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CreatePSMDBClusterRequestValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTemplate()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CreatePSMDBClusterRequestValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return CreatePSMDBClusterRequestMultiError(errors) - } - - return nil -} - -// CreatePSMDBClusterRequestMultiError is an error wrapping multiple validation -// errors returned by CreatePSMDBClusterRequest.ValidateAll() if the -// designated constraints aren't met. -type CreatePSMDBClusterRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CreatePSMDBClusterRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m CreatePSMDBClusterRequestMultiError) AllErrors() []error { return m } - -// CreatePSMDBClusterRequestValidationError is the validation error returned by -// CreatePSMDBClusterRequest.Validate if the designated constraints aren't met. -type CreatePSMDBClusterRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CreatePSMDBClusterRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CreatePSMDBClusterRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CreatePSMDBClusterRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CreatePSMDBClusterRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CreatePSMDBClusterRequestValidationError) ErrorName() string { - return "CreatePSMDBClusterRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e CreatePSMDBClusterRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sCreatePSMDBClusterRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CreatePSMDBClusterRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CreatePSMDBClusterRequestValidationError{} - -// Validate checks the field values on CreatePSMDBClusterResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *CreatePSMDBClusterResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CreatePSMDBClusterResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// CreatePSMDBClusterResponseMultiError, or nil if none found. -func (m *CreatePSMDBClusterResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *CreatePSMDBClusterResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return CreatePSMDBClusterResponseMultiError(errors) - } - - return nil -} - -// CreatePSMDBClusterResponseMultiError is an error wrapping multiple -// validation errors returned by CreatePSMDBClusterResponse.ValidateAll() if -// the designated constraints aren't met. -type CreatePSMDBClusterResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CreatePSMDBClusterResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m CreatePSMDBClusterResponseMultiError) AllErrors() []error { return m } - -// CreatePSMDBClusterResponseValidationError is the validation error returned -// by CreatePSMDBClusterResponse.Validate if the designated constraints aren't met. -type CreatePSMDBClusterResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CreatePSMDBClusterResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CreatePSMDBClusterResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CreatePSMDBClusterResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CreatePSMDBClusterResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CreatePSMDBClusterResponseValidationError) ErrorName() string { - return "CreatePSMDBClusterResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e CreatePSMDBClusterResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sCreatePSMDBClusterResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CreatePSMDBClusterResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CreatePSMDBClusterResponseValidationError{} - -// Validate checks the field values on UpdatePSMDBClusterRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *UpdatePSMDBClusterRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UpdatePSMDBClusterRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// UpdatePSMDBClusterRequestMultiError, or nil if none found. -func (m *UpdatePSMDBClusterRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdatePSMDBClusterRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := UpdatePSMDBClusterRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetName()) < 1 { - err := UpdatePSMDBClusterRequestValidationError{ - field: "Name", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdatePSMDBClusterRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UpdatePSMDBClusterRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UpdatePSMDBClusterRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Expose - - // no validation rules for InternetFacing - - if all { - switch v := interface{}(m.GetTemplate()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdatePSMDBClusterRequestValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UpdatePSMDBClusterRequestValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTemplate()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UpdatePSMDBClusterRequestValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return UpdatePSMDBClusterRequestMultiError(errors) - } - - return nil -} - -// UpdatePSMDBClusterRequestMultiError is an error wrapping multiple validation -// errors returned by UpdatePSMDBClusterRequest.ValidateAll() if the -// designated constraints aren't met. -type UpdatePSMDBClusterRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdatePSMDBClusterRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UpdatePSMDBClusterRequestMultiError) AllErrors() []error { return m } - -// UpdatePSMDBClusterRequestValidationError is the validation error returned by -// UpdatePSMDBClusterRequest.Validate if the designated constraints aren't met. -type UpdatePSMDBClusterRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdatePSMDBClusterRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdatePSMDBClusterRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UpdatePSMDBClusterRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdatePSMDBClusterRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdatePSMDBClusterRequestValidationError) ErrorName() string { - return "UpdatePSMDBClusterRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdatePSMDBClusterRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUpdatePSMDBClusterRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdatePSMDBClusterRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdatePSMDBClusterRequestValidationError{} - -// Validate checks the field values on UpdatePSMDBClusterResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *UpdatePSMDBClusterResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UpdatePSMDBClusterResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// UpdatePSMDBClusterResponseMultiError, or nil if none found. -func (m *UpdatePSMDBClusterResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdatePSMDBClusterResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return UpdatePSMDBClusterResponseMultiError(errors) - } - - return nil -} - -// UpdatePSMDBClusterResponseMultiError is an error wrapping multiple -// validation errors returned by UpdatePSMDBClusterResponse.ValidateAll() if -// the designated constraints aren't met. -type UpdatePSMDBClusterResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdatePSMDBClusterResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UpdatePSMDBClusterResponseMultiError) AllErrors() []error { return m } - -// UpdatePSMDBClusterResponseValidationError is the validation error returned -// by UpdatePSMDBClusterResponse.Validate if the designated constraints aren't met. -type UpdatePSMDBClusterResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdatePSMDBClusterResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdatePSMDBClusterResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UpdatePSMDBClusterResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdatePSMDBClusterResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdatePSMDBClusterResponseValidationError) ErrorName() string { - return "UpdatePSMDBClusterResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdatePSMDBClusterResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUpdatePSMDBClusterResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdatePSMDBClusterResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdatePSMDBClusterResponseValidationError{} - -// Validate checks the field values on GetPSMDBClusterResourcesRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *GetPSMDBClusterResourcesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetPSMDBClusterResourcesRequest with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// GetPSMDBClusterResourcesRequestMultiError, or nil if none found. -func (m *GetPSMDBClusterResourcesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetPSMDBClusterResourcesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetPSMDBClusterResourcesRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetPSMDBClusterResourcesRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetPSMDBClusterResourcesRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return GetPSMDBClusterResourcesRequestMultiError(errors) - } - - return nil -} - -// GetPSMDBClusterResourcesRequestMultiError is an error wrapping multiple -// validation errors returned by GetPSMDBClusterResourcesRequest.ValidateAll() -// if the designated constraints aren't met. -type GetPSMDBClusterResourcesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetPSMDBClusterResourcesRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetPSMDBClusterResourcesRequestMultiError) AllErrors() []error { return m } - -// GetPSMDBClusterResourcesRequestValidationError is the validation error -// returned by GetPSMDBClusterResourcesRequest.Validate if the designated -// constraints aren't met. -type GetPSMDBClusterResourcesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetPSMDBClusterResourcesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetPSMDBClusterResourcesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetPSMDBClusterResourcesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetPSMDBClusterResourcesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetPSMDBClusterResourcesRequestValidationError) ErrorName() string { - return "GetPSMDBClusterResourcesRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetPSMDBClusterResourcesRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetPSMDBClusterResourcesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetPSMDBClusterResourcesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetPSMDBClusterResourcesRequestValidationError{} - -// Validate checks the field values on GetPSMDBClusterResourcesResponse with -// the rules defined in the proto definition for this message. If any rules -// are violated, the first error encountered is returned, or nil if there are -// no violations. -func (m *GetPSMDBClusterResourcesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetPSMDBClusterResourcesResponse with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// GetPSMDBClusterResourcesResponseMultiError, or nil if none found. -func (m *GetPSMDBClusterResourcesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetPSMDBClusterResourcesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetExpected()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetPSMDBClusterResourcesResponseValidationError{ - field: "Expected", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetPSMDBClusterResourcesResponseValidationError{ - field: "Expected", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetExpected()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetPSMDBClusterResourcesResponseValidationError{ - field: "Expected", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return GetPSMDBClusterResourcesResponseMultiError(errors) - } - - return nil -} - -// GetPSMDBClusterResourcesResponseMultiError is an error wrapping multiple -// validation errors returned by -// GetPSMDBClusterResourcesResponse.ValidateAll() if the designated -// constraints aren't met. -type GetPSMDBClusterResourcesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetPSMDBClusterResourcesResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetPSMDBClusterResourcesResponseMultiError) AllErrors() []error { return m } - -// GetPSMDBClusterResourcesResponseValidationError is the validation error -// returned by GetPSMDBClusterResourcesResponse.Validate if the designated -// constraints aren't met. -type GetPSMDBClusterResourcesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetPSMDBClusterResourcesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetPSMDBClusterResourcesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetPSMDBClusterResourcesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetPSMDBClusterResourcesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetPSMDBClusterResourcesResponseValidationError) ErrorName() string { - return "GetPSMDBClusterResourcesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetPSMDBClusterResourcesResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetPSMDBClusterResourcesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetPSMDBClusterResourcesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetPSMDBClusterResourcesResponseValidationError{} - -// Validate checks the field values on PSMDBClusterParams_ReplicaSet with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *PSMDBClusterParams_ReplicaSet) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PSMDBClusterParams_ReplicaSet with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// PSMDBClusterParams_ReplicaSetMultiError, or nil if none found. -func (m *PSMDBClusterParams_ReplicaSet) ValidateAll() error { - return m.validate(true) -} - -func (m *PSMDBClusterParams_ReplicaSet) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetComputeResources()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PSMDBClusterParams_ReplicaSetValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PSMDBClusterParams_ReplicaSetValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetComputeResources()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PSMDBClusterParams_ReplicaSetValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for DiskSize - - // no validation rules for Configuration - - // no validation rules for StorageClass - - if len(errors) > 0 { - return PSMDBClusterParams_ReplicaSetMultiError(errors) - } - - return nil -} - -// PSMDBClusterParams_ReplicaSetMultiError is an error wrapping multiple -// validation errors returned by PSMDBClusterParams_ReplicaSet.ValidateAll() -// if the designated constraints aren't met. -type PSMDBClusterParams_ReplicaSetMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PSMDBClusterParams_ReplicaSetMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m PSMDBClusterParams_ReplicaSetMultiError) AllErrors() []error { return m } - -// PSMDBClusterParams_ReplicaSetValidationError is the validation error -// returned by PSMDBClusterParams_ReplicaSet.Validate if the designated -// constraints aren't met. -type PSMDBClusterParams_ReplicaSetValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PSMDBClusterParams_ReplicaSetValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PSMDBClusterParams_ReplicaSetValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PSMDBClusterParams_ReplicaSetValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PSMDBClusterParams_ReplicaSetValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PSMDBClusterParams_ReplicaSetValidationError) ErrorName() string { - return "PSMDBClusterParams_ReplicaSetValidationError" -} - -// Error satisfies the builtin error interface -func (e PSMDBClusterParams_ReplicaSetValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sPSMDBClusterParams_ReplicaSet.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PSMDBClusterParams_ReplicaSetValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PSMDBClusterParams_ReplicaSetValidationError{} - -// Validate checks the field values on -// GetPSMDBClusterCredentialsResponse_PSMDBCredentials with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *GetPSMDBClusterCredentialsResponse_PSMDBCredentials) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// GetPSMDBClusterCredentialsResponse_PSMDBCredentials with the rules defined -// in the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in -// GetPSMDBClusterCredentialsResponse_PSMDBCredentialsMultiError, or nil if -// none found. -func (m *GetPSMDBClusterCredentialsResponse_PSMDBCredentials) ValidateAll() error { - return m.validate(true) -} - -func (m *GetPSMDBClusterCredentialsResponse_PSMDBCredentials) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Username - - // no validation rules for Password - - // no validation rules for Host - - // no validation rules for Port - - // no validation rules for Replicaset - - if len(errors) > 0 { - return GetPSMDBClusterCredentialsResponse_PSMDBCredentialsMultiError(errors) - } - - return nil -} - -// GetPSMDBClusterCredentialsResponse_PSMDBCredentialsMultiError is an error -// wrapping multiple validation errors returned by -// GetPSMDBClusterCredentialsResponse_PSMDBCredentials.ValidateAll() if the -// designated constraints aren't met. -type GetPSMDBClusterCredentialsResponse_PSMDBCredentialsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetPSMDBClusterCredentialsResponse_PSMDBCredentialsMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetPSMDBClusterCredentialsResponse_PSMDBCredentialsMultiError) AllErrors() []error { return m } - -// GetPSMDBClusterCredentialsResponse_PSMDBCredentialsValidationError is the -// validation error returned by -// GetPSMDBClusterCredentialsResponse_PSMDBCredentials.Validate if the -// designated constraints aren't met. -type GetPSMDBClusterCredentialsResponse_PSMDBCredentialsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetPSMDBClusterCredentialsResponse_PSMDBCredentialsValidationError) Field() string { - return e.field -} - -// Reason function returns reason value. -func (e GetPSMDBClusterCredentialsResponse_PSMDBCredentialsValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e GetPSMDBClusterCredentialsResponse_PSMDBCredentialsValidationError) Cause() error { - return e.cause -} - -// Key function returns key value. -func (e GetPSMDBClusterCredentialsResponse_PSMDBCredentialsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetPSMDBClusterCredentialsResponse_PSMDBCredentialsValidationError) ErrorName() string { - return "GetPSMDBClusterCredentialsResponse_PSMDBCredentialsValidationError" -} - -// Error satisfies the builtin error interface -func (e GetPSMDBClusterCredentialsResponse_PSMDBCredentialsValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetPSMDBClusterCredentialsResponse_PSMDBCredentials.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetPSMDBClusterCredentialsResponse_PSMDBCredentialsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetPSMDBClusterCredentialsResponse_PSMDBCredentialsValidationError{} - -// Validate checks the field values on -// UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams with the rules defined -// in the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in -// UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsMultiError, or nil if -// none found. -func (m *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ClusterSize - - if all { - switch v := interface{}(m.GetReplicaset()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsValidationError{ - field: "Replicaset", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsValidationError{ - field: "Replicaset", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetReplicaset()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsValidationError{ - field: "Replicaset", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Suspend - - // no validation rules for Resume - - // no validation rules for Image - - if len(errors) > 0 { - return UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsMultiError(errors) - } - - return nil -} - -// UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsMultiError is an error -// wrapping multiple validation errors returned by -// UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams.ValidateAll() if the -// designated constraints aren't met. -type UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsMultiError) AllErrors() []error { return m } - -// UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsValidationError is the -// validation error returned by -// UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams.Validate if the -// designated constraints aren't met. -type UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsValidationError) Field() string { - return e.field -} - -// Reason function returns reason value. -func (e UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsValidationError) Cause() error { - return e.cause -} - -// Key function returns key value. -func (e UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsValidationError) ErrorName() string { - return "UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUpdatePSMDBClusterRequest_UpdatePSMDBClusterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdatePSMDBClusterRequest_UpdatePSMDBClusterParamsValidationError{} - -// Validate checks the field values on -// UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetMultiError, or -// nil if none found. -func (m *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetComputeResources()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetComputeResources()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Configuration - - // no validation rules for StorageClass - - if len(errors) > 0 { - return UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetMultiError(errors) - } - - return nil -} - -// UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetMultiError is -// an error wrapping multiple validation errors returned by -// UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet.ValidateAll() -// if the designated constraints aren't met. -type UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetMultiError) AllErrors() []error { - return m -} - -// UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetValidationError -// is the validation error returned by -// UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet.Validate if -// the designated constraints aren't met. -type UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetValidationError) Field() string { - return e.field -} - -// Reason function returns reason value. -func (e UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetValidationError) Cause() error { - return e.cause -} - -// Key function returns key value. -func (e UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetValidationError) Key() bool { - return e.key -} - -// ErrorName returns error name. -func (e UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetValidationError) ErrorName() string { - return "UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSetValidationError{} diff --git a/api/managementpb/dbaas/psmdb_clusters.proto b/api/managementpb/dbaas/psmdb_clusters.proto deleted file mode 100644 index 73e95d9ae6..0000000000 --- a/api/managementpb/dbaas/psmdb_clusters.proto +++ /dev/null @@ -1,167 +0,0 @@ -syntax = "proto3"; - -package dbaas.v1beta1; - -import "google/api/annotations.proto"; -import "managementpb/dbaas/dbaas.proto"; -import "managementpb/dbaas/templates.proto"; -import "validate/validate.proto"; - -option go_package = "api/managementpb/dbaas;dbaasv1beta1"; - -// PSMDBClusterParams represents PSMDB cluster parameters that can be updated. -message PSMDBClusterParams { - // ReplicaSet container parameters. - // TODO Do not use inner messages in all public APIs (for consistency). - message ReplicaSet { - // Requested compute resources. - ComputeResources compute_resources = 1; - // Disk size in bytes. - int64 disk_size = 2; - // Configuration for PSMDB cluster - string configuration = 4; - // Storage Class for PSMDB cluster. - string storage_class = 5; - } - // Cluster size. - int32 cluster_size = 1; - // ReplicaSet container parameters. - ReplicaSet replicaset = 2; - // Docker image used for PSMDB. - string image = 3; - // Backup configuration parameters. - Backup backup = 4; - // Restore configuration parameters. - Restore restore = 5; -} - -message GetPSMDBClusterCredentialsRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; - // PSMDB cluster name. - string name = 2 [(validate.rules).string.min_len = 1]; -} - -message GetPSMDBClusterCredentialsResponse { - // PSMDBCredentials is a credentials to connect to PSMDB. - // TODO Do not use inner messages in all public APIs (for consistency). - message PSMDBCredentials { - // MongoDB username. - string username = 1; - // MongoDB password. - string password = 2; - // MongoDB host. - string host = 3; - // MongoDB port. - int32 port = 4; - // Replicaset name. - string replicaset = 5; - } - PSMDBCredentials connection_credentials = 1; -} - -message CreatePSMDBClusterRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; - // PSMDB cluster name. - // a DNS-1035 label must consist of lower case alphanumeric characters or '-', - // start with an alphabetic character, and end with an alphanumeric character - // (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?') - string name = 2; - // Cluster parameters. - PSMDBClusterParams params = 3; - // Make DB cluster accessible outside of K8s cluster. - bool expose = 4; - // Make DB cluster accessible via public internet. - bool internet_facing = 5; - // Apply IP source ranges against the cluster. - repeated string source_ranges = 6; - // Configuration template. - Template template = 7; -} - -message CreatePSMDBClusterResponse {} - -message UpdatePSMDBClusterRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; - // PSMDB cluster name. - string name = 2 [(validate.rules).string.min_len = 1]; - // UpdatePSMDBClusterParams represents PSMDB cluster parameters that can be updated. - message UpdatePSMDBClusterParams { - // ReplicaSet container parameters. - message ReplicaSet { - // Requested compute resources. - ComputeResources compute_resources = 1; - // Configuration for PSMDB cluster - string configuration = 4; - // Storage Class for PSMDB cluster. - string storage_class = 5; - } - // Cluster size. - int32 cluster_size = 1; - // ReplicaSet container parameters. - ReplicaSet replicaset = 2; - // Suspend cluster `pause: true`. - bool suspend = 3; - // Resume cluster `pause: false`. - bool resume = 4; - // PSMDB image to use. If it's the same image but with different version tag, upgrade of database cluster to version - // in given tag is triggered. If entirely different image is given, error is returned. - string image = 5; - } - // Cluster parameters. - UpdatePSMDBClusterParams params = 3; - // Make DB cluster accessible outside of K8s cluster. - bool expose = 4; - // Make DB cluster accessible via public internet. - bool internet_facing = 5; - // Apply IP source ranges against the cluster. - repeated string source_ranges = 6; - // Configuration template. - Template template = 7; -} - -message UpdatePSMDBClusterResponse {} - -message GetPSMDBClusterResourcesRequest { - // Cluster parameters. - PSMDBClusterParams params = 1; -} - -message GetPSMDBClusterResourcesResponse { - // Expected resources to be consumed by the cluster. - Resources expected = 1; -} - -// PSMDBClusters service provides public methods for managing PSMDB clusters. -service PSMDBClusters { - // GetPSMDBClusterCredentials returns a PSMDB cluster credentials by cluster name. - rpc GetPSMDBClusterCredentials(GetPSMDBClusterCredentialsRequest) returns (GetPSMDBClusterCredentialsResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/PSMDBClusters/GetCredentials" - body: "*" - }; - } - // CreatePSMDBCluster creates a new PSMDB cluster. - rpc CreatePSMDBCluster(CreatePSMDBClusterRequest) returns (CreatePSMDBClusterResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/PSMDBCluster/Create" - body: "*" - }; - } - // UpdatePSMDBCluster updates existing PSMDB cluster. - rpc UpdatePSMDBCluster(UpdatePSMDBClusterRequest) returns (UpdatePSMDBClusterResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/PSMDBCluster/Update" - body: "*" - }; - } - // GetPSMDBClusterResources returns expected resources to be consumed by the cluster. - rpc GetPSMDBClusterResources(GetPSMDBClusterResourcesRequest) returns (GetPSMDBClusterResourcesResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/PSMDBCluster/Resources/Get" - body: "*" - }; - } -} diff --git a/api/managementpb/dbaas/psmdb_clusters_grpc.pb.go b/api/managementpb/dbaas/psmdb_clusters_grpc.pb.go deleted file mode 100644 index b30b23926f..0000000000 --- a/api/managementpb/dbaas/psmdb_clusters_grpc.pb.go +++ /dev/null @@ -1,231 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: managementpb/dbaas/psmdb_clusters.proto - -package dbaasv1beta1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - PSMDBClusters_GetPSMDBClusterCredentials_FullMethodName = "/dbaas.v1beta1.PSMDBClusters/GetPSMDBClusterCredentials" - PSMDBClusters_CreatePSMDBCluster_FullMethodName = "/dbaas.v1beta1.PSMDBClusters/CreatePSMDBCluster" - PSMDBClusters_UpdatePSMDBCluster_FullMethodName = "/dbaas.v1beta1.PSMDBClusters/UpdatePSMDBCluster" - PSMDBClusters_GetPSMDBClusterResources_FullMethodName = "/dbaas.v1beta1.PSMDBClusters/GetPSMDBClusterResources" -) - -// PSMDBClustersClient is the client API for PSMDBClusters service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type PSMDBClustersClient interface { - // GetPSMDBClusterCredentials returns a PSMDB cluster credentials by cluster name. - GetPSMDBClusterCredentials(ctx context.Context, in *GetPSMDBClusterCredentialsRequest, opts ...grpc.CallOption) (*GetPSMDBClusterCredentialsResponse, error) - // CreatePSMDBCluster creates a new PSMDB cluster. - CreatePSMDBCluster(ctx context.Context, in *CreatePSMDBClusterRequest, opts ...grpc.CallOption) (*CreatePSMDBClusterResponse, error) - // UpdatePSMDBCluster updates existing PSMDB cluster. - UpdatePSMDBCluster(ctx context.Context, in *UpdatePSMDBClusterRequest, opts ...grpc.CallOption) (*UpdatePSMDBClusterResponse, error) - // GetPSMDBClusterResources returns expected resources to be consumed by the cluster. - GetPSMDBClusterResources(ctx context.Context, in *GetPSMDBClusterResourcesRequest, opts ...grpc.CallOption) (*GetPSMDBClusterResourcesResponse, error) -} - -type pSMDBClustersClient struct { - cc grpc.ClientConnInterface -} - -func NewPSMDBClustersClient(cc grpc.ClientConnInterface) PSMDBClustersClient { - return &pSMDBClustersClient{cc} -} - -func (c *pSMDBClustersClient) GetPSMDBClusterCredentials(ctx context.Context, in *GetPSMDBClusterCredentialsRequest, opts ...grpc.CallOption) (*GetPSMDBClusterCredentialsResponse, error) { - out := new(GetPSMDBClusterCredentialsResponse) - err := c.cc.Invoke(ctx, PSMDBClusters_GetPSMDBClusterCredentials_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *pSMDBClustersClient) CreatePSMDBCluster(ctx context.Context, in *CreatePSMDBClusterRequest, opts ...grpc.CallOption) (*CreatePSMDBClusterResponse, error) { - out := new(CreatePSMDBClusterResponse) - err := c.cc.Invoke(ctx, PSMDBClusters_CreatePSMDBCluster_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *pSMDBClustersClient) UpdatePSMDBCluster(ctx context.Context, in *UpdatePSMDBClusterRequest, opts ...grpc.CallOption) (*UpdatePSMDBClusterResponse, error) { - out := new(UpdatePSMDBClusterResponse) - err := c.cc.Invoke(ctx, PSMDBClusters_UpdatePSMDBCluster_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *pSMDBClustersClient) GetPSMDBClusterResources(ctx context.Context, in *GetPSMDBClusterResourcesRequest, opts ...grpc.CallOption) (*GetPSMDBClusterResourcesResponse, error) { - out := new(GetPSMDBClusterResourcesResponse) - err := c.cc.Invoke(ctx, PSMDBClusters_GetPSMDBClusterResources_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// PSMDBClustersServer is the server API for PSMDBClusters service. -// All implementations must embed UnimplementedPSMDBClustersServer -// for forward compatibility -type PSMDBClustersServer interface { - // GetPSMDBClusterCredentials returns a PSMDB cluster credentials by cluster name. - GetPSMDBClusterCredentials(context.Context, *GetPSMDBClusterCredentialsRequest) (*GetPSMDBClusterCredentialsResponse, error) - // CreatePSMDBCluster creates a new PSMDB cluster. - CreatePSMDBCluster(context.Context, *CreatePSMDBClusterRequest) (*CreatePSMDBClusterResponse, error) - // UpdatePSMDBCluster updates existing PSMDB cluster. - UpdatePSMDBCluster(context.Context, *UpdatePSMDBClusterRequest) (*UpdatePSMDBClusterResponse, error) - // GetPSMDBClusterResources returns expected resources to be consumed by the cluster. - GetPSMDBClusterResources(context.Context, *GetPSMDBClusterResourcesRequest) (*GetPSMDBClusterResourcesResponse, error) - mustEmbedUnimplementedPSMDBClustersServer() -} - -// UnimplementedPSMDBClustersServer must be embedded to have forward compatible implementations. -type UnimplementedPSMDBClustersServer struct{} - -func (UnimplementedPSMDBClustersServer) GetPSMDBClusterCredentials(context.Context, *GetPSMDBClusterCredentialsRequest) (*GetPSMDBClusterCredentialsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetPSMDBClusterCredentials not implemented") -} - -func (UnimplementedPSMDBClustersServer) CreatePSMDBCluster(context.Context, *CreatePSMDBClusterRequest) (*CreatePSMDBClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreatePSMDBCluster not implemented") -} - -func (UnimplementedPSMDBClustersServer) UpdatePSMDBCluster(context.Context, *UpdatePSMDBClusterRequest) (*UpdatePSMDBClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdatePSMDBCluster not implemented") -} - -func (UnimplementedPSMDBClustersServer) GetPSMDBClusterResources(context.Context, *GetPSMDBClusterResourcesRequest) (*GetPSMDBClusterResourcesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetPSMDBClusterResources not implemented") -} -func (UnimplementedPSMDBClustersServer) mustEmbedUnimplementedPSMDBClustersServer() {} - -// UnsafePSMDBClustersServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to PSMDBClustersServer will -// result in compilation errors. -type UnsafePSMDBClustersServer interface { - mustEmbedUnimplementedPSMDBClustersServer() -} - -func RegisterPSMDBClustersServer(s grpc.ServiceRegistrar, srv PSMDBClustersServer) { - s.RegisterService(&PSMDBClusters_ServiceDesc, srv) -} - -func _PSMDBClusters_GetPSMDBClusterCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetPSMDBClusterCredentialsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PSMDBClustersServer).GetPSMDBClusterCredentials(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PSMDBClusters_GetPSMDBClusterCredentials_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PSMDBClustersServer).GetPSMDBClusterCredentials(ctx, req.(*GetPSMDBClusterCredentialsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PSMDBClusters_CreatePSMDBCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreatePSMDBClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PSMDBClustersServer).CreatePSMDBCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PSMDBClusters_CreatePSMDBCluster_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PSMDBClustersServer).CreatePSMDBCluster(ctx, req.(*CreatePSMDBClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PSMDBClusters_UpdatePSMDBCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdatePSMDBClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PSMDBClustersServer).UpdatePSMDBCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PSMDBClusters_UpdatePSMDBCluster_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PSMDBClustersServer).UpdatePSMDBCluster(ctx, req.(*UpdatePSMDBClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PSMDBClusters_GetPSMDBClusterResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetPSMDBClusterResourcesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PSMDBClustersServer).GetPSMDBClusterResources(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PSMDBClusters_GetPSMDBClusterResources_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PSMDBClustersServer).GetPSMDBClusterResources(ctx, req.(*GetPSMDBClusterResourcesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// PSMDBClusters_ServiceDesc is the grpc.ServiceDesc for PSMDBClusters service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var PSMDBClusters_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "dbaas.v1beta1.PSMDBClusters", - HandlerType: (*PSMDBClustersServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetPSMDBClusterCredentials", - Handler: _PSMDBClusters_GetPSMDBClusterCredentials_Handler, - }, - { - MethodName: "CreatePSMDBCluster", - Handler: _PSMDBClusters_CreatePSMDBCluster_Handler, - }, - { - MethodName: "UpdatePSMDBCluster", - Handler: _PSMDBClusters_UpdatePSMDBCluster_Handler, - }, - { - MethodName: "GetPSMDBClusterResources", - Handler: _PSMDBClusters_GetPSMDBClusterResources_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "managementpb/dbaas/psmdb_clusters.proto", -} diff --git a/api/managementpb/dbaas/pxc_clusters.pb.go b/api/managementpb/dbaas/pxc_clusters.pb.go deleted file mode 100644 index ec34b22c58..0000000000 --- a/api/managementpb/dbaas/pxc_clusters.pb.go +++ /dev/null @@ -1,1792 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: managementpb/dbaas/pxc_clusters.proto - -package dbaasv1beta1 - -import ( - reflect "reflect" - sync "sync" - - _ "github.com/envoyproxy/protoc-gen-validate/validate" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// PXCBackupState represents PXC backup CR state. -type PXCBackupState int32 - -const ( - // PXC_BACKUP_STATE_INVALID represents unknown state. - PXCBackupState_PXC_BACKUP_STATE_INVALID PXCBackupState = 0 - // PXC_BACKUP_STATE_RUNNING represents running backup. - PXCBackupState_PXC_BACKUP_STATE_RUNNING PXCBackupState = 1 - // PXC_BACKUP_STATE_SUCCEEDED represents succeeded backup. - PXCBackupState_PXC_BACKUP_STATE_SUCCEEDED PXCBackupState = 2 - // PXC_BACKUP_STATE_FAILED represents failed backup. - PXCBackupState_PXC_BACKUP_STATE_FAILED PXCBackupState = 3 -) - -// Enum value maps for PXCBackupState. -var ( - PXCBackupState_name = map[int32]string{ - 0: "PXC_BACKUP_STATE_INVALID", - 1: "PXC_BACKUP_STATE_RUNNING", - 2: "PXC_BACKUP_STATE_SUCCEEDED", - 3: "PXC_BACKUP_STATE_FAILED", - } - PXCBackupState_value = map[string]int32{ - "PXC_BACKUP_STATE_INVALID": 0, - "PXC_BACKUP_STATE_RUNNING": 1, - "PXC_BACKUP_STATE_SUCCEEDED": 2, - "PXC_BACKUP_STATE_FAILED": 3, - } -) - -func (x PXCBackupState) Enum() *PXCBackupState { - p := new(PXCBackupState) - *p = x - return p -} - -func (x PXCBackupState) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PXCBackupState) Descriptor() protoreflect.EnumDescriptor { - return file_managementpb_dbaas_pxc_clusters_proto_enumTypes[0].Descriptor() -} - -func (PXCBackupState) Type() protoreflect.EnumType { - return &file_managementpb_dbaas_pxc_clusters_proto_enumTypes[0] -} - -func (x PXCBackupState) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PXCBackupState.Descriptor instead. -func (PXCBackupState) EnumDescriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{0} -} - -// PXCClusterParams represents PXC cluster parameters that can be updated. -type PXCClusterParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Cluster size. - ClusterSize int32 `protobuf:"varint,1,opt,name=cluster_size,json=clusterSize,proto3" json:"cluster_size,omitempty"` - // PXC container parameters. - Pxc *PXCClusterParams_PXC `protobuf:"bytes,2,opt,name=pxc,proto3" json:"pxc,omitempty"` - // NOTE: Only one of fields proxysql or haproxy has to be set, we check this in the code. - // ProxySQL container parameters. - Proxysql *PXCClusterParams_ProxySQL `protobuf:"bytes,3,opt,name=proxysql,proto3" json:"proxysql,omitempty"` - // HAProxy container parameters. - Haproxy *PXCClusterParams_HAProxy `protobuf:"bytes,4,opt,name=haproxy,proto3" json:"haproxy,omitempty"` - // Backup configuration parameters. - Backup *Backup `protobuf:"bytes,5,opt,name=backup,proto3" json:"backup,omitempty"` - // Restore configuration parameters. - Restore *Restore `protobuf:"bytes,6,opt,name=restore,proto3" json:"restore,omitempty"` -} - -func (x *PXCClusterParams) Reset() { - *x = PXCClusterParams{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PXCClusterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PXCClusterParams) ProtoMessage() {} - -func (x *PXCClusterParams) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PXCClusterParams.ProtoReflect.Descriptor instead. -func (*PXCClusterParams) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{0} -} - -func (x *PXCClusterParams) GetClusterSize() int32 { - if x != nil { - return x.ClusterSize - } - return 0 -} - -func (x *PXCClusterParams) GetPxc() *PXCClusterParams_PXC { - if x != nil { - return x.Pxc - } - return nil -} - -func (x *PXCClusterParams) GetProxysql() *PXCClusterParams_ProxySQL { - if x != nil { - return x.Proxysql - } - return nil -} - -func (x *PXCClusterParams) GetHaproxy() *PXCClusterParams_HAProxy { - if x != nil { - return x.Haproxy - } - return nil -} - -func (x *PXCClusterParams) GetBackup() *Backup { - if x != nil { - return x.Backup - } - return nil -} - -func (x *PXCClusterParams) GetRestore() *Restore { - if x != nil { - return x.Restore - } - return nil -} - -type GetPXCClusterCredentialsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - // PXC cluster name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *GetPXCClusterCredentialsRequest) Reset() { - *x = GetPXCClusterCredentialsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPXCClusterCredentialsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPXCClusterCredentialsRequest) ProtoMessage() {} - -func (x *GetPXCClusterCredentialsRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPXCClusterCredentialsRequest.ProtoReflect.Descriptor instead. -func (*GetPXCClusterCredentialsRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{1} -} - -func (x *GetPXCClusterCredentialsRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *GetPXCClusterCredentialsRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// PXCClusterConnectionCredentials is cluster connection credentials. -type PXCClusterConnectionCredentials struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // PXC username. - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - // PXC password. - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - // PXC host. - Host string `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"` - // PXC port. - Port int32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"` -} - -func (x *PXCClusterConnectionCredentials) Reset() { - *x = PXCClusterConnectionCredentials{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PXCClusterConnectionCredentials) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PXCClusterConnectionCredentials) ProtoMessage() {} - -func (x *PXCClusterConnectionCredentials) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PXCClusterConnectionCredentials.ProtoReflect.Descriptor instead. -func (*PXCClusterConnectionCredentials) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{2} -} - -func (x *PXCClusterConnectionCredentials) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *PXCClusterConnectionCredentials) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *PXCClusterConnectionCredentials) GetHost() string { - if x != nil { - return x.Host - } - return "" -} - -func (x *PXCClusterConnectionCredentials) GetPort() int32 { - if x != nil { - return x.Port - } - return 0 -} - -type GetPXCClusterCredentialsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Cluster connection credentials. - ConnectionCredentials *PXCClusterConnectionCredentials `protobuf:"bytes,1,opt,name=connection_credentials,json=connectionCredentials,proto3" json:"connection_credentials,omitempty"` -} - -func (x *GetPXCClusterCredentialsResponse) Reset() { - *x = GetPXCClusterCredentialsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPXCClusterCredentialsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPXCClusterCredentialsResponse) ProtoMessage() {} - -func (x *GetPXCClusterCredentialsResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPXCClusterCredentialsResponse.ProtoReflect.Descriptor instead. -func (*GetPXCClusterCredentialsResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{3} -} - -func (x *GetPXCClusterCredentialsResponse) GetConnectionCredentials() *PXCClusterConnectionCredentials { - if x != nil { - return x.ConnectionCredentials - } - return nil -} - -type CreatePXCClusterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - // PXC cluster name. - // a DNS-1035 label must consist of lower case alphanumeric characters or '-', - // start with an alphabetic character, and end with an alphanumeric character - // (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?') - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Cluster parameters. - Params *PXCClusterParams `protobuf:"bytes,3,opt,name=params,proto3" json:"params,omitempty"` - // Make DB cluster accessible outside of K8s cluster. - Expose bool `protobuf:"varint,4,opt,name=expose,proto3" json:"expose,omitempty"` - // Make DB cluster accessible via public internet. - InternetFacing bool `protobuf:"varint,5,opt,name=internet_facing,json=internetFacing,proto3" json:"internet_facing,omitempty"` - // Apply IP source ranges against the cluster. - SourceRanges []string `protobuf:"bytes,6,rep,name=source_ranges,json=sourceRanges,proto3" json:"source_ranges,omitempty"` - // Configuration template. - Template *Template `protobuf:"bytes,7,opt,name=template,proto3" json:"template,omitempty"` -} - -func (x *CreatePXCClusterRequest) Reset() { - *x = CreatePXCClusterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreatePXCClusterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePXCClusterRequest) ProtoMessage() {} - -func (x *CreatePXCClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreatePXCClusterRequest.ProtoReflect.Descriptor instead. -func (*CreatePXCClusterRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{4} -} - -func (x *CreatePXCClusterRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *CreatePXCClusterRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreatePXCClusterRequest) GetParams() *PXCClusterParams { - if x != nil { - return x.Params - } - return nil -} - -func (x *CreatePXCClusterRequest) GetExpose() bool { - if x != nil { - return x.Expose - } - return false -} - -func (x *CreatePXCClusterRequest) GetInternetFacing() bool { - if x != nil { - return x.InternetFacing - } - return false -} - -func (x *CreatePXCClusterRequest) GetSourceRanges() []string { - if x != nil { - return x.SourceRanges - } - return nil -} - -func (x *CreatePXCClusterRequest) GetTemplate() *Template { - if x != nil { - return x.Template - } - return nil -} - -type CreatePXCClusterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *CreatePXCClusterResponse) Reset() { - *x = CreatePXCClusterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreatePXCClusterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePXCClusterResponse) ProtoMessage() {} - -func (x *CreatePXCClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreatePXCClusterResponse.ProtoReflect.Descriptor instead. -func (*CreatePXCClusterResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{5} -} - -type UpdatePXCClusterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - // PXC cluster name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Cluster parameters. - Params *UpdatePXCClusterRequest_UpdatePXCClusterParams `protobuf:"bytes,3,opt,name=params,proto3" json:"params,omitempty"` - // Make DB cluster accessible outside of K8s cluster. - Expose bool `protobuf:"varint,4,opt,name=expose,proto3" json:"expose,omitempty"` - // Make DB cluster accessible via public internet. - InternetFacing bool `protobuf:"varint,5,opt,name=internet_facing,json=internetFacing,proto3" json:"internet_facing,omitempty"` - // Apply IP source ranges against the cluster. - SourceRanges []string `protobuf:"bytes,6,rep,name=source_ranges,json=sourceRanges,proto3" json:"source_ranges,omitempty"` - // Configuration template. - Template *Template `protobuf:"bytes,7,opt,name=template,proto3" json:"template,omitempty"` -} - -func (x *UpdatePXCClusterRequest) Reset() { - *x = UpdatePXCClusterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdatePXCClusterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdatePXCClusterRequest) ProtoMessage() {} - -func (x *UpdatePXCClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdatePXCClusterRequest.ProtoReflect.Descriptor instead. -func (*UpdatePXCClusterRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{6} -} - -func (x *UpdatePXCClusterRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *UpdatePXCClusterRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *UpdatePXCClusterRequest) GetParams() *UpdatePXCClusterRequest_UpdatePXCClusterParams { - if x != nil { - return x.Params - } - return nil -} - -func (x *UpdatePXCClusterRequest) GetExpose() bool { - if x != nil { - return x.Expose - } - return false -} - -func (x *UpdatePXCClusterRequest) GetInternetFacing() bool { - if x != nil { - return x.InternetFacing - } - return false -} - -func (x *UpdatePXCClusterRequest) GetSourceRanges() []string { - if x != nil { - return x.SourceRanges - } - return nil -} - -func (x *UpdatePXCClusterRequest) GetTemplate() *Template { - if x != nil { - return x.Template - } - return nil -} - -type UpdatePXCClusterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdatePXCClusterResponse) Reset() { - *x = UpdatePXCClusterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdatePXCClusterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdatePXCClusterResponse) ProtoMessage() {} - -func (x *UpdatePXCClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdatePXCClusterResponse.ProtoReflect.Descriptor instead. -func (*UpdatePXCClusterResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{7} -} - -type GetPXCClusterResourcesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Cluster parameters. - Params *PXCClusterParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` -} - -func (x *GetPXCClusterResourcesRequest) Reset() { - *x = GetPXCClusterResourcesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPXCClusterResourcesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPXCClusterResourcesRequest) ProtoMessage() {} - -func (x *GetPXCClusterResourcesRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPXCClusterResourcesRequest.ProtoReflect.Descriptor instead. -func (*GetPXCClusterResourcesRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{8} -} - -func (x *GetPXCClusterResourcesRequest) GetParams() *PXCClusterParams { - if x != nil { - return x.Params - } - return nil -} - -type GetPXCClusterResourcesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Expected resources to be consumed by the cluster. - Expected *Resources `protobuf:"bytes,1,opt,name=expected,proto3" json:"expected,omitempty"` -} - -func (x *GetPXCClusterResourcesResponse) Reset() { - *x = GetPXCClusterResourcesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPXCClusterResourcesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPXCClusterResourcesResponse) ProtoMessage() {} - -func (x *GetPXCClusterResourcesResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPXCClusterResourcesResponse.ProtoReflect.Descriptor instead. -func (*GetPXCClusterResourcesResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{9} -} - -func (x *GetPXCClusterResourcesResponse) GetExpected() *Resources { - if x != nil { - return x.Expected - } - return nil -} - -// PXC container parameters. -// TODO Do not use inner messages in all public APIs (for consistency). -type PXCClusterParams_PXC struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Docker image used for PXC. - Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` - // Requested compute resources. - ComputeResources *ComputeResources `protobuf:"bytes,1,opt,name=compute_resources,json=computeResources,proto3" json:"compute_resources,omitempty"` - // Disk size in bytes. - DiskSize int64 `protobuf:"varint,2,opt,name=disk_size,json=diskSize,proto3" json:"disk_size,omitempty"` - // Configuration for PXC cluster - Configuration string `protobuf:"bytes,4,opt,name=configuration,proto3" json:"configuration,omitempty"` - // Storage Class for PXC cluster. - StorageClass string `protobuf:"bytes,5,opt,name=storage_class,json=storageClass,proto3" json:"storage_class,omitempty"` -} - -func (x *PXCClusterParams_PXC) Reset() { - *x = PXCClusterParams_PXC{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PXCClusterParams_PXC) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PXCClusterParams_PXC) ProtoMessage() {} - -func (x *PXCClusterParams_PXC) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PXCClusterParams_PXC.ProtoReflect.Descriptor instead. -func (*PXCClusterParams_PXC) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *PXCClusterParams_PXC) GetImage() string { - if x != nil { - return x.Image - } - return "" -} - -func (x *PXCClusterParams_PXC) GetComputeResources() *ComputeResources { - if x != nil { - return x.ComputeResources - } - return nil -} - -func (x *PXCClusterParams_PXC) GetDiskSize() int64 { - if x != nil { - return x.DiskSize - } - return 0 -} - -func (x *PXCClusterParams_PXC) GetConfiguration() string { - if x != nil { - return x.Configuration - } - return "" -} - -func (x *PXCClusterParams_PXC) GetStorageClass() string { - if x != nil { - return x.StorageClass - } - return "" -} - -// ProxySQL container parameters. -// TODO Do not use inner messages in all public APIs (for consistency). -type PXCClusterParams_ProxySQL struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Docker image used for ProxySQL. - Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` - // Requested compute resources. - ComputeResources *ComputeResources `protobuf:"bytes,1,opt,name=compute_resources,json=computeResources,proto3" json:"compute_resources,omitempty"` - // Disk size in bytes. - DiskSize int64 `protobuf:"varint,2,opt,name=disk_size,json=diskSize,proto3" json:"disk_size,omitempty"` -} - -func (x *PXCClusterParams_ProxySQL) Reset() { - *x = PXCClusterParams_ProxySQL{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PXCClusterParams_ProxySQL) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PXCClusterParams_ProxySQL) ProtoMessage() {} - -func (x *PXCClusterParams_ProxySQL) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PXCClusterParams_ProxySQL.ProtoReflect.Descriptor instead. -func (*PXCClusterParams_ProxySQL) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{0, 1} -} - -func (x *PXCClusterParams_ProxySQL) GetImage() string { - if x != nil { - return x.Image - } - return "" -} - -func (x *PXCClusterParams_ProxySQL) GetComputeResources() *ComputeResources { - if x != nil { - return x.ComputeResources - } - return nil -} - -func (x *PXCClusterParams_ProxySQL) GetDiskSize() int64 { - if x != nil { - return x.DiskSize - } - return 0 -} - -// HAProxy container parameters. -// NOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it. -type PXCClusterParams_HAProxy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Docker image used for HAProxy. - Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` - // Requested compute resources. - ComputeResources *ComputeResources `protobuf:"bytes,2,opt,name=compute_resources,json=computeResources,proto3" json:"compute_resources,omitempty"` -} - -func (x *PXCClusterParams_HAProxy) Reset() { - *x = PXCClusterParams_HAProxy{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PXCClusterParams_HAProxy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PXCClusterParams_HAProxy) ProtoMessage() {} - -func (x *PXCClusterParams_HAProxy) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PXCClusterParams_HAProxy.ProtoReflect.Descriptor instead. -func (*PXCClusterParams_HAProxy) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{0, 2} -} - -func (x *PXCClusterParams_HAProxy) GetImage() string { - if x != nil { - return x.Image - } - return "" -} - -func (x *PXCClusterParams_HAProxy) GetComputeResources() *ComputeResources { - if x != nil { - return x.ComputeResources - } - return nil -} - -// UpdatePXCClusterParams represents PXC cluster parameters that can be updated. -type UpdatePXCClusterRequest_UpdatePXCClusterParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Cluster size. - ClusterSize int32 `protobuf:"varint,1,opt,name=cluster_size,json=clusterSize,proto3" json:"cluster_size,omitempty"` - // PXC container parameters. - Pxc *UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC `protobuf:"bytes,2,opt,name=pxc,proto3" json:"pxc,omitempty"` - // ProxySQL container parameters. - Proxysql *UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL `protobuf:"bytes,3,opt,name=proxysql,proto3" json:"proxysql,omitempty"` - // Suspend cluster `pause: true`. - Suspend bool `protobuf:"varint,4,opt,name=suspend,proto3" json:"suspend,omitempty"` - // Resume cluster `pause: false`. - Resume bool `protobuf:"varint,5,opt,name=resume,proto3" json:"resume,omitempty"` - // HAProxy container parameters. - Haproxy *UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy `protobuf:"bytes,6,opt,name=haproxy,proto3" json:"haproxy,omitempty"` -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams) Reset() { - *x = UpdatePXCClusterRequest_UpdatePXCClusterParams{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdatePXCClusterRequest_UpdatePXCClusterParams) ProtoMessage() {} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdatePXCClusterRequest_UpdatePXCClusterParams.ProtoReflect.Descriptor instead. -func (*UpdatePXCClusterRequest_UpdatePXCClusterParams) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{6, 0} -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams) GetClusterSize() int32 { - if x != nil { - return x.ClusterSize - } - return 0 -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams) GetPxc() *UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC { - if x != nil { - return x.Pxc - } - return nil -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams) GetProxysql() *UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL { - if x != nil { - return x.Proxysql - } - return nil -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams) GetSuspend() bool { - if x != nil { - return x.Suspend - } - return false -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams) GetResume() bool { - if x != nil { - return x.Resume - } - return false -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams) GetHaproxy() *UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy { - if x != nil { - return x.Haproxy - } - return nil -} - -// PXC container parameters. -type UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Requested compute resources. - ComputeResources *ComputeResources `protobuf:"bytes,1,opt,name=compute_resources,json=computeResources,proto3" json:"compute_resources,omitempty"` - // Image to use. If it's the same image but with different version tag, upgrade of database cluster to version - // in given tag is triggered. If entirely different image is given, error is returned. - Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` - // Configuration for PXC cluster - Configuration string `protobuf:"bytes,4,opt,name=configuration,proto3" json:"configuration,omitempty"` - // Storage Class for PXC cluster. - StorageClass string `protobuf:"bytes,5,opt,name=storage_class,json=storageClass,proto3" json:"storage_class,omitempty"` -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC) Reset() { - *x = UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC) ProtoMessage() {} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC.ProtoReflect.Descriptor instead. -func (*UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{6, 0, 0} -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC) GetComputeResources() *ComputeResources { - if x != nil { - return x.ComputeResources - } - return nil -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC) GetImage() string { - if x != nil { - return x.Image - } - return "" -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC) GetConfiguration() string { - if x != nil { - return x.Configuration - } - return "" -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC) GetStorageClass() string { - if x != nil { - return x.StorageClass - } - return "" -} - -// ProxySQL container parameters. -type UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Requested compute resources. - ComputeResources *ComputeResources `protobuf:"bytes,1,opt,name=compute_resources,json=computeResources,proto3" json:"compute_resources,omitempty"` -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL) Reset() { - *x = UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL) ProtoMessage() {} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL.ProtoReflect.Descriptor instead. -func (*UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{6, 0, 1} -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL) GetComputeResources() *ComputeResources { - if x != nil { - return x.ComputeResources - } - return nil -} - -// HAProxy container parameters. -type UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Requested compute resources. - ComputeResources *ComputeResources `protobuf:"bytes,1,opt,name=compute_resources,json=computeResources,proto3" json:"compute_resources,omitempty"` -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy) Reset() { - *x = UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy) ProtoMessage() {} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_pxc_clusters_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy.ProtoReflect.Descriptor instead. -func (*UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP(), []int{6, 0, 2} -} - -func (x *UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy) GetComputeResources() *ComputeResources { - if x != nil { - return x.ComputeResources - } - return nil -} - -var File_managementpb_dbaas_pxc_clusters_proto protoreflect.FileDescriptor - -var file_managementpb_dbaas_pxc_clusters_proto_rawDesc = []byte{ - 0x0a, 0x25, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2f, 0x70, 0x78, 0x63, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x70, 0x62, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x70, 0x62, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0xa7, 0x06, 0x0a, 0x10, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x35, 0x0a, 0x03, 0x70, 0x78, 0x63, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x50, 0x58, 0x43, 0x52, 0x03, 0x70, 0x78, 0x63, - 0x12, 0x44, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x73, 0x71, 0x6c, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x52, 0x08, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x41, 0x0a, 0x07, 0x68, 0x61, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, - 0x52, 0x07, 0x68, 0x61, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x2d, 0x0a, 0x06, 0x62, 0x61, 0x63, - 0x6b, 0x75, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x62, 0x61, 0x61, - 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, - 0x52, 0x06, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x30, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x64, 0x62, 0x61, 0x61, - 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x52, 0x07, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0xd1, 0x01, 0x0a, 0x03, 0x50, - 0x58, 0x43, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x4c, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x70, - 0x75, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x73, - 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, 0x69, 0x73, 0x6b, 0x53, - 0x69, 0x7a, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x1a, 0x8b, - 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x12, 0x14, 0x0a, 0x05, 0x69, - 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x12, 0x4c, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, - 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x10, 0x63, - 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, - 0x1b, 0x0a, 0x09, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x08, 0x64, 0x69, 0x73, 0x6b, 0x53, 0x69, 0x7a, 0x65, 0x1a, 0x6d, 0x0a, 0x07, - 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x4c, 0x0a, - 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x75, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x7f, 0x0a, 0x1f, 0x47, - 0x65, 0x74, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x43, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, - 0x0a, 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x15, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, - 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x81, 0x01, 0x0a, - 0x1f, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, - 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, - 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, - 0x22, 0x89, 0x01, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x16, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x15, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x22, 0xc2, 0x02, 0x0a, - 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x17, 0x6b, 0x75, 0x62, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, - 0x10, 0x01, 0x52, 0x15, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, - 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x58, - 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x27, - 0x0a, 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x5f, 0x66, 0x61, 0x63, 0x69, 0x6e, - 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, - 0x74, 0x46, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x08, - 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x22, 0x1a, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x58, 0x43, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xdd, 0x08, - 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x17, 0x6b, 0x75, 0x62, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, - 0x02, 0x10, 0x01, 0x52, 0x15, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, - 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x55, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x58, - 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x16, - 0x0a, 0x06, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, - 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x5f, 0x66, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x46, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x12, - 0x23, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, - 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x61, - 0x6e, 0x67, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, - 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x1a, 0xf1, 0x05, 0x0a, 0x16, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x53, 0x0a, 0x03, 0x70, 0x78, 0x63, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x58, 0x43, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x2e, 0x50, 0x58, 0x43, 0x52, 0x03, 0x70, 0x78, 0x63, 0x12, 0x62, 0x0a, 0x08, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x73, 0x71, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x46, - 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x58, 0x43, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x50, 0x72, - 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x73, 0x71, 0x6c, - 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x07, 0x73, 0x75, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, - 0x73, 0x75, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, - 0x6d, 0x65, 0x12, 0x5f, 0x0a, 0x07, 0x68, 0x61, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x45, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x2e, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x07, 0x68, 0x61, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x1a, 0xb4, 0x01, 0x0a, 0x03, 0x50, 0x58, 0x43, 0x12, 0x4c, 0x0a, 0x11, 0x63, - 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, - 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, - 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x1a, 0x58, 0x0a, 0x08, 0x50, 0x72, - 0x6f, 0x78, 0x79, 0x53, 0x51, 0x4c, 0x12, 0x4c, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, - 0x65, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1f, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x1a, 0x57, 0x0a, 0x07, 0x48, 0x41, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, - 0x4c, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x64, 0x62, 0x61, - 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x10, 0x63, 0x6f, 0x6d, - 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x1a, 0x0a, - 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x62, 0x0a, 0x1d, 0x47, 0x65, 0x74, - 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x64, 0x62, 0x61, - 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x58, 0x43, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x08, 0xfa, 0x42, 0x05, - 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x56, 0x0a, - 0x1e, 0x47, 0x65, 0x74, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x34, 0x0a, 0x08, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x18, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x08, 0x65, 0x78, 0x70, - 0x65, 0x63, 0x74, 0x65, 0x64, 0x2a, 0x89, 0x01, 0x0a, 0x0e, 0x50, 0x58, 0x43, 0x42, 0x61, 0x63, - 0x6b, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x58, 0x43, 0x5f, - 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x56, - 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x58, 0x43, 0x5f, 0x42, 0x41, - 0x43, 0x4b, 0x55, 0x50, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x55, 0x4e, 0x4e, 0x49, - 0x4e, 0x47, 0x10, 0x01, 0x12, 0x1e, 0x0a, 0x1a, 0x50, 0x58, 0x43, 0x5f, 0x42, 0x41, 0x43, 0x4b, - 0x55, 0x50, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x45, 0x44, - 0x45, 0x44, 0x10, 0x02, 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x58, 0x43, 0x5f, 0x42, 0x41, 0x43, 0x4b, - 0x55, 0x50, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, - 0x03, 0x32, 0xab, 0x05, 0x0a, 0x0b, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x73, 0x12, 0xb7, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x2e, - 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x43, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, - 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x43, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x3a, 0x01, 0x2a, 0x22, 0x2f, 0x2f, 0x76, 0x31, 0x2f, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, - 0x2f, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x2f, 0x47, 0x65, 0x74, - 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x96, 0x01, 0x0a, 0x10, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x12, 0x26, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, - 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x3a, 0x01, 0x2a, 0x22, 0x26, 0x2f, 0x76, - 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, - 0x61, 0x53, 0x2f, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x12, 0x96, 0x01, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x26, 0x2e, 0x64, 0x62, 0x61, 0x61, - 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x27, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x2b, 0x3a, 0x01, 0x2a, 0x22, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, 0x2f, 0x50, 0x58, 0x43, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0xaf, 0x01, - 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x58, 0x43, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x3a, 0x01, 0x2a, - 0x22, 0x2d, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, 0x2f, 0x50, 0x58, 0x43, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x2f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x42, - 0xb6, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x10, 0x50, 0x78, 0x63, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, - 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x70, 0x62, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x3b, 0x64, 0x62, 0x61, 0x61, 0x73, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x44, 0x62, - 0x61, 0x61, 0x73, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x0d, 0x44, 0x62, - 0x61, 0x61, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x19, 0x44, 0x62, - 0x61, 0x61, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x44, 0x62, 0x61, 0x61, 0x73, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_managementpb_dbaas_pxc_clusters_proto_rawDescOnce sync.Once - file_managementpb_dbaas_pxc_clusters_proto_rawDescData = file_managementpb_dbaas_pxc_clusters_proto_rawDesc -) - -func file_managementpb_dbaas_pxc_clusters_proto_rawDescGZIP() []byte { - file_managementpb_dbaas_pxc_clusters_proto_rawDescOnce.Do(func() { - file_managementpb_dbaas_pxc_clusters_proto_rawDescData = protoimpl.X.CompressGZIP(file_managementpb_dbaas_pxc_clusters_proto_rawDescData) - }) - return file_managementpb_dbaas_pxc_clusters_proto_rawDescData -} - -var ( - file_managementpb_dbaas_pxc_clusters_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_managementpb_dbaas_pxc_clusters_proto_msgTypes = make([]protoimpl.MessageInfo, 17) - file_managementpb_dbaas_pxc_clusters_proto_goTypes = []interface{}{ - (PXCBackupState)(0), // 0: dbaas.v1beta1.PXCBackupState - (*PXCClusterParams)(nil), // 1: dbaas.v1beta1.PXCClusterParams - (*GetPXCClusterCredentialsRequest)(nil), // 2: dbaas.v1beta1.GetPXCClusterCredentialsRequest - (*PXCClusterConnectionCredentials)(nil), // 3: dbaas.v1beta1.PXCClusterConnectionCredentials - (*GetPXCClusterCredentialsResponse)(nil), // 4: dbaas.v1beta1.GetPXCClusterCredentialsResponse - (*CreatePXCClusterRequest)(nil), // 5: dbaas.v1beta1.CreatePXCClusterRequest - (*CreatePXCClusterResponse)(nil), // 6: dbaas.v1beta1.CreatePXCClusterResponse - (*UpdatePXCClusterRequest)(nil), // 7: dbaas.v1beta1.UpdatePXCClusterRequest - (*UpdatePXCClusterResponse)(nil), // 8: dbaas.v1beta1.UpdatePXCClusterResponse - (*GetPXCClusterResourcesRequest)(nil), // 9: dbaas.v1beta1.GetPXCClusterResourcesRequest - (*GetPXCClusterResourcesResponse)(nil), // 10: dbaas.v1beta1.GetPXCClusterResourcesResponse - (*PXCClusterParams_PXC)(nil), // 11: dbaas.v1beta1.PXCClusterParams.PXC - (*PXCClusterParams_ProxySQL)(nil), // 12: dbaas.v1beta1.PXCClusterParams.ProxySQL - (*PXCClusterParams_HAProxy)(nil), // 13: dbaas.v1beta1.PXCClusterParams.HAProxy - (*UpdatePXCClusterRequest_UpdatePXCClusterParams)(nil), // 14: dbaas.v1beta1.UpdatePXCClusterRequest.UpdatePXCClusterParams - (*UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC)(nil), // 15: dbaas.v1beta1.UpdatePXCClusterRequest.UpdatePXCClusterParams.PXC - (*UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL)(nil), // 16: dbaas.v1beta1.UpdatePXCClusterRequest.UpdatePXCClusterParams.ProxySQL - (*UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy)(nil), // 17: dbaas.v1beta1.UpdatePXCClusterRequest.UpdatePXCClusterParams.HAProxy - (*Backup)(nil), // 18: dbaas.v1beta1.Backup - (*Restore)(nil), // 19: dbaas.v1beta1.Restore - (*Template)(nil), // 20: dbaas.v1beta1.Template - (*Resources)(nil), // 21: dbaas.v1beta1.Resources - (*ComputeResources)(nil), // 22: dbaas.v1beta1.ComputeResources - } -) - -var file_managementpb_dbaas_pxc_clusters_proto_depIdxs = []int32{ - 11, // 0: dbaas.v1beta1.PXCClusterParams.pxc:type_name -> dbaas.v1beta1.PXCClusterParams.PXC - 12, // 1: dbaas.v1beta1.PXCClusterParams.proxysql:type_name -> dbaas.v1beta1.PXCClusterParams.ProxySQL - 13, // 2: dbaas.v1beta1.PXCClusterParams.haproxy:type_name -> dbaas.v1beta1.PXCClusterParams.HAProxy - 18, // 3: dbaas.v1beta1.PXCClusterParams.backup:type_name -> dbaas.v1beta1.Backup - 19, // 4: dbaas.v1beta1.PXCClusterParams.restore:type_name -> dbaas.v1beta1.Restore - 3, // 5: dbaas.v1beta1.GetPXCClusterCredentialsResponse.connection_credentials:type_name -> dbaas.v1beta1.PXCClusterConnectionCredentials - 1, // 6: dbaas.v1beta1.CreatePXCClusterRequest.params:type_name -> dbaas.v1beta1.PXCClusterParams - 20, // 7: dbaas.v1beta1.CreatePXCClusterRequest.template:type_name -> dbaas.v1beta1.Template - 14, // 8: dbaas.v1beta1.UpdatePXCClusterRequest.params:type_name -> dbaas.v1beta1.UpdatePXCClusterRequest.UpdatePXCClusterParams - 20, // 9: dbaas.v1beta1.UpdatePXCClusterRequest.template:type_name -> dbaas.v1beta1.Template - 1, // 10: dbaas.v1beta1.GetPXCClusterResourcesRequest.params:type_name -> dbaas.v1beta1.PXCClusterParams - 21, // 11: dbaas.v1beta1.GetPXCClusterResourcesResponse.expected:type_name -> dbaas.v1beta1.Resources - 22, // 12: dbaas.v1beta1.PXCClusterParams.PXC.compute_resources:type_name -> dbaas.v1beta1.ComputeResources - 22, // 13: dbaas.v1beta1.PXCClusterParams.ProxySQL.compute_resources:type_name -> dbaas.v1beta1.ComputeResources - 22, // 14: dbaas.v1beta1.PXCClusterParams.HAProxy.compute_resources:type_name -> dbaas.v1beta1.ComputeResources - 15, // 15: dbaas.v1beta1.UpdatePXCClusterRequest.UpdatePXCClusterParams.pxc:type_name -> dbaas.v1beta1.UpdatePXCClusterRequest.UpdatePXCClusterParams.PXC - 16, // 16: dbaas.v1beta1.UpdatePXCClusterRequest.UpdatePXCClusterParams.proxysql:type_name -> dbaas.v1beta1.UpdatePXCClusterRequest.UpdatePXCClusterParams.ProxySQL - 17, // 17: dbaas.v1beta1.UpdatePXCClusterRequest.UpdatePXCClusterParams.haproxy:type_name -> dbaas.v1beta1.UpdatePXCClusterRequest.UpdatePXCClusterParams.HAProxy - 22, // 18: dbaas.v1beta1.UpdatePXCClusterRequest.UpdatePXCClusterParams.PXC.compute_resources:type_name -> dbaas.v1beta1.ComputeResources - 22, // 19: dbaas.v1beta1.UpdatePXCClusterRequest.UpdatePXCClusterParams.ProxySQL.compute_resources:type_name -> dbaas.v1beta1.ComputeResources - 22, // 20: dbaas.v1beta1.UpdatePXCClusterRequest.UpdatePXCClusterParams.HAProxy.compute_resources:type_name -> dbaas.v1beta1.ComputeResources - 2, // 21: dbaas.v1beta1.PXCClusters.GetPXCClusterCredentials:input_type -> dbaas.v1beta1.GetPXCClusterCredentialsRequest - 5, // 22: dbaas.v1beta1.PXCClusters.CreatePXCCluster:input_type -> dbaas.v1beta1.CreatePXCClusterRequest - 7, // 23: dbaas.v1beta1.PXCClusters.UpdatePXCCluster:input_type -> dbaas.v1beta1.UpdatePXCClusterRequest - 9, // 24: dbaas.v1beta1.PXCClusters.GetPXCClusterResources:input_type -> dbaas.v1beta1.GetPXCClusterResourcesRequest - 4, // 25: dbaas.v1beta1.PXCClusters.GetPXCClusterCredentials:output_type -> dbaas.v1beta1.GetPXCClusterCredentialsResponse - 6, // 26: dbaas.v1beta1.PXCClusters.CreatePXCCluster:output_type -> dbaas.v1beta1.CreatePXCClusterResponse - 8, // 27: dbaas.v1beta1.PXCClusters.UpdatePXCCluster:output_type -> dbaas.v1beta1.UpdatePXCClusterResponse - 10, // 28: dbaas.v1beta1.PXCClusters.GetPXCClusterResources:output_type -> dbaas.v1beta1.GetPXCClusterResourcesResponse - 25, // [25:29] is the sub-list for method output_type - 21, // [21:25] is the sub-list for method input_type - 21, // [21:21] is the sub-list for extension type_name - 21, // [21:21] is the sub-list for extension extendee - 0, // [0:21] is the sub-list for field type_name -} - -func init() { file_managementpb_dbaas_pxc_clusters_proto_init() } -func file_managementpb_dbaas_pxc_clusters_proto_init() { - if File_managementpb_dbaas_pxc_clusters_proto != nil { - return - } - file_managementpb_dbaas_dbaas_proto_init() - file_managementpb_dbaas_templates_proto_init() - if !protoimpl.UnsafeEnabled { - file_managementpb_dbaas_pxc_clusters_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PXCClusterParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_pxc_clusters_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPXCClusterCredentialsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_pxc_clusters_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PXCClusterConnectionCredentials); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_pxc_clusters_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPXCClusterCredentialsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_pxc_clusters_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreatePXCClusterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_pxc_clusters_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreatePXCClusterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_pxc_clusters_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdatePXCClusterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_pxc_clusters_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdatePXCClusterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_pxc_clusters_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPXCClusterResourcesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_pxc_clusters_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPXCClusterResourcesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_pxc_clusters_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PXCClusterParams_PXC); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_pxc_clusters_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PXCClusterParams_ProxySQL); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_pxc_clusters_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PXCClusterParams_HAProxy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_pxc_clusters_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdatePXCClusterRequest_UpdatePXCClusterParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_pxc_clusters_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_pxc_clusters_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_pxc_clusters_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_managementpb_dbaas_pxc_clusters_proto_rawDesc, - NumEnums: 1, - NumMessages: 17, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_managementpb_dbaas_pxc_clusters_proto_goTypes, - DependencyIndexes: file_managementpb_dbaas_pxc_clusters_proto_depIdxs, - EnumInfos: file_managementpb_dbaas_pxc_clusters_proto_enumTypes, - MessageInfos: file_managementpb_dbaas_pxc_clusters_proto_msgTypes, - }.Build() - File_managementpb_dbaas_pxc_clusters_proto = out.File - file_managementpb_dbaas_pxc_clusters_proto_rawDesc = nil - file_managementpb_dbaas_pxc_clusters_proto_goTypes = nil - file_managementpb_dbaas_pxc_clusters_proto_depIdxs = nil -} diff --git a/api/managementpb/dbaas/pxc_clusters.pb.gw.go b/api/managementpb/dbaas/pxc_clusters.pb.gw.go deleted file mode 100644 index 65165a778a..0000000000 --- a/api/managementpb/dbaas/pxc_clusters.pb.gw.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: managementpb/dbaas/pxc_clusters.proto - -/* -Package dbaasv1beta1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package dbaasv1beta1 - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_PXCClusters_GetPXCClusterCredentials_0(ctx context.Context, marshaler runtime.Marshaler, client PXCClustersClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetPXCClusterCredentialsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetPXCClusterCredentials(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_PXCClusters_GetPXCClusterCredentials_0(ctx context.Context, marshaler runtime.Marshaler, server PXCClustersServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetPXCClusterCredentialsRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetPXCClusterCredentials(ctx, &protoReq) - return msg, metadata, err -} - -func request_PXCClusters_CreatePXCCluster_0(ctx context.Context, marshaler runtime.Marshaler, client PXCClustersClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreatePXCClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CreatePXCCluster(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_PXCClusters_CreatePXCCluster_0(ctx context.Context, marshaler runtime.Marshaler, server PXCClustersServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreatePXCClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CreatePXCCluster(ctx, &protoReq) - return msg, metadata, err -} - -func request_PXCClusters_UpdatePXCCluster_0(ctx context.Context, marshaler runtime.Marshaler, client PXCClustersClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdatePXCClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.UpdatePXCCluster(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_PXCClusters_UpdatePXCCluster_0(ctx context.Context, marshaler runtime.Marshaler, server PXCClustersServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdatePXCClusterRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.UpdatePXCCluster(ctx, &protoReq) - return msg, metadata, err -} - -func request_PXCClusters_GetPXCClusterResources_0(ctx context.Context, marshaler runtime.Marshaler, client PXCClustersClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetPXCClusterResourcesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetPXCClusterResources(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_PXCClusters_GetPXCClusterResources_0(ctx context.Context, marshaler runtime.Marshaler, server PXCClustersServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetPXCClusterResourcesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetPXCClusterResources(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterPXCClustersHandlerServer registers the http handlers for service PXCClusters to "mux". -// UnaryRPC :call PXCClustersServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPXCClustersHandlerFromEndpoint instead. -func RegisterPXCClustersHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PXCClustersServer) error { - mux.Handle("POST", pattern_PXCClusters_GetPXCClusterCredentials_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.PXCClusters/GetPXCClusterCredentials", runtime.WithHTTPPathPattern("/v1/management/DBaaS/PXCClusters/GetCredentials")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_PXCClusters_GetPXCClusterCredentials_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_PXCClusters_GetPXCClusterCredentials_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_PXCClusters_CreatePXCCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.PXCClusters/CreatePXCCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/PXCCluster/Create")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_PXCClusters_CreatePXCCluster_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_PXCClusters_CreatePXCCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_PXCClusters_UpdatePXCCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.PXCClusters/UpdatePXCCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/PXCCluster/Update")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_PXCClusters_UpdatePXCCluster_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_PXCClusters_UpdatePXCCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_PXCClusters_GetPXCClusterResources_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.PXCClusters/GetPXCClusterResources", runtime.WithHTTPPathPattern("/v1/management/DBaaS/PXCCluster/Resources/Get")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_PXCClusters_GetPXCClusterResources_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_PXCClusters_GetPXCClusterResources_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterPXCClustersHandlerFromEndpoint is same as RegisterPXCClustersHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterPXCClustersHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterPXCClustersHandler(ctx, mux, conn) -} - -// RegisterPXCClustersHandler registers the http handlers for service PXCClusters to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterPXCClustersHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterPXCClustersHandlerClient(ctx, mux, NewPXCClustersClient(conn)) -} - -// RegisterPXCClustersHandlerClient registers the http handlers for service PXCClusters -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PXCClustersClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PXCClustersClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "PXCClustersClient" to call the correct interceptors. -func RegisterPXCClustersHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PXCClustersClient) error { - mux.Handle("POST", pattern_PXCClusters_GetPXCClusterCredentials_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.PXCClusters/GetPXCClusterCredentials", runtime.WithHTTPPathPattern("/v1/management/DBaaS/PXCClusters/GetCredentials")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_PXCClusters_GetPXCClusterCredentials_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_PXCClusters_GetPXCClusterCredentials_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_PXCClusters_CreatePXCCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.PXCClusters/CreatePXCCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/PXCCluster/Create")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_PXCClusters_CreatePXCCluster_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_PXCClusters_CreatePXCCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_PXCClusters_UpdatePXCCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.PXCClusters/UpdatePXCCluster", runtime.WithHTTPPathPattern("/v1/management/DBaaS/PXCCluster/Update")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_PXCClusters_UpdatePXCCluster_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_PXCClusters_UpdatePXCCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_PXCClusters_GetPXCClusterResources_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.PXCClusters/GetPXCClusterResources", runtime.WithHTTPPathPattern("/v1/management/DBaaS/PXCCluster/Resources/Get")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_PXCClusters_GetPXCClusterResources_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_PXCClusters_GetPXCClusterResources_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -var ( - pattern_PXCClusters_GetPXCClusterCredentials_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "PXCClusters", "GetCredentials"}, "")) - - pattern_PXCClusters_CreatePXCCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "PXCCluster", "Create"}, "")) - - pattern_PXCClusters_UpdatePXCCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "PXCCluster", "Update"}, "")) - - pattern_PXCClusters_GetPXCClusterResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"v1", "management", "DBaaS", "PXCCluster", "Resources", "Get"}, "")) -) - -var ( - forward_PXCClusters_GetPXCClusterCredentials_0 = runtime.ForwardResponseMessage - - forward_PXCClusters_CreatePXCCluster_0 = runtime.ForwardResponseMessage - - forward_PXCClusters_UpdatePXCCluster_0 = runtime.ForwardResponseMessage - - forward_PXCClusters_GetPXCClusterResources_0 = runtime.ForwardResponseMessage -) diff --git a/api/managementpb/dbaas/pxc_clusters.pb.validate.go b/api/managementpb/dbaas/pxc_clusters.pb.validate.go deleted file mode 100644 index 31abae0515..0000000000 --- a/api/managementpb/dbaas/pxc_clusters.pb.validate.go +++ /dev/null @@ -1,2547 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: managementpb/dbaas/pxc_clusters.proto - -package dbaasv1beta1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on PXCClusterParams with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *PXCClusterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PXCClusterParams with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// PXCClusterParamsMultiError, or nil if none found. -func (m *PXCClusterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *PXCClusterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ClusterSize - - if all { - switch v := interface{}(m.GetPxc()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PXCClusterParamsValidationError{ - field: "Pxc", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PXCClusterParamsValidationError{ - field: "Pxc", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPxc()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PXCClusterParamsValidationError{ - field: "Pxc", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetProxysql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PXCClusterParamsValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PXCClusterParamsValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetProxysql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PXCClusterParamsValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetHaproxy()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PXCClusterParamsValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PXCClusterParamsValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetHaproxy()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PXCClusterParamsValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetBackup()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PXCClusterParamsValidationError{ - field: "Backup", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PXCClusterParamsValidationError{ - field: "Backup", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetBackup()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PXCClusterParamsValidationError{ - field: "Backup", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetRestore()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PXCClusterParamsValidationError{ - field: "Restore", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PXCClusterParamsValidationError{ - field: "Restore", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetRestore()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PXCClusterParamsValidationError{ - field: "Restore", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return PXCClusterParamsMultiError(errors) - } - - return nil -} - -// PXCClusterParamsMultiError is an error wrapping multiple validation errors -// returned by PXCClusterParams.ValidateAll() if the designated constraints -// aren't met. -type PXCClusterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PXCClusterParamsMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m PXCClusterParamsMultiError) AllErrors() []error { return m } - -// PXCClusterParamsValidationError is the validation error returned by -// PXCClusterParams.Validate if the designated constraints aren't met. -type PXCClusterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PXCClusterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PXCClusterParamsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PXCClusterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PXCClusterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PXCClusterParamsValidationError) ErrorName() string { return "PXCClusterParamsValidationError" } - -// Error satisfies the builtin error interface -func (e PXCClusterParamsValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sPXCClusterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PXCClusterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PXCClusterParamsValidationError{} - -// Validate checks the field values on GetPXCClusterCredentialsRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *GetPXCClusterCredentialsRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetPXCClusterCredentialsRequest with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// GetPXCClusterCredentialsRequestMultiError, or nil if none found. -func (m *GetPXCClusterCredentialsRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetPXCClusterCredentialsRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := GetPXCClusterCredentialsRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetName()) < 1 { - err := GetPXCClusterCredentialsRequestValidationError{ - field: "Name", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return GetPXCClusterCredentialsRequestMultiError(errors) - } - - return nil -} - -// GetPXCClusterCredentialsRequestMultiError is an error wrapping multiple -// validation errors returned by GetPXCClusterCredentialsRequest.ValidateAll() -// if the designated constraints aren't met. -type GetPXCClusterCredentialsRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetPXCClusterCredentialsRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetPXCClusterCredentialsRequestMultiError) AllErrors() []error { return m } - -// GetPXCClusterCredentialsRequestValidationError is the validation error -// returned by GetPXCClusterCredentialsRequest.Validate if the designated -// constraints aren't met. -type GetPXCClusterCredentialsRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetPXCClusterCredentialsRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetPXCClusterCredentialsRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetPXCClusterCredentialsRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetPXCClusterCredentialsRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetPXCClusterCredentialsRequestValidationError) ErrorName() string { - return "GetPXCClusterCredentialsRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetPXCClusterCredentialsRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetPXCClusterCredentialsRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetPXCClusterCredentialsRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetPXCClusterCredentialsRequestValidationError{} - -// Validate checks the field values on PXCClusterConnectionCredentials with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *PXCClusterConnectionCredentials) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PXCClusterConnectionCredentials with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// PXCClusterConnectionCredentialsMultiError, or nil if none found. -func (m *PXCClusterConnectionCredentials) ValidateAll() error { - return m.validate(true) -} - -func (m *PXCClusterConnectionCredentials) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Username - - // no validation rules for Password - - // no validation rules for Host - - // no validation rules for Port - - if len(errors) > 0 { - return PXCClusterConnectionCredentialsMultiError(errors) - } - - return nil -} - -// PXCClusterConnectionCredentialsMultiError is an error wrapping multiple -// validation errors returned by PXCClusterConnectionCredentials.ValidateAll() -// if the designated constraints aren't met. -type PXCClusterConnectionCredentialsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PXCClusterConnectionCredentialsMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m PXCClusterConnectionCredentialsMultiError) AllErrors() []error { return m } - -// PXCClusterConnectionCredentialsValidationError is the validation error -// returned by PXCClusterConnectionCredentials.Validate if the designated -// constraints aren't met. -type PXCClusterConnectionCredentialsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PXCClusterConnectionCredentialsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PXCClusterConnectionCredentialsValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PXCClusterConnectionCredentialsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PXCClusterConnectionCredentialsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PXCClusterConnectionCredentialsValidationError) ErrorName() string { - return "PXCClusterConnectionCredentialsValidationError" -} - -// Error satisfies the builtin error interface -func (e PXCClusterConnectionCredentialsValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sPXCClusterConnectionCredentials.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PXCClusterConnectionCredentialsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PXCClusterConnectionCredentialsValidationError{} - -// Validate checks the field values on GetPXCClusterCredentialsResponse with -// the rules defined in the proto definition for this message. If any rules -// are violated, the first error encountered is returned, or nil if there are -// no violations. -func (m *GetPXCClusterCredentialsResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetPXCClusterCredentialsResponse with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// GetPXCClusterCredentialsResponseMultiError, or nil if none found. -func (m *GetPXCClusterCredentialsResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetPXCClusterCredentialsResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetConnectionCredentials()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetPXCClusterCredentialsResponseValidationError{ - field: "ConnectionCredentials", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetPXCClusterCredentialsResponseValidationError{ - field: "ConnectionCredentials", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetConnectionCredentials()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetPXCClusterCredentialsResponseValidationError{ - field: "ConnectionCredentials", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return GetPXCClusterCredentialsResponseMultiError(errors) - } - - return nil -} - -// GetPXCClusterCredentialsResponseMultiError is an error wrapping multiple -// validation errors returned by -// GetPXCClusterCredentialsResponse.ValidateAll() if the designated -// constraints aren't met. -type GetPXCClusterCredentialsResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetPXCClusterCredentialsResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetPXCClusterCredentialsResponseMultiError) AllErrors() []error { return m } - -// GetPXCClusterCredentialsResponseValidationError is the validation error -// returned by GetPXCClusterCredentialsResponse.Validate if the designated -// constraints aren't met. -type GetPXCClusterCredentialsResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetPXCClusterCredentialsResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetPXCClusterCredentialsResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetPXCClusterCredentialsResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetPXCClusterCredentialsResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetPXCClusterCredentialsResponseValidationError) ErrorName() string { - return "GetPXCClusterCredentialsResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetPXCClusterCredentialsResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetPXCClusterCredentialsResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetPXCClusterCredentialsResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetPXCClusterCredentialsResponseValidationError{} - -// Validate checks the field values on CreatePXCClusterRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *CreatePXCClusterRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CreatePXCClusterRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// CreatePXCClusterRequestMultiError, or nil if none found. -func (m *CreatePXCClusterRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *CreatePXCClusterRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := CreatePXCClusterRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Name - - if all { - switch v := interface{}(m.GetParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CreatePXCClusterRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CreatePXCClusterRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CreatePXCClusterRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Expose - - // no validation rules for InternetFacing - - if all { - switch v := interface{}(m.GetTemplate()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, CreatePXCClusterRequestValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, CreatePXCClusterRequestValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTemplate()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return CreatePXCClusterRequestValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return CreatePXCClusterRequestMultiError(errors) - } - - return nil -} - -// CreatePXCClusterRequestMultiError is an error wrapping multiple validation -// errors returned by CreatePXCClusterRequest.ValidateAll() if the designated -// constraints aren't met. -type CreatePXCClusterRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CreatePXCClusterRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m CreatePXCClusterRequestMultiError) AllErrors() []error { return m } - -// CreatePXCClusterRequestValidationError is the validation error returned by -// CreatePXCClusterRequest.Validate if the designated constraints aren't met. -type CreatePXCClusterRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CreatePXCClusterRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CreatePXCClusterRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CreatePXCClusterRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CreatePXCClusterRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CreatePXCClusterRequestValidationError) ErrorName() string { - return "CreatePXCClusterRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e CreatePXCClusterRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sCreatePXCClusterRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CreatePXCClusterRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CreatePXCClusterRequestValidationError{} - -// Validate checks the field values on CreatePXCClusterResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *CreatePXCClusterResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CreatePXCClusterResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// CreatePXCClusterResponseMultiError, or nil if none found. -func (m *CreatePXCClusterResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *CreatePXCClusterResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return CreatePXCClusterResponseMultiError(errors) - } - - return nil -} - -// CreatePXCClusterResponseMultiError is an error wrapping multiple validation -// errors returned by CreatePXCClusterResponse.ValidateAll() if the designated -// constraints aren't met. -type CreatePXCClusterResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CreatePXCClusterResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m CreatePXCClusterResponseMultiError) AllErrors() []error { return m } - -// CreatePXCClusterResponseValidationError is the validation error returned by -// CreatePXCClusterResponse.Validate if the designated constraints aren't met. -type CreatePXCClusterResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CreatePXCClusterResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CreatePXCClusterResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CreatePXCClusterResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CreatePXCClusterResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CreatePXCClusterResponseValidationError) ErrorName() string { - return "CreatePXCClusterResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e CreatePXCClusterResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sCreatePXCClusterResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CreatePXCClusterResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CreatePXCClusterResponseValidationError{} - -// Validate checks the field values on UpdatePXCClusterRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *UpdatePXCClusterRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UpdatePXCClusterRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// UpdatePXCClusterRequestMultiError, or nil if none found. -func (m *UpdatePXCClusterRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdatePXCClusterRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := UpdatePXCClusterRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetName()) < 1 { - err := UpdatePXCClusterRequestValidationError{ - field: "Name", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdatePXCClusterRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UpdatePXCClusterRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UpdatePXCClusterRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Expose - - // no validation rules for InternetFacing - - if all { - switch v := interface{}(m.GetTemplate()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdatePXCClusterRequestValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UpdatePXCClusterRequestValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetTemplate()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UpdatePXCClusterRequestValidationError{ - field: "Template", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return UpdatePXCClusterRequestMultiError(errors) - } - - return nil -} - -// UpdatePXCClusterRequestMultiError is an error wrapping multiple validation -// errors returned by UpdatePXCClusterRequest.ValidateAll() if the designated -// constraints aren't met. -type UpdatePXCClusterRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdatePXCClusterRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UpdatePXCClusterRequestMultiError) AllErrors() []error { return m } - -// UpdatePXCClusterRequestValidationError is the validation error returned by -// UpdatePXCClusterRequest.Validate if the designated constraints aren't met. -type UpdatePXCClusterRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdatePXCClusterRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdatePXCClusterRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UpdatePXCClusterRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdatePXCClusterRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdatePXCClusterRequestValidationError) ErrorName() string { - return "UpdatePXCClusterRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdatePXCClusterRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUpdatePXCClusterRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdatePXCClusterRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdatePXCClusterRequestValidationError{} - -// Validate checks the field values on UpdatePXCClusterResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *UpdatePXCClusterResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UpdatePXCClusterResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// UpdatePXCClusterResponseMultiError, or nil if none found. -func (m *UpdatePXCClusterResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdatePXCClusterResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return UpdatePXCClusterResponseMultiError(errors) - } - - return nil -} - -// UpdatePXCClusterResponseMultiError is an error wrapping multiple validation -// errors returned by UpdatePXCClusterResponse.ValidateAll() if the designated -// constraints aren't met. -type UpdatePXCClusterResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdatePXCClusterResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UpdatePXCClusterResponseMultiError) AllErrors() []error { return m } - -// UpdatePXCClusterResponseValidationError is the validation error returned by -// UpdatePXCClusterResponse.Validate if the designated constraints aren't met. -type UpdatePXCClusterResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdatePXCClusterResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdatePXCClusterResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UpdatePXCClusterResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdatePXCClusterResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdatePXCClusterResponseValidationError) ErrorName() string { - return "UpdatePXCClusterResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdatePXCClusterResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUpdatePXCClusterResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdatePXCClusterResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdatePXCClusterResponseValidationError{} - -// Validate checks the field values on GetPXCClusterResourcesRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *GetPXCClusterResourcesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetPXCClusterResourcesRequest with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// GetPXCClusterResourcesRequestMultiError, or nil if none found. -func (m *GetPXCClusterResourcesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetPXCClusterResourcesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if m.GetParams() == nil { - err := GetPXCClusterResourcesRequestValidationError{ - field: "Params", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetParams()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetPXCClusterResourcesRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetPXCClusterResourcesRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetParams()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetPXCClusterResourcesRequestValidationError{ - field: "Params", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return GetPXCClusterResourcesRequestMultiError(errors) - } - - return nil -} - -// GetPXCClusterResourcesRequestMultiError is an error wrapping multiple -// validation errors returned by GetPXCClusterResourcesRequest.ValidateAll() -// if the designated constraints aren't met. -type GetPXCClusterResourcesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetPXCClusterResourcesRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetPXCClusterResourcesRequestMultiError) AllErrors() []error { return m } - -// GetPXCClusterResourcesRequestValidationError is the validation error -// returned by GetPXCClusterResourcesRequest.Validate if the designated -// constraints aren't met. -type GetPXCClusterResourcesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetPXCClusterResourcesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetPXCClusterResourcesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetPXCClusterResourcesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetPXCClusterResourcesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetPXCClusterResourcesRequestValidationError) ErrorName() string { - return "GetPXCClusterResourcesRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e GetPXCClusterResourcesRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetPXCClusterResourcesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetPXCClusterResourcesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetPXCClusterResourcesRequestValidationError{} - -// Validate checks the field values on GetPXCClusterResourcesResponse with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *GetPXCClusterResourcesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetPXCClusterResourcesResponse with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// GetPXCClusterResourcesResponseMultiError, or nil if none found. -func (m *GetPXCClusterResourcesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *GetPXCClusterResourcesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetExpected()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, GetPXCClusterResourcesResponseValidationError{ - field: "Expected", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, GetPXCClusterResourcesResponseValidationError{ - field: "Expected", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetExpected()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return GetPXCClusterResourcesResponseValidationError{ - field: "Expected", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return GetPXCClusterResourcesResponseMultiError(errors) - } - - return nil -} - -// GetPXCClusterResourcesResponseMultiError is an error wrapping multiple -// validation errors returned by GetPXCClusterResourcesResponse.ValidateAll() -// if the designated constraints aren't met. -type GetPXCClusterResourcesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetPXCClusterResourcesResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetPXCClusterResourcesResponseMultiError) AllErrors() []error { return m } - -// GetPXCClusterResourcesResponseValidationError is the validation error -// returned by GetPXCClusterResourcesResponse.Validate if the designated -// constraints aren't met. -type GetPXCClusterResourcesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetPXCClusterResourcesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetPXCClusterResourcesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetPXCClusterResourcesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetPXCClusterResourcesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetPXCClusterResourcesResponseValidationError) ErrorName() string { - return "GetPXCClusterResourcesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e GetPXCClusterResourcesResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetPXCClusterResourcesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetPXCClusterResourcesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetPXCClusterResourcesResponseValidationError{} - -// Validate checks the field values on PXCClusterParams_PXC with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *PXCClusterParams_PXC) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PXCClusterParams_PXC with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// PXCClusterParams_PXCMultiError, or nil if none found. -func (m *PXCClusterParams_PXC) ValidateAll() error { - return m.validate(true) -} - -func (m *PXCClusterParams_PXC) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Image - - if all { - switch v := interface{}(m.GetComputeResources()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PXCClusterParams_PXCValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PXCClusterParams_PXCValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetComputeResources()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PXCClusterParams_PXCValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for DiskSize - - // no validation rules for Configuration - - // no validation rules for StorageClass - - if len(errors) > 0 { - return PXCClusterParams_PXCMultiError(errors) - } - - return nil -} - -// PXCClusterParams_PXCMultiError is an error wrapping multiple validation -// errors returned by PXCClusterParams_PXC.ValidateAll() if the designated -// constraints aren't met. -type PXCClusterParams_PXCMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PXCClusterParams_PXCMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m PXCClusterParams_PXCMultiError) AllErrors() []error { return m } - -// PXCClusterParams_PXCValidationError is the validation error returned by -// PXCClusterParams_PXC.Validate if the designated constraints aren't met. -type PXCClusterParams_PXCValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PXCClusterParams_PXCValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PXCClusterParams_PXCValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PXCClusterParams_PXCValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PXCClusterParams_PXCValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PXCClusterParams_PXCValidationError) ErrorName() string { - return "PXCClusterParams_PXCValidationError" -} - -// Error satisfies the builtin error interface -func (e PXCClusterParams_PXCValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sPXCClusterParams_PXC.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PXCClusterParams_PXCValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PXCClusterParams_PXCValidationError{} - -// Validate checks the field values on PXCClusterParams_ProxySQL with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *PXCClusterParams_ProxySQL) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PXCClusterParams_ProxySQL with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// PXCClusterParams_ProxySQLMultiError, or nil if none found. -func (m *PXCClusterParams_ProxySQL) ValidateAll() error { - return m.validate(true) -} - -func (m *PXCClusterParams_ProxySQL) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Image - - if all { - switch v := interface{}(m.GetComputeResources()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PXCClusterParams_ProxySQLValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PXCClusterParams_ProxySQLValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetComputeResources()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PXCClusterParams_ProxySQLValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for DiskSize - - if len(errors) > 0 { - return PXCClusterParams_ProxySQLMultiError(errors) - } - - return nil -} - -// PXCClusterParams_ProxySQLMultiError is an error wrapping multiple validation -// errors returned by PXCClusterParams_ProxySQL.ValidateAll() if the -// designated constraints aren't met. -type PXCClusterParams_ProxySQLMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PXCClusterParams_ProxySQLMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m PXCClusterParams_ProxySQLMultiError) AllErrors() []error { return m } - -// PXCClusterParams_ProxySQLValidationError is the validation error returned by -// PXCClusterParams_ProxySQL.Validate if the designated constraints aren't met. -type PXCClusterParams_ProxySQLValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PXCClusterParams_ProxySQLValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PXCClusterParams_ProxySQLValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PXCClusterParams_ProxySQLValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PXCClusterParams_ProxySQLValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PXCClusterParams_ProxySQLValidationError) ErrorName() string { - return "PXCClusterParams_ProxySQLValidationError" -} - -// Error satisfies the builtin error interface -func (e PXCClusterParams_ProxySQLValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sPXCClusterParams_ProxySQL.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PXCClusterParams_ProxySQLValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PXCClusterParams_ProxySQLValidationError{} - -// Validate checks the field values on PXCClusterParams_HAProxy with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *PXCClusterParams_HAProxy) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on PXCClusterParams_HAProxy with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// PXCClusterParams_HAProxyMultiError, or nil if none found. -func (m *PXCClusterParams_HAProxy) ValidateAll() error { - return m.validate(true) -} - -func (m *PXCClusterParams_HAProxy) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Image - - if all { - switch v := interface{}(m.GetComputeResources()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, PXCClusterParams_HAProxyValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, PXCClusterParams_HAProxyValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetComputeResources()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return PXCClusterParams_HAProxyValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return PXCClusterParams_HAProxyMultiError(errors) - } - - return nil -} - -// PXCClusterParams_HAProxyMultiError is an error wrapping multiple validation -// errors returned by PXCClusterParams_HAProxy.ValidateAll() if the designated -// constraints aren't met. -type PXCClusterParams_HAProxyMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m PXCClusterParams_HAProxyMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m PXCClusterParams_HAProxyMultiError) AllErrors() []error { return m } - -// PXCClusterParams_HAProxyValidationError is the validation error returned by -// PXCClusterParams_HAProxy.Validate if the designated constraints aren't met. -type PXCClusterParams_HAProxyValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e PXCClusterParams_HAProxyValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e PXCClusterParams_HAProxyValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e PXCClusterParams_HAProxyValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e PXCClusterParams_HAProxyValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e PXCClusterParams_HAProxyValidationError) ErrorName() string { - return "PXCClusterParams_HAProxyValidationError" -} - -// Error satisfies the builtin error interface -func (e PXCClusterParams_HAProxyValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sPXCClusterParams_HAProxy.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = PXCClusterParams_HAProxyValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = PXCClusterParams_HAProxyValidationError{} - -// Validate checks the field values on -// UpdatePXCClusterRequest_UpdatePXCClusterParams with the rules defined in -// the proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *UpdatePXCClusterRequest_UpdatePXCClusterParams) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// UpdatePXCClusterRequest_UpdatePXCClusterParams with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in -// UpdatePXCClusterRequest_UpdatePXCClusterParamsMultiError, or nil if none found. -func (m *UpdatePXCClusterRequest_UpdatePXCClusterParams) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdatePXCClusterRequest_UpdatePXCClusterParams) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for ClusterSize - - if all { - switch v := interface{}(m.GetPxc()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError{ - field: "Pxc", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError{ - field: "Pxc", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPxc()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError{ - field: "Pxc", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetProxysql()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetProxysql()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError{ - field: "Proxysql", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Suspend - - // no validation rules for Resume - - if all { - switch v := interface{}(m.GetHaproxy()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetHaproxy()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError{ - field: "Haproxy", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return UpdatePXCClusterRequest_UpdatePXCClusterParamsMultiError(errors) - } - - return nil -} - -// UpdatePXCClusterRequest_UpdatePXCClusterParamsMultiError is an error -// wrapping multiple validation errors returned by -// UpdatePXCClusterRequest_UpdatePXCClusterParams.ValidateAll() if the -// designated constraints aren't met. -type UpdatePXCClusterRequest_UpdatePXCClusterParamsMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdatePXCClusterRequest_UpdatePXCClusterParamsMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UpdatePXCClusterRequest_UpdatePXCClusterParamsMultiError) AllErrors() []error { return m } - -// UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError is the -// validation error returned by -// UpdatePXCClusterRequest_UpdatePXCClusterParams.Validate if the designated -// constraints aren't met. -type UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError) ErrorName() string { - return "UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUpdatePXCClusterRequest_UpdatePXCClusterParams.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdatePXCClusterRequest_UpdatePXCClusterParamsValidationError{} - -// Validate checks the field values on -// UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC with the rules defined -// in the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in -// UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCMultiError, or nil if -// none found. -func (m *UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetComputeResources()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetComputeResources()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Image - - // no validation rules for Configuration - - // no validation rules for StorageClass - - if len(errors) > 0 { - return UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCMultiError(errors) - } - - return nil -} - -// UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCMultiError is an error -// wrapping multiple validation errors returned by -// UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC.ValidateAll() if the -// designated constraints aren't met. -type UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCMultiError) AllErrors() []error { return m } - -// UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCValidationError is the -// validation error returned by -// UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC.Validate if the -// designated constraints aren't met. -type UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCValidationError) Field() string { - return e.field -} - -// Reason function returns reason value. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCValidationError) Cause() error { - return e.cause -} - -// Key function returns key value. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCValidationError) ErrorName() string { - return "UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUpdatePXCClusterRequest_UpdatePXCClusterParams_PXC.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdatePXCClusterRequest_UpdatePXCClusterParams_PXCValidationError{} - -// Validate checks the field values on -// UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLMultiError, or nil -// if none found. -func (m *UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetComputeResources()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetComputeResources()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLMultiError(errors) - } - - return nil -} - -// UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLMultiError is an -// error wrapping multiple validation errors returned by -// UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL.ValidateAll() if -// the designated constraints aren't met. -type UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLMultiError) AllErrors() []error { - return m -} - -// UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLValidationError is -// the validation error returned by -// UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL.Validate if the -// designated constraints aren't met. -type UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLValidationError) Field() string { - return e.field -} - -// Reason function returns reason value. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLValidationError) Cause() error { - return e.cause -} - -// Key function returns key value. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLValidationError) Key() bool { - return e.key -} - -// ErrorName returns error name. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLValidationError) ErrorName() string { - return "UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQLValidationError{} - -// Validate checks the field values on -// UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyMultiError, or nil if -// none found. -func (m *UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetComputeResources()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetComputeResources()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyValidationError{ - field: "ComputeResources", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyMultiError(errors) - } - - return nil -} - -// UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyMultiError is an error -// wrapping multiple validation errors returned by -// UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy.ValidateAll() if the -// designated constraints aren't met. -type UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyMultiError) AllErrors() []error { - return m -} - -// UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyValidationError is the -// validation error returned by -// UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy.Validate if the -// designated constraints aren't met. -type UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyValidationError) Field() string { - return e.field -} - -// Reason function returns reason value. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyValidationError) Reason() string { - return e.reason -} - -// Cause function returns cause value. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyValidationError) Cause() error { - return e.cause -} - -// Key function returns key value. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyValidationError) Key() bool { - return e.key -} - -// ErrorName returns error name. -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyValidationError) ErrorName() string { - return "UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxyValidationError{} diff --git a/api/managementpb/dbaas/pxc_clusters.proto b/api/managementpb/dbaas/pxc_clusters.proto deleted file mode 100644 index 7883eb8296..0000000000 --- a/api/managementpb/dbaas/pxc_clusters.proto +++ /dev/null @@ -1,215 +0,0 @@ -syntax = "proto3"; - -package dbaas.v1beta1; - -import "google/api/annotations.proto"; -import "managementpb/dbaas/dbaas.proto"; -import "managementpb/dbaas/templates.proto"; -import "validate/validate.proto"; - -option go_package = "api/managementpb/dbaas;dbaasv1beta1"; - -// PXCBackupState represents PXC backup CR state. -enum PXCBackupState { - // PXC_BACKUP_STATE_INVALID represents unknown state. - PXC_BACKUP_STATE_INVALID = 0; - // PXC_BACKUP_STATE_RUNNING represents running backup. - PXC_BACKUP_STATE_RUNNING = 1; - // PXC_BACKUP_STATE_SUCCEEDED represents succeeded backup. - PXC_BACKUP_STATE_SUCCEEDED = 2; - // PXC_BACKUP_STATE_FAILED represents failed backup. - PXC_BACKUP_STATE_FAILED = 3; -} - -// PXCClusterParams represents PXC cluster parameters that can be updated. -message PXCClusterParams { - // PXC container parameters. - // TODO Do not use inner messages in all public APIs (for consistency). - message PXC { - // Docker image used for PXC. - string image = 3; - // Requested compute resources. - ComputeResources compute_resources = 1; - // Disk size in bytes. - int64 disk_size = 2; - // Configuration for PXC cluster - string configuration = 4; - // Storage Class for PXC cluster. - string storage_class = 5; - } - // ProxySQL container parameters. - // TODO Do not use inner messages in all public APIs (for consistency). - message ProxySQL { - // Docker image used for ProxySQL. - string image = 3; - // Requested compute resources. - ComputeResources compute_resources = 1; - // Disk size in bytes. - int64 disk_size = 2; - } - // HAProxy container parameters. - // NOTE: HAProxy does not need disk size as ProxySQL does because the container does not require it. - message HAProxy { - // Docker image used for HAProxy. - string image = 1; - // Requested compute resources. - ComputeResources compute_resources = 2; - } - // Cluster size. - int32 cluster_size = 1; - // PXC container parameters. - PXC pxc = 2; - // NOTE: Only one of fields proxysql or haproxy has to be set, we check this in the code. - // ProxySQL container parameters. - ProxySQL proxysql = 3; - // HAProxy container parameters. - HAProxy haproxy = 4; - // Backup configuration parameters. - Backup backup = 5; - // Restore configuration parameters. - Restore restore = 6; -} - -message GetPXCClusterCredentialsRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; - // PXC cluster name. - string name = 2 [(validate.rules).string.min_len = 1]; -} - -// PXCClusterConnectionCredentials is cluster connection credentials. -message PXCClusterConnectionCredentials { - // PXC username. - string username = 1; - // PXC password. - string password = 2; - // PXC host. - string host = 3; - // PXC port. - int32 port = 4; -} - -message GetPXCClusterCredentialsResponse { - // Cluster connection credentials. - PXCClusterConnectionCredentials connection_credentials = 1; -} - -message CreatePXCClusterRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; - // PXC cluster name. - // a DNS-1035 label must consist of lower case alphanumeric characters or '-', - // start with an alphabetic character, and end with an alphanumeric character - // (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?') - string name = 2; - // Cluster parameters. - PXCClusterParams params = 3; - // Make DB cluster accessible outside of K8s cluster. - bool expose = 4; - // Make DB cluster accessible via public internet. - bool internet_facing = 5; - // Apply IP source ranges against the cluster. - repeated string source_ranges = 6; - // Configuration template. - Template template = 7; -} - -message CreatePXCClusterResponse {} - -message UpdatePXCClusterRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; - // PXC cluster name. - string name = 2 [(validate.rules).string.min_len = 1]; - // UpdatePXCClusterParams represents PXC cluster parameters that can be updated. - message UpdatePXCClusterParams { - // PXC container parameters. - message PXC { - // Requested compute resources. - ComputeResources compute_resources = 1; - // Image to use. If it's the same image but with different version tag, upgrade of database cluster to version - // in given tag is triggered. If entirely different image is given, error is returned. - string image = 2; - // Configuration for PXC cluster - string configuration = 4; - // Storage Class for PXC cluster. - string storage_class = 5; - } - // ProxySQL container parameters. - message ProxySQL { - // Requested compute resources. - ComputeResources compute_resources = 1; - } - // HAProxy container parameters. - message HAProxy { - // Requested compute resources. - ComputeResources compute_resources = 1; - } - // Cluster size. - int32 cluster_size = 1; - // PXC container parameters. - PXC pxc = 2; - // ProxySQL container parameters. - ProxySQL proxysql = 3; - // Suspend cluster `pause: true`. - bool suspend = 4; - // Resume cluster `pause: false`. - bool resume = 5; - // HAProxy container parameters. - HAProxy haproxy = 6; - } - // Cluster parameters. - UpdatePXCClusterParams params = 3; - // Make DB cluster accessible outside of K8s cluster. - bool expose = 4; - // Make DB cluster accessible via public internet. - bool internet_facing = 5; - // Apply IP source ranges against the cluster. - repeated string source_ranges = 6; - // Configuration template. - Template template = 7; -} - -message UpdatePXCClusterResponse {} - -message GetPXCClusterResourcesRequest { - // Cluster parameters. - PXCClusterParams params = 1 [(validate.rules).message.required = true]; -} - -message GetPXCClusterResourcesResponse { - // Expected resources to be consumed by the cluster. - Resources expected = 1; -} - -// PXCClusters service provides public methods for managing PXC clusters. -service PXCClusters { - // GetPXCClusterCredentials returns a PXC cluster credentials by cluster name. - rpc GetPXCClusterCredentials(GetPXCClusterCredentialsRequest) returns (GetPXCClusterCredentialsResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/PXCClusters/GetCredentials" - body: "*" - }; - } - // CreatePXCCluster creates a new PXC cluster. - rpc CreatePXCCluster(CreatePXCClusterRequest) returns (CreatePXCClusterResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/PXCCluster/Create" - body: "*" - }; - } - // UpdatePXCCluster updates existing PXC cluster. - rpc UpdatePXCCluster(UpdatePXCClusterRequest) returns (UpdatePXCClusterResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/PXCCluster/Update" - body: "*" - }; - } - // GetPXCClusterResources returns expected resources to be consumed by the cluster. - rpc GetPXCClusterResources(GetPXCClusterResourcesRequest) returns (GetPXCClusterResourcesResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/PXCCluster/Resources/Get" - body: "*" - }; - } -} diff --git a/api/managementpb/dbaas/pxc_clusters_grpc.pb.go b/api/managementpb/dbaas/pxc_clusters_grpc.pb.go deleted file mode 100644 index 3ebf99803e..0000000000 --- a/api/managementpb/dbaas/pxc_clusters_grpc.pb.go +++ /dev/null @@ -1,231 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: managementpb/dbaas/pxc_clusters.proto - -package dbaasv1beta1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - PXCClusters_GetPXCClusterCredentials_FullMethodName = "/dbaas.v1beta1.PXCClusters/GetPXCClusterCredentials" - PXCClusters_CreatePXCCluster_FullMethodName = "/dbaas.v1beta1.PXCClusters/CreatePXCCluster" - PXCClusters_UpdatePXCCluster_FullMethodName = "/dbaas.v1beta1.PXCClusters/UpdatePXCCluster" - PXCClusters_GetPXCClusterResources_FullMethodName = "/dbaas.v1beta1.PXCClusters/GetPXCClusterResources" -) - -// PXCClustersClient is the client API for PXCClusters service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type PXCClustersClient interface { - // GetPXCClusterCredentials returns a PXC cluster credentials by cluster name. - GetPXCClusterCredentials(ctx context.Context, in *GetPXCClusterCredentialsRequest, opts ...grpc.CallOption) (*GetPXCClusterCredentialsResponse, error) - // CreatePXCCluster creates a new PXC cluster. - CreatePXCCluster(ctx context.Context, in *CreatePXCClusterRequest, opts ...grpc.CallOption) (*CreatePXCClusterResponse, error) - // UpdatePXCCluster updates existing PXC cluster. - UpdatePXCCluster(ctx context.Context, in *UpdatePXCClusterRequest, opts ...grpc.CallOption) (*UpdatePXCClusterResponse, error) - // GetPXCClusterResources returns expected resources to be consumed by the cluster. - GetPXCClusterResources(ctx context.Context, in *GetPXCClusterResourcesRequest, opts ...grpc.CallOption) (*GetPXCClusterResourcesResponse, error) -} - -type pXCClustersClient struct { - cc grpc.ClientConnInterface -} - -func NewPXCClustersClient(cc grpc.ClientConnInterface) PXCClustersClient { - return &pXCClustersClient{cc} -} - -func (c *pXCClustersClient) GetPXCClusterCredentials(ctx context.Context, in *GetPXCClusterCredentialsRequest, opts ...grpc.CallOption) (*GetPXCClusterCredentialsResponse, error) { - out := new(GetPXCClusterCredentialsResponse) - err := c.cc.Invoke(ctx, PXCClusters_GetPXCClusterCredentials_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *pXCClustersClient) CreatePXCCluster(ctx context.Context, in *CreatePXCClusterRequest, opts ...grpc.CallOption) (*CreatePXCClusterResponse, error) { - out := new(CreatePXCClusterResponse) - err := c.cc.Invoke(ctx, PXCClusters_CreatePXCCluster_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *pXCClustersClient) UpdatePXCCluster(ctx context.Context, in *UpdatePXCClusterRequest, opts ...grpc.CallOption) (*UpdatePXCClusterResponse, error) { - out := new(UpdatePXCClusterResponse) - err := c.cc.Invoke(ctx, PXCClusters_UpdatePXCCluster_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *pXCClustersClient) GetPXCClusterResources(ctx context.Context, in *GetPXCClusterResourcesRequest, opts ...grpc.CallOption) (*GetPXCClusterResourcesResponse, error) { - out := new(GetPXCClusterResourcesResponse) - err := c.cc.Invoke(ctx, PXCClusters_GetPXCClusterResources_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// PXCClustersServer is the server API for PXCClusters service. -// All implementations must embed UnimplementedPXCClustersServer -// for forward compatibility -type PXCClustersServer interface { - // GetPXCClusterCredentials returns a PXC cluster credentials by cluster name. - GetPXCClusterCredentials(context.Context, *GetPXCClusterCredentialsRequest) (*GetPXCClusterCredentialsResponse, error) - // CreatePXCCluster creates a new PXC cluster. - CreatePXCCluster(context.Context, *CreatePXCClusterRequest) (*CreatePXCClusterResponse, error) - // UpdatePXCCluster updates existing PXC cluster. - UpdatePXCCluster(context.Context, *UpdatePXCClusterRequest) (*UpdatePXCClusterResponse, error) - // GetPXCClusterResources returns expected resources to be consumed by the cluster. - GetPXCClusterResources(context.Context, *GetPXCClusterResourcesRequest) (*GetPXCClusterResourcesResponse, error) - mustEmbedUnimplementedPXCClustersServer() -} - -// UnimplementedPXCClustersServer must be embedded to have forward compatible implementations. -type UnimplementedPXCClustersServer struct{} - -func (UnimplementedPXCClustersServer) GetPXCClusterCredentials(context.Context, *GetPXCClusterCredentialsRequest) (*GetPXCClusterCredentialsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetPXCClusterCredentials not implemented") -} - -func (UnimplementedPXCClustersServer) CreatePXCCluster(context.Context, *CreatePXCClusterRequest) (*CreatePXCClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreatePXCCluster not implemented") -} - -func (UnimplementedPXCClustersServer) UpdatePXCCluster(context.Context, *UpdatePXCClusterRequest) (*UpdatePXCClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdatePXCCluster not implemented") -} - -func (UnimplementedPXCClustersServer) GetPXCClusterResources(context.Context, *GetPXCClusterResourcesRequest) (*GetPXCClusterResourcesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetPXCClusterResources not implemented") -} -func (UnimplementedPXCClustersServer) mustEmbedUnimplementedPXCClustersServer() {} - -// UnsafePXCClustersServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to PXCClustersServer will -// result in compilation errors. -type UnsafePXCClustersServer interface { - mustEmbedUnimplementedPXCClustersServer() -} - -func RegisterPXCClustersServer(s grpc.ServiceRegistrar, srv PXCClustersServer) { - s.RegisterService(&PXCClusters_ServiceDesc, srv) -} - -func _PXCClusters_GetPXCClusterCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetPXCClusterCredentialsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PXCClustersServer).GetPXCClusterCredentials(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PXCClusters_GetPXCClusterCredentials_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PXCClustersServer).GetPXCClusterCredentials(ctx, req.(*GetPXCClusterCredentialsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PXCClusters_CreatePXCCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreatePXCClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PXCClustersServer).CreatePXCCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PXCClusters_CreatePXCCluster_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PXCClustersServer).CreatePXCCluster(ctx, req.(*CreatePXCClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PXCClusters_UpdatePXCCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdatePXCClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PXCClustersServer).UpdatePXCCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PXCClusters_UpdatePXCCluster_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PXCClustersServer).UpdatePXCCluster(ctx, req.(*UpdatePXCClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _PXCClusters_GetPXCClusterResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetPXCClusterResourcesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PXCClustersServer).GetPXCClusterResources(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PXCClusters_GetPXCClusterResources_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PXCClustersServer).GetPXCClusterResources(ctx, req.(*GetPXCClusterResourcesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// PXCClusters_ServiceDesc is the grpc.ServiceDesc for PXCClusters service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var PXCClusters_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "dbaas.v1beta1.PXCClusters", - HandlerType: (*PXCClustersServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetPXCClusterCredentials", - Handler: _PXCClusters_GetPXCClusterCredentials_Handler, - }, - { - MethodName: "CreatePXCCluster", - Handler: _PXCClusters_CreatePXCCluster_Handler, - }, - { - MethodName: "UpdatePXCCluster", - Handler: _PXCClusters_UpdatePXCCluster_Handler, - }, - { - MethodName: "GetPXCClusterResources", - Handler: _PXCClusters_GetPXCClusterResources_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "managementpb/dbaas/pxc_clusters.proto", -} diff --git a/api/managementpb/dbaas/templates.pb.go b/api/managementpb/dbaas/templates.pb.go deleted file mode 100644 index 9231f07326..0000000000 --- a/api/managementpb/dbaas/templates.pb.go +++ /dev/null @@ -1,337 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: managementpb/dbaas/templates.proto - -package dbaasv1beta1 - -import ( - reflect "reflect" - sync "sync" - - _ "github.com/envoyproxy/protoc-gen-validate/validate" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Template struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Template CR name. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Template CR kind. - Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` -} - -func (x *Template) Reset() { - *x = Template{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_templates_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Template) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Template) ProtoMessage() {} - -func (x *Template) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_templates_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Template.ProtoReflect.Descriptor instead. -func (*Template) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_templates_proto_rawDescGZIP(), []int{0} -} - -func (x *Template) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Template) GetKind() string { - if x != nil { - return x.Kind - } - return "" -} - -type ListTemplatesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Kubernetes cluster name. - KubernetesClusterName string `protobuf:"bytes,1,opt,name=kubernetes_cluster_name,json=kubernetesClusterName,proto3" json:"kubernetes_cluster_name,omitempty"` - // DB cluster type. - ClusterType DBClusterType `protobuf:"varint,2,opt,name=cluster_type,json=clusterType,proto3,enum=dbaas.v1beta1.DBClusterType" json:"cluster_type,omitempty"` -} - -func (x *ListTemplatesRequest) Reset() { - *x = ListTemplatesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_templates_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListTemplatesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTemplatesRequest) ProtoMessage() {} - -func (x *ListTemplatesRequest) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_templates_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListTemplatesRequest.ProtoReflect.Descriptor instead. -func (*ListTemplatesRequest) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_templates_proto_rawDescGZIP(), []int{1} -} - -func (x *ListTemplatesRequest) GetKubernetesClusterName() string { - if x != nil { - return x.KubernetesClusterName - } - return "" -} - -func (x *ListTemplatesRequest) GetClusterType() DBClusterType { - if x != nil { - return x.ClusterType - } - return DBClusterType_DB_CLUSTER_TYPE_INVALID -} - -type ListTemplatesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Templates []*Template `protobuf:"bytes,1,rep,name=templates,proto3" json:"templates,omitempty"` -} - -func (x *ListTemplatesResponse) Reset() { - *x = ListTemplatesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_managementpb_dbaas_templates_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListTemplatesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTemplatesResponse) ProtoMessage() {} - -func (x *ListTemplatesResponse) ProtoReflect() protoreflect.Message { - mi := &file_managementpb_dbaas_templates_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListTemplatesResponse.ProtoReflect.Descriptor instead. -func (*ListTemplatesResponse) Descriptor() ([]byte, []int) { - return file_managementpb_dbaas_templates_proto_rawDescGZIP(), []int{2} -} - -func (x *ListTemplatesResponse) GetTemplates() []*Template { - if x != nil { - return x.Templates - } - return nil -} - -var File_managementpb_dbaas_templates_proto protoreflect.FileDescriptor - -var file_managementpb_dbaas_templates_proto_rawDesc = []byte{ - 0x0a, 0x22, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x64, - 0x62, 0x61, 0x61, 0x73, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x2f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x32, 0x0a, 0x08, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, - 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0xa2, - 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x17, 0x6b, 0x75, 0x62, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, - 0x01, 0x52, 0x15, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, - 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, - 0x42, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, - 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, - 0x79, 0x70, 0x65, 0x22, 0x4e, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x09, - 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x73, 0x32, 0x98, 0x01, 0x0a, 0x09, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x73, 0x12, 0x8a, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x73, 0x12, 0x23, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x22, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x44, 0x42, 0x61, 0x61, 0x53, 0x2f, - 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x42, 0xb4, - 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x62, 0x61, 0x61, 0x73, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x42, 0x0e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, - 0x64, 0x62, 0x61, 0x61, 0x73, 0x3b, 0x64, 0x62, 0x61, 0x61, 0x73, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x44, 0x62, 0x61, 0x61, 0x73, - 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x0d, 0x44, 0x62, 0x61, 0x61, 0x73, - 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x19, 0x44, 0x62, 0x61, 0x61, 0x73, - 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x44, 0x62, 0x61, 0x61, 0x73, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_managementpb_dbaas_templates_proto_rawDescOnce sync.Once - file_managementpb_dbaas_templates_proto_rawDescData = file_managementpb_dbaas_templates_proto_rawDesc -) - -func file_managementpb_dbaas_templates_proto_rawDescGZIP() []byte { - file_managementpb_dbaas_templates_proto_rawDescOnce.Do(func() { - file_managementpb_dbaas_templates_proto_rawDescData = protoimpl.X.CompressGZIP(file_managementpb_dbaas_templates_proto_rawDescData) - }) - return file_managementpb_dbaas_templates_proto_rawDescData -} - -var ( - file_managementpb_dbaas_templates_proto_msgTypes = make([]protoimpl.MessageInfo, 3) - file_managementpb_dbaas_templates_proto_goTypes = []interface{}{ - (*Template)(nil), // 0: dbaas.v1beta1.Template - (*ListTemplatesRequest)(nil), // 1: dbaas.v1beta1.ListTemplatesRequest - (*ListTemplatesResponse)(nil), // 2: dbaas.v1beta1.ListTemplatesResponse - (DBClusterType)(0), // 3: dbaas.v1beta1.DBClusterType - } -) - -var file_managementpb_dbaas_templates_proto_depIdxs = []int32{ - 3, // 0: dbaas.v1beta1.ListTemplatesRequest.cluster_type:type_name -> dbaas.v1beta1.DBClusterType - 0, // 1: dbaas.v1beta1.ListTemplatesResponse.templates:type_name -> dbaas.v1beta1.Template - 1, // 2: dbaas.v1beta1.Templates.ListTemplates:input_type -> dbaas.v1beta1.ListTemplatesRequest - 2, // 3: dbaas.v1beta1.Templates.ListTemplates:output_type -> dbaas.v1beta1.ListTemplatesResponse - 3, // [3:4] is the sub-list for method output_type - 2, // [2:3] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_managementpb_dbaas_templates_proto_init() } -func file_managementpb_dbaas_templates_proto_init() { - if File_managementpb_dbaas_templates_proto != nil { - return - } - file_managementpb_dbaas_dbaas_proto_init() - if !protoimpl.UnsafeEnabled { - file_managementpb_dbaas_templates_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Template); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_templates_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTemplatesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_managementpb_dbaas_templates_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTemplatesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_managementpb_dbaas_templates_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_managementpb_dbaas_templates_proto_goTypes, - DependencyIndexes: file_managementpb_dbaas_templates_proto_depIdxs, - MessageInfos: file_managementpb_dbaas_templates_proto_msgTypes, - }.Build() - File_managementpb_dbaas_templates_proto = out.File - file_managementpb_dbaas_templates_proto_rawDesc = nil - file_managementpb_dbaas_templates_proto_goTypes = nil - file_managementpb_dbaas_templates_proto_depIdxs = nil -} diff --git a/api/managementpb/dbaas/templates.pb.gw.go b/api/managementpb/dbaas/templates.pb.gw.go deleted file mode 100644 index bf46c4b9ef..0000000000 --- a/api/managementpb/dbaas/templates.pb.gw.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: managementpb/dbaas/templates.proto - -/* -Package dbaasv1beta1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package dbaasv1beta1 - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join -) - -func request_Templates_ListTemplates_0(ctx context.Context, marshaler runtime.Marshaler, client TemplatesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListTemplatesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListTemplates(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err -} - -func local_request_Templates_ListTemplates_0(ctx context.Context, marshaler runtime.Marshaler, server TemplatesServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListTemplatesRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListTemplates(ctx, &protoReq) - return msg, metadata, err -} - -// RegisterTemplatesHandlerServer registers the http handlers for service Templates to "mux". -// UnaryRPC :call TemplatesServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTemplatesHandlerFromEndpoint instead. -func RegisterTemplatesHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TemplatesServer) error { - mux.Handle("POST", pattern_Templates_ListTemplates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/dbaas.v1beta1.Templates/ListTemplates", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Templates/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Templates_ListTemplates_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Templates_ListTemplates_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -// RegisterTemplatesHandlerFromEndpoint is same as RegisterTemplatesHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterTemplatesHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterTemplatesHandler(ctx, mux, conn) -} - -// RegisterTemplatesHandler registers the http handlers for service Templates to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterTemplatesHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterTemplatesHandlerClient(ctx, mux, NewTemplatesClient(conn)) -} - -// RegisterTemplatesHandlerClient registers the http handlers for service Templates -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TemplatesClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TemplatesClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "TemplatesClient" to call the correct interceptors. -func RegisterTemplatesHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TemplatesClient) error { - mux.Handle("POST", pattern_Templates_ListTemplates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/dbaas.v1beta1.Templates/ListTemplates", runtime.WithHTTPPathPattern("/v1/management/DBaaS/Templates/List")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Templates_ListTemplates_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Templates_ListTemplates_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - return nil -} - -var pattern_Templates_ListTemplates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "DBaaS", "Templates", "List"}, "")) - -var forward_Templates_ListTemplates_0 = runtime.ForwardResponseMessage diff --git a/api/managementpb/dbaas/templates.pb.validate.go b/api/managementpb/dbaas/templates.pb.validate.go deleted file mode 100644 index 8c7825d0d4..0000000000 --- a/api/managementpb/dbaas/templates.pb.validate.go +++ /dev/null @@ -1,399 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: managementpb/dbaas/templates.proto - -package dbaasv1beta1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on Template with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *Template) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Template with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in TemplateMultiError, or nil -// if none found. -func (m *Template) ValidateAll() error { - return m.validate(true) -} - -func (m *Template) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Name - - // no validation rules for Kind - - if len(errors) > 0 { - return TemplateMultiError(errors) - } - - return nil -} - -// TemplateMultiError is an error wrapping multiple validation errors returned -// by Template.ValidateAll() if the designated constraints aren't met. -type TemplateMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m TemplateMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m TemplateMultiError) AllErrors() []error { return m } - -// TemplateValidationError is the validation error returned by -// Template.Validate if the designated constraints aren't met. -type TemplateValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e TemplateValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e TemplateValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e TemplateValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e TemplateValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e TemplateValidationError) ErrorName() string { return "TemplateValidationError" } - -// Error satisfies the builtin error interface -func (e TemplateValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sTemplate.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = TemplateValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = TemplateValidationError{} - -// Validate checks the field values on ListTemplatesRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ListTemplatesRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListTemplatesRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ListTemplatesRequestMultiError, or nil if none found. -func (m *ListTemplatesRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListTemplatesRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetKubernetesClusterName()) < 1 { - err := ListTemplatesRequestValidationError{ - field: "KubernetesClusterName", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if _, ok := DBClusterType_name[int32(m.GetClusterType())]; !ok { - err := ListTemplatesRequestValidationError{ - field: "ClusterType", - reason: "value must be one of the defined enum values", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return ListTemplatesRequestMultiError(errors) - } - - return nil -} - -// ListTemplatesRequestMultiError is an error wrapping multiple validation -// errors returned by ListTemplatesRequest.ValidateAll() if the designated -// constraints aren't met. -type ListTemplatesRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListTemplatesRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListTemplatesRequestMultiError) AllErrors() []error { return m } - -// ListTemplatesRequestValidationError is the validation error returned by -// ListTemplatesRequest.Validate if the designated constraints aren't met. -type ListTemplatesRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListTemplatesRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListTemplatesRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListTemplatesRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListTemplatesRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListTemplatesRequestValidationError) ErrorName() string { - return "ListTemplatesRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ListTemplatesRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListTemplatesRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListTemplatesRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListTemplatesRequestValidationError{} - -// Validate checks the field values on ListTemplatesResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ListTemplatesResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListTemplatesResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ListTemplatesResponseMultiError, or nil if none found. -func (m *ListTemplatesResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *ListTemplatesResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetTemplates() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListTemplatesResponseValidationError{ - field: fmt.Sprintf("Templates[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListTemplatesResponseValidationError{ - field: fmt.Sprintf("Templates[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListTemplatesResponseValidationError{ - field: fmt.Sprintf("Templates[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if len(errors) > 0 { - return ListTemplatesResponseMultiError(errors) - } - - return nil -} - -// ListTemplatesResponseMultiError is an error wrapping multiple validation -// errors returned by ListTemplatesResponse.ValidateAll() if the designated -// constraints aren't met. -type ListTemplatesResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListTemplatesResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListTemplatesResponseMultiError) AllErrors() []error { return m } - -// ListTemplatesResponseValidationError is the validation error returned by -// ListTemplatesResponse.Validate if the designated constraints aren't met. -type ListTemplatesResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListTemplatesResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListTemplatesResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListTemplatesResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListTemplatesResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListTemplatesResponseValidationError) ErrorName() string { - return "ListTemplatesResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e ListTemplatesResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListTemplatesResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListTemplatesResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListTemplatesResponseValidationError{} diff --git a/api/managementpb/dbaas/templates.proto b/api/managementpb/dbaas/templates.proto deleted file mode 100644 index 5b66514fd5..0000000000 --- a/api/managementpb/dbaas/templates.proto +++ /dev/null @@ -1,38 +0,0 @@ -syntax = "proto3"; - -package dbaas.v1beta1; - -import "google/api/annotations.proto"; -import "managementpb/dbaas/dbaas.proto"; -import "validate/validate.proto"; - -option go_package = "api/managementpb/dbaas;dbaasv1beta1"; - -message Template { - // Template CR name. - string name = 1; - // Template CR kind. - string kind = 2; -} - -message ListTemplatesRequest { - // Kubernetes cluster name. - string kubernetes_cluster_name = 1 [(validate.rules).string.min_len = 1]; - // DB cluster type. - DBClusterType cluster_type = 2 [(validate.rules).enum.defined_only = true]; -} - -message ListTemplatesResponse { - repeated Template templates = 1; -} - -// Templates service provides public methods for managing templates. -service Templates { - // ListTemplates returns a list of all registered templates. - rpc ListTemplates(ListTemplatesRequest) returns (ListTemplatesResponse) { - option (google.api.http) = { - post: "/v1/management/DBaaS/Templates/List" - body: "*" - }; - } -} diff --git a/api/managementpb/dbaas/templates_grpc.pb.go b/api/managementpb/dbaas/templates_grpc.pb.go deleted file mode 100644 index 08277efe43..0000000000 --- a/api/managementpb/dbaas/templates_grpc.pb.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: managementpb/dbaas/templates.proto - -package dbaasv1beta1 - -import ( - context "context" - - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - Templates_ListTemplates_FullMethodName = "/dbaas.v1beta1.Templates/ListTemplates" -) - -// TemplatesClient is the client API for Templates service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type TemplatesClient interface { - // ListTemplates returns a list of all registered templates. - ListTemplates(ctx context.Context, in *ListTemplatesRequest, opts ...grpc.CallOption) (*ListTemplatesResponse, error) -} - -type templatesClient struct { - cc grpc.ClientConnInterface -} - -func NewTemplatesClient(cc grpc.ClientConnInterface) TemplatesClient { - return &templatesClient{cc} -} - -func (c *templatesClient) ListTemplates(ctx context.Context, in *ListTemplatesRequest, opts ...grpc.CallOption) (*ListTemplatesResponse, error) { - out := new(ListTemplatesResponse) - err := c.cc.Invoke(ctx, Templates_ListTemplates_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// TemplatesServer is the server API for Templates service. -// All implementations must embed UnimplementedTemplatesServer -// for forward compatibility -type TemplatesServer interface { - // ListTemplates returns a list of all registered templates. - ListTemplates(context.Context, *ListTemplatesRequest) (*ListTemplatesResponse, error) - mustEmbedUnimplementedTemplatesServer() -} - -// UnimplementedTemplatesServer must be embedded to have forward compatible implementations. -type UnimplementedTemplatesServer struct{} - -func (UnimplementedTemplatesServer) ListTemplates(context.Context, *ListTemplatesRequest) (*ListTemplatesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListTemplates not implemented") -} -func (UnimplementedTemplatesServer) mustEmbedUnimplementedTemplatesServer() {} - -// UnsafeTemplatesServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to TemplatesServer will -// result in compilation errors. -type UnsafeTemplatesServer interface { - mustEmbedUnimplementedTemplatesServer() -} - -func RegisterTemplatesServer(s grpc.ServiceRegistrar, srv TemplatesServer) { - s.RegisterService(&Templates_ServiceDesc, srv) -} - -func _Templates_ListTemplates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListTemplatesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TemplatesServer).ListTemplates(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Templates_ListTemplates_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TemplatesServer).ListTemplates(ctx, req.(*ListTemplatesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Templates_ServiceDesc is the grpc.ServiceDesc for Templates service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Templates_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "dbaas.v1beta1.Templates", - HandlerType: (*TemplatesServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListTemplates", - Handler: _Templates_ListTemplates_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "managementpb/dbaas/templates.proto", -} diff --git a/api/serverpb/json/client/server/change_settings_responses.go b/api/serverpb/json/client/server/change_settings_responses.go index a1b37f8b1f..2b8002e621 100644 --- a/api/serverpb/json/client/server/change_settings_responses.go +++ b/api/serverpb/json/client/server/change_settings_responses.go @@ -195,12 +195,6 @@ type ChangeSettingsBody struct { // Disable Backup Management. DisableBackupManagement bool `json:"disable_backup_management,omitempty"` - // Enable DBaaS. - EnableDbaas bool `json:"enable_dbaas,omitempty"` - - // Disable DBaaS. - DisableDbaas bool `json:"disable_dbaas,omitempty"` - // Enable Access Control EnableAccessControl bool `json:"enable_access_control,omitempty"` @@ -801,9 +795,6 @@ type ChangeSettingsOKBodySettings struct { // Percona Platform user's email, if this PMM instance is linked to the Platform. PlatformEmail string `json:"platform_email,omitempty"` - // True if DBaaS is enabled. - DbaasEnabled bool `json:"dbaas_enabled,omitempty"` - // True if Alerting is enabled. AlertingEnabled bool `json:"alerting_enabled,omitempty"` diff --git a/api/serverpb/json/client/server/get_settings_responses.go b/api/serverpb/json/client/server/get_settings_responses.go index 706128020b..3d40aa6583 100644 --- a/api/serverpb/json/client/server/get_settings_responses.go +++ b/api/serverpb/json/client/server/get_settings_responses.go @@ -493,9 +493,6 @@ type GetSettingsOKBodySettings struct { // Percona Platform user's email, if this PMM instance is linked to the Platform. PlatformEmail string `json:"platform_email,omitempty"` - // True if DBaaS is enabled. - DbaasEnabled bool `json:"dbaas_enabled,omitempty"` - // True if Alerting is enabled. AlertingEnabled bool `json:"alerting_enabled,omitempty"` diff --git a/api/serverpb/json/serverpb.json b/api/serverpb/json/serverpb.json index 4501cde473..3e58eb1247 100644 --- a/api/serverpb/json/serverpb.json +++ b/api/serverpb/json/serverpb.json @@ -172,7 +172,7 @@ "disable_access_control": { "type": "boolean", "title": "Disable Access Control", - "x-order": 30 + "x-order": 28 }, "disable_alerting": { "description": "Disable Alerting.", @@ -189,11 +189,6 @@ "type": "boolean", "x-order": 26 }, - "disable_dbaas": { - "description": "Disable DBaaS.", - "type": "boolean", - "x-order": 28 - }, "disable_stt": { "description": "Disable Security Threat Tool.", "type": "boolean", @@ -257,7 +252,7 @@ "enable_access_control": { "type": "boolean", "title": "Enable Access Control", - "x-order": 29 + "x-order": 27 }, "enable_alerting": { "description": "Enable Alerting.", @@ -274,11 +269,6 @@ "type": "boolean", "x-order": 25 }, - "enable_dbaas": { - "description": "Enable DBaaS.", - "type": "boolean", - "x-order": 27 - }, "enable_stt": { "description": "Enable Security Threat Tool.", "type": "boolean", @@ -408,7 +398,7 @@ "alerting_enabled": { "description": "True if Alerting is enabled.", "type": "boolean", - "x-order": 11 + "x-order": 10 }, "aws_partitions": { "type": "array", @@ -420,32 +410,27 @@ "azurediscover_enabled": { "description": "True if Azure Discover is enabled.", "type": "boolean", - "x-order": 17 + "x-order": 16 }, "backup_management_enabled": { "description": "True if Backup Management is enabled.", "type": "boolean", - "x-order": 16 + "x-order": 15 }, "connected_to_platform": { "type": "boolean", "title": "True if the PMM instance is connected to Platform", - "x-order": 18 + "x-order": 17 }, "data_retention": { "type": "string", "x-order": 3 }, - "dbaas_enabled": { - "description": "True if DBaaS is enabled.", - "type": "boolean", - "x-order": 10 - }, "default_role_id": { "description": "Default Access Control role ID for new users.", "type": "integer", "format": "int64", - "x-order": 21 + "x-order": 20 }, "email_alerting_settings": { "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", @@ -492,12 +477,12 @@ "x-order": 3 } }, - "x-order": 12 + "x-order": 11 }, "enable_access_control": { "description": "True if Access Control is enabled.", "type": "boolean", - "x-order": 20 + "x-order": 19 }, "metrics_resolutions": { "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", @@ -529,7 +514,7 @@ "pmm_public_address": { "description": "PMM Server public address.", "type": "string", - "x-order": 14 + "x-order": 13 }, "slack_alerting_settings": { "description": "SlackAlertingSettings represents Slack configuration for Alerting.", @@ -541,7 +526,7 @@ "x-order": 0 } }, - "x-order": 13 + "x-order": 12 }, "ssh_key": { "type": "string", @@ -567,7 +552,7 @@ "x-order": 0 } }, - "x-order": 15 + "x-order": 14 }, "stt_enabled": { "description": "True if Security Threat Tool is enabled.", @@ -585,7 +570,7 @@ "items": { "type": "string" }, - "x-order": 19 + "x-order": 18 }, "updates_disabled": { "description": "True if updates are disabled.", @@ -675,7 +660,7 @@ "alerting_enabled": { "description": "True if Alerting is enabled.", "type": "boolean", - "x-order": 11 + "x-order": 10 }, "aws_partitions": { "type": "array", @@ -687,32 +672,27 @@ "azurediscover_enabled": { "description": "True if Azure Discover is enabled.", "type": "boolean", - "x-order": 17 + "x-order": 16 }, "backup_management_enabled": { "description": "True if Backup Management is enabled.", "type": "boolean", - "x-order": 16 + "x-order": 15 }, "connected_to_platform": { "type": "boolean", "title": "True if the PMM instance is connected to Platform", - "x-order": 18 + "x-order": 17 }, "data_retention": { "type": "string", "x-order": 3 }, - "dbaas_enabled": { - "description": "True if DBaaS is enabled.", - "type": "boolean", - "x-order": 10 - }, "default_role_id": { "description": "Default Access Control role ID for new users.", "type": "integer", "format": "int64", - "x-order": 21 + "x-order": 20 }, "email_alerting_settings": { "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", @@ -759,12 +739,12 @@ "x-order": 3 } }, - "x-order": 12 + "x-order": 11 }, "enable_access_control": { "description": "True if Access Control is enabled.", "type": "boolean", - "x-order": 20 + "x-order": 19 }, "metrics_resolutions": { "description": "MetricsResolutions represents Prometheus exporters metrics resolutions.", @@ -796,7 +776,7 @@ "pmm_public_address": { "description": "PMM Server public address.", "type": "string", - "x-order": 14 + "x-order": 13 }, "slack_alerting_settings": { "description": "SlackAlertingSettings represents Slack configuration for Alerting.", @@ -808,7 +788,7 @@ "x-order": 0 } }, - "x-order": 13 + "x-order": 12 }, "ssh_key": { "type": "string", @@ -834,7 +814,7 @@ "x-order": 0 } }, - "x-order": 15 + "x-order": 14 }, "stt_enabled": { "description": "True if Security Threat Tool is enabled.", @@ -852,7 +832,7 @@ "items": { "type": "string" }, - "x-order": 19 + "x-order": 18 }, "updates_disabled": { "description": "True if updates are disabled.", diff --git a/api/serverpb/server.pb.go b/api/serverpb/server.pb.go index 3a3d7a99ec..996fda1cab 100644 --- a/api/serverpb/server.pb.go +++ b/api/serverpb/server.pb.go @@ -1027,8 +1027,6 @@ type Settings struct { SttEnabled bool `protobuf:"varint,9,opt,name=stt_enabled,json=sttEnabled,proto3" json:"stt_enabled,omitempty"` // Percona Platform user's email, if this PMM instance is linked to the Platform. PlatformEmail string `protobuf:"bytes,10,opt,name=platform_email,json=platformEmail,proto3" json:"platform_email,omitempty"` - // True if DBaaS is enabled. - DbaasEnabled bool `protobuf:"varint,11,opt,name=dbaas_enabled,json=dbaasEnabled,proto3" json:"dbaas_enabled,omitempty"` // True if Alerting is enabled. AlertingEnabled bool `protobuf:"varint,12,opt,name=alerting_enabled,json=alertingEnabled,proto3" json:"alerting_enabled,omitempty"` // Alerting email (SMTP) settings. @@ -1155,13 +1153,6 @@ func (x *Settings) GetPlatformEmail() string { return "" } -func (x *Settings) GetDbaasEnabled() bool { - if x != nil { - return x.DbaasEnabled - } - return false -} - func (x *Settings) GetAlertingEnabled() bool { if x != nil { return x.AlertingEnabled @@ -1375,10 +1366,6 @@ type ChangeSettingsRequest struct { EnableBackupManagement bool `protobuf:"varint,24,opt,name=enable_backup_management,json=enableBackupManagement,proto3" json:"enable_backup_management,omitempty"` // Disable Backup Management. DisableBackupManagement bool `protobuf:"varint,25,opt,name=disable_backup_management,json=disableBackupManagement,proto3" json:"disable_backup_management,omitempty"` - // Enable DBaaS. - EnableDbaas bool `protobuf:"varint,26,opt,name=enable_dbaas,json=enableDbaas,proto3" json:"enable_dbaas,omitempty"` - // Disable DBaaS. - DisableDbaas bool `protobuf:"varint,27,opt,name=disable_dbaas,json=disableDbaas,proto3" json:"disable_dbaas,omitempty"` // Enable Access Control EnableAccessControl bool `protobuf:"varint,30,opt,name=enable_access_control,json=enableAccessControl,proto3" json:"enable_access_control,omitempty"` // Disable Access Control @@ -1606,20 +1593,6 @@ func (x *ChangeSettingsRequest) GetDisableBackupManagement() bool { return false } -func (x *ChangeSettingsRequest) GetEnableDbaas() bool { - if x != nil { - return x.EnableDbaas - } - return false -} - -func (x *ChangeSettingsRequest) GetDisableDbaas() bool { - if x != nil { - return x.DisableDbaas - } - return false -} - func (x *ChangeSettingsRequest) GetEnableAccessControl() bool { if x != nil { return x.EnableAccessControl @@ -1988,7 +1961,7 @@ var file_serverpb_server_proto_rawDesc = []byte{ 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x66, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0xfe, 0x08, 0x0a, 0x08, + 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0xd9, 0x08, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x5f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x44, 0x69, 0x73, 0x61, 0x62, @@ -2018,298 +1991,291 @@ var file_serverpb_server_proto_rawDesc = []byte{ 0x52, 0x0a, 0x73, 0x74, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x45, 0x6d, - 0x61, 0x69, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x62, 0x61, 0x61, 0x73, 0x5f, 0x65, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x64, 0x62, 0x61, 0x61, - 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x6c, 0x65, 0x72, - 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x12, 0x55, 0x0a, 0x17, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x61, 0x6c, 0x65, - 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x0d, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x45, 0x6d, - 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x52, 0x15, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, - 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x55, 0x0a, 0x17, 0x73, 0x6c, - 0x61, 0x63, 0x6b, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, - 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x15, 0x73, 0x6c, 0x61, 0x63, - 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x6d, 0x6d, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x70, - 0x6d, 0x6d, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x49, 0x0a, 0x13, 0x73, 0x74, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x54, 0x54, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, - 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x52, 0x11, 0x73, 0x74, 0x74, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x62, 0x61, - 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x62, - 0x61, 0x63, 0x6b, 0x75, 0x70, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x45, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x64, - 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, - 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x63, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x5f, 0x70, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, - 0x2f, 0x0a, 0x13, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x73, 0x75, 0x6d, - 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x74, 0x65, - 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, - 0x12, 0x32, 0x0a, 0x15, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x18, 0x15, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x13, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x26, 0x0a, 0x0f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, - 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x22, 0x14, 0x0a, 0x12, - 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x22, 0x43, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x08, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0xf0, 0x0c, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x73, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, - 0x62, 0x6c, 0x65, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x1d, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x73, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6c, 0x65, - 0x6d, 0x65, 0x74, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x65, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x12, 0x2b, 0x0a, 0x11, - 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, - 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x12, 0x4b, 0x0a, 0x13, 0x6d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x12, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x6c, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x40, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, - 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 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, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x52, - 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x73, 0x68, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x73, 0x68, 0x4b, 0x65, - 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x77, 0x73, 0x50, 0x61, - 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x6c, 0x65, 0x72, - 0x74, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x72, 0x55, 0x72, 0x6c, 0x12, 0x37, 0x0a, 0x18, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x61, - 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x6c, - 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x2e, 0x0a, - 0x13, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x72, - 0x75, 0x6c, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x61, 0x6c, 0x65, 0x72, - 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x3b, 0x0a, - 0x1a, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x17, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x4d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x69, 0x73, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, - 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x0d, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, - 0x69, 0x6e, 0x67, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, - 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x64, - 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x55, + 0x61, 0x69, 0x6c, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x61, + 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x55, 0x0a, 0x17, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, - 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x15, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x43, 0x0a, 0x1e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, - 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1b, 0x72, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, - 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x55, 0x0a, 0x17, 0x73, 0x6c, - 0x61, 0x63, 0x6b, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, - 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x15, 0x73, 0x6c, 0x61, 0x63, - 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x12, 0x43, 0x0a, 0x1e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x73, 0x6c, 0x61, 0x63, - 0x6b, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1b, 0x72, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x53, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x6d, 0x6d, 0x5f, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x13, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x10, 0x70, 0x6d, 0x6d, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x12, 0x39, 0x0a, 0x19, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x70, - 0x6d, 0x6d, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, - 0x6d, 0x6d, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x49, 0x0a, 0x13, 0x73, 0x74, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x54, 0x54, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, - 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x52, 0x11, 0x73, 0x74, 0x74, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x31, 0x0a, 0x14, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x18, 0x16, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x41, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x33, 0x0a, - 0x15, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, - 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x18, 0x17, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x64, 0x69, - 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x12, 0x38, 0x0a, 0x18, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x63, - 0x6b, 0x75, 0x70, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x18, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x3a, 0x0a, 0x19, - 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x19, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x17, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x4d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x5f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x62, 0x61, 0x61, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x64, - 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x64, 0x62, 0x61, 0x61, 0x73, 0x18, 0x1b, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x62, 0x61, 0x61, 0x73, - 0x12, 0x32, 0x0a, 0x15, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x13, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x34, 0x0a, 0x16, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, - 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x18, 0x1f, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x22, 0x46, 0x0a, 0x16, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x55, 0x0a, 0x17, 0x73, 0x6c, 0x61, 0x63, 0x6b, 0x5f, 0x61, + 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, + 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x53, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x15, 0x73, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, + 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2c, 0x0a, 0x12, + 0x70, 0x6d, 0x6d, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x70, 0x6d, 0x6d, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x13, 0x73, 0x74, + 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, + 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x2e, 0x53, 0x54, 0x54, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, + 0x6c, 0x73, 0x52, 0x11, 0x73, 0x74, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x74, 0x65, + 0x72, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, + 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x12, 0x33, 0x0a, 0x15, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x14, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, + 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, + 0x54, 0x6f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x2f, 0x0a, 0x13, 0x74, 0x65, + 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, + 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, + 0x72, 0x79, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x18, 0x15, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, + 0x26, 0x0a, 0x0f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x43, 0x0a, + 0x13, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x73, 0x22, 0x94, 0x01, 0x0a, 0x20, 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, + 0x67, 0x73, 0x22, 0xa8, 0x0c, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0e, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x1c, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x64, 0x69, + 0x73, 0x61, 0x62, 0x6c, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x10, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x65, + 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x12, 0x2b, 0x0a, 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x65, 0x6c, 0x65, 0x6d, + 0x65, 0x74, 0x72, 0x79, 0x12, 0x4b, 0x0a, 0x13, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x5f, + 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x12, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x40, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x04, 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, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x73, 0x68, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x73, 0x68, 0x4b, 0x65, 0x79, 0x12, 0x25, 0x0a, 0x0e, + 0x61, 0x77, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x77, 0x73, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x61, 0x6c, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, + 0x37, 0x0a, 0x18, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x15, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x4d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x2e, 0x0a, 0x13, 0x61, 0x6c, 0x65, 0x72, + 0x74, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x1a, 0x72, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x72, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x73, 0x74, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x53, 0x74, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x73, 0x74, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x53, 0x74, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x29, + 0x0a, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, + 0x6e, 0x67, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x55, 0x0a, 0x17, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, + 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x15, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x55, 0x0a, 0x17, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x12, 0x43, 0x0a, 0x1e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x15, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, - 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x19, - 0x0a, 0x08, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x54, 0x6f, 0x22, 0x23, 0x0a, 0x21, 0x54, 0x65, 0x73, - 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, - 0x0a, 0x17, 0x41, 0x57, 0x53, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0b, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, - 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, - 0x65, 0x49, 0x64, 0x22, 0x1a, 0x0a, 0x18, 0x41, 0x57, 0x53, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, - 0x66, 0x0a, 0x12, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1f, 0x0a, 0x1b, 0x44, 0x49, 0x53, 0x54, 0x52, 0x49, 0x42, - 0x55, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x49, 0x4e, 0x56, - 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x4f, 0x43, 0x4b, 0x45, 0x52, - 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x4f, 0x56, 0x46, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x41, - 0x4d, 0x49, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x5a, 0x55, 0x52, 0x45, 0x10, 0x04, 0x12, - 0x06, 0x0a, 0x02, 0x44, 0x4f, 0x10, 0x05, 0x32, 0xef, 0x0c, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x12, 0x79, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, - 0x92, 0x41, 0x27, 0x12, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x1c, 0x52, 0x65, - 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, - 0x12, 0x0b, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x9e, 0x02, - 0x0a, 0x09, 0x52, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x18, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x52, - 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0xdb, 0x01, 0x92, 0x41, 0xc5, 0x01, 0x12, 0x16, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x72, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x1a, - 0xaa, 0x01, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x63, - 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x62, 0x65, 0x69, 0x6e, 0x67, 0x20, - 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, - 0x74, 0x20, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, 0x79, 0x65, 0x74, 0x2e, 0x20, 0x55, 0x73, 0x65, - 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x41, 0x50, 0x49, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x20, 0x6f, 0x66, 0x20, 0x44, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, - 0x72, 0x6f, 0x62, 0x69, 0x6e, 0x67, 0x20, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, - 0x73, 0x20, 0x72, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x61, 0x64, 0x79, 0x7a, 0x12, 0xa3, - 0x01, 0x0a, 0x0c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, - 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x92, 0x41, 0x39, 0x12, - 0x0d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x1a, 0x28, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, - 0x61, 0x62, 0x6c, 0x65, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, - 0x2a, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x12, 0x90, 0x01, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, - 0x61, 0x72, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0x92, - 0x41, 0x29, 0x12, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x1a, 0x19, 0x53, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x67, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1b, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x55, 0x0a, 0x17, 0x73, 0x6c, 0x61, 0x63, 0x6b, 0x5f, 0x61, + 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, + 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x53, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x15, 0x73, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, + 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x43, 0x0a, 0x1e, + 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x73, 0x6c, 0x61, 0x63, 0x6b, 0x5f, 0x61, 0x6c, 0x65, + 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x12, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x1b, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x6c, 0x61, 0x63, + 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x6d, 0x6d, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x70, + 0x6d, 0x6d, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x39, 0x0a, 0x19, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x70, 0x6d, 0x6d, 0x5f, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x14, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x16, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x6d, 0x6d, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x13, 0x73, 0x74, + 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, + 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x2e, 0x53, 0x54, 0x54, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, + 0x6c, 0x73, 0x52, 0x11, 0x73, 0x74, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x74, 0x65, + 0x72, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x31, 0x0a, 0x14, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x61, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x18, 0x16, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, + 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x15, 0x64, 0x69, 0x73, 0x61, + 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x18, 0x17, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, + 0x41, 0x7a, 0x75, 0x72, 0x65, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x38, 0x0a, + 0x18, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x18, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x16, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x4d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x3a, 0x0a, 0x19, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x19, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x64, 0x69, 0x73, 0x61, + 0x62, 0x6c, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x32, 0x0a, 0x15, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x18, 0x1e, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x13, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x34, 0x0a, 0x16, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x22, 0x46, 0x0a, + 0x16, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x08, 0x73, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x94, 0x01, 0x0a, 0x20, 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, + 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x55, 0x0a, 0x17, 0x65, 0x6d, + 0x61, 0x69, 0x6c, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, + 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x15, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x73, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x74, 0x6f, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x54, 0x6f, 0x22, 0x23, 0x0a, 0x21, + 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, + 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x43, 0x0a, 0x17, 0x41, 0x57, 0x53, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0b, + 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x22, 0x1a, 0x0a, 0x18, 0x41, 0x57, 0x53, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2a, 0x66, 0x0a, 0x12, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1f, 0x0a, 0x1b, 0x44, 0x49, 0x53, 0x54, + 0x52, 0x49, 0x42, 0x55, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, + 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x4f, 0x43, + 0x4b, 0x45, 0x52, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x4f, 0x56, 0x46, 0x10, 0x02, 0x12, 0x07, + 0x0a, 0x03, 0x41, 0x4d, 0x49, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x5a, 0x55, 0x52, 0x45, + 0x10, 0x04, 0x12, 0x06, 0x0a, 0x02, 0x44, 0x4f, 0x10, 0x05, 0x32, 0xef, 0x0c, 0x0a, 0x06, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x79, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x3d, 0x92, 0x41, 0x27, 0x12, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, + 0x1c, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x0d, 0x12, 0x0b, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x9e, 0x02, 0x0a, 0x09, 0x52, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x18, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0xdb, 0x01, 0x92, 0x41, 0xc5, 0x01, 0x12, 0x16, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x72, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, + 0x73, 0x73, 0x1a, 0xaa, 0x01, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x20, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x62, 0x65, 0x69, + 0x6e, 0x67, 0x20, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x20, 0x61, 0x72, 0x65, + 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, 0x79, 0x65, 0x74, 0x2e, 0x20, + 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x41, 0x50, 0x49, 0x20, 0x66, 0x6f, 0x72, + 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x65, + 0x61, 0x6c, 0x74, 0x68, 0x20, 0x6f, 0x66, 0x20, 0x44, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x20, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x66, 0x6f, + 0x72, 0x20, 0x70, 0x72, 0x6f, 0x62, 0x69, 0x6e, 0x67, 0x20, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, + 0x65, 0x74, 0x65, 0x73, 0x20, 0x72, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x2e, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x61, 0x64, 0x79, + 0x7a, 0x12, 0xa3, 0x01, 0x0a, 0x0c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x73, 0x12, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x92, + 0x41, 0x39, 0x12, 0x0d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x73, 0x1a, 0x28, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x76, + 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x73, 0x2f, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x9d, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x73, 0x2f, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x90, 0x01, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x48, 0x92, 0x41, 0x29, 0x12, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x20, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x1a, 0x19, 0x53, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, 0x50, 0x4d, 0x4d, 0x20, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x73, 0x2f, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x9d, 0x01, 0x0a, 0x0c, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x52, 0x92, 0x41, 0x32, 0x12, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, 0x21, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, - 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, - 0x3a, 0x01, 0x2a, 0x22, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, - 0x2f, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x9a, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x1a, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, - 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x52, 0x92, 0x41, 0x34, 0x12, 0x0c, 0x47, 0x65, 0x74, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x1a, 0x24, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, - 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x2f, 0x47, 0x65, 0x74, 0x12, 0xa1, 0x01, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x1d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x92, 0x41, 0x2f, 0x12, 0x0f, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x1a, 0x1c, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x73, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, - 0x3a, 0x01, 0x2a, 0x22, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x2f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x81, 0x02, 0x0a, 0x19, 0x54, 0x65, 0x73, - 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x28, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x52, 0x92, 0x41, 0x32, 0x12, 0x0d, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, 0x21, 0x52, 0x65, 0x74, 0x75, + 0x72, 0x6e, 0x73, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x17, 0x3a, 0x01, 0x2a, 0x22, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x73, 0x2f, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x9a, 0x01, 0x0a, 0x0b, 0x47, + 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x1a, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x52, 0x92, 0x41, 0x34, 0x12, 0x0c, 0x47, 0x65, 0x74, 0x20, 0x73, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x1a, 0x24, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x12, 0xa1, 0x01, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x1d, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x92, 0x41, 0x2f, 0x12, 0x0f, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x1a, + 0x1c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x20, 0x50, 0x4d, 0x4d, 0x20, 0x53, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x18, 0x3a, 0x01, 0x2a, 0x22, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x53, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x81, 0x02, 0x0a, 0x19, 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, - 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x29, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, - 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8e, 0x01, 0x92, 0x41, - 0x5a, 0x12, 0x13, 0x54, 0x65, 0x73, 0x74, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x61, 0x6c, - 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x43, 0x53, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x74, 0x65, - 0x73, 0x74, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x68, 0x65, 0x63, - 0x6b, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x53, 0x4d, 0x54, 0x50, 0x20, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x6d, 0x61, 0x69, - 0x6c, 0x20, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x2b, 0x3a, 0x01, 0x2a, 0x22, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x73, 0x2f, 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, - 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0xaa, 0x01, 0x0a, - 0x10, 0x41, 0x57, 0x53, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x12, 0x1f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x41, 0x57, 0x53, 0x49, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x41, 0x57, 0x53, 0x49, - 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x92, 0x41, 0x31, 0x12, 0x12, 0x41, 0x57, 0x53, 0x20, 0x69, - 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x1a, 0x1b, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x41, 0x57, 0x53, 0x20, 0x45, 0x43, 0x32, 0x20, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x49, 0x44, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, - 0x3a, 0x01, 0x2a, 0x22, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x41, 0x57, 0x53, 0x49, 0x6e, 0x73, 0x74, - 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x42, 0x76, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x42, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 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, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x53, 0x58, - 0x58, 0xaa, 0x02, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0xca, 0x02, 0x06, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0xe2, 0x02, 0x12, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x28, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, + 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, + 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8e, + 0x01, 0x92, 0x41, 0x5a, 0x12, 0x13, 0x54, 0x65, 0x73, 0x74, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x20, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x43, 0x53, 0x65, 0x6e, 0x64, 0x73, + 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x74, 0x6f, 0x20, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x53, 0x4d, 0x54, + 0x50, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, + 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x2b, 0x3a, 0x01, 0x2a, 0x22, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x53, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, + 0x6c, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, + 0xaa, 0x01, 0x0a, 0x10, 0x41, 0x57, 0x53, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x41, 0x57, + 0x53, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x41, + 0x57, 0x53, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x92, 0x41, 0x31, 0x12, 0x12, 0x41, 0x57, + 0x53, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x1a, 0x1b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x41, 0x57, 0x53, 0x20, 0x45, 0x43, 0x32, + 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x49, 0x44, 0x2e, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x19, 0x3a, 0x01, 0x2a, 0x22, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x41, 0x57, 0x53, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x42, 0x76, 0x0a, 0x0a, + 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x42, 0x0b, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 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, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x70, 0x62, 0xa2, 0x02, + 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0xca, 0x02, 0x06, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0xe2, 0x02, 0x12, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/serverpb/server.pb.validate.go b/api/serverpb/server.pb.validate.go index de4247a314..2f6cca9075 100644 --- a/api/serverpb/server.pb.validate.go +++ b/api/serverpb/server.pb.validate.go @@ -2073,8 +2073,6 @@ func (m *Settings) validate(all bool) error { // no validation rules for PlatformEmail - // no validation rules for DbaasEnabled - // no validation rules for AlertingEnabled if all { @@ -2695,10 +2693,6 @@ func (m *ChangeSettingsRequest) validate(all bool) error { // no validation rules for DisableBackupManagement - // no validation rules for EnableDbaas - - // no validation rules for DisableDbaas - // no validation rules for EnableAccessControl // no validation rules for DisableAccessControl diff --git a/api/serverpb/server.proto b/api/serverpb/server.proto index 616b91fd43..445b62b500 100644 --- a/api/serverpb/server.proto +++ b/api/serverpb/server.proto @@ -165,8 +165,6 @@ message Settings { bool stt_enabled = 9; // Percona Platform user's email, if this PMM instance is linked to the Platform. string platform_email = 10; - // True if DBaaS is enabled. - bool dbaas_enabled = 11; // True if Alerting is enabled. bool alerting_enabled = 12; // Alerting email (SMTP) settings. @@ -247,10 +245,6 @@ message ChangeSettingsRequest { bool enable_backup_management = 24; // Disable Backup Management. bool disable_backup_management = 25; - // Enable DBaaS. - bool enable_dbaas = 26; - // Disable DBaaS. - bool disable_dbaas = 27; // Enable Access Control bool enable_access_control = 30; // Disable Access Control diff --git a/api/swagger/swagger-dev.json b/api/swagger/swagger-dev.json index af4af60aaa..613c6b02ff 100644 --- a/api/swagger/swagger-dev.json +++ b/api/swagger/swagger-dev.json @@ -3205,25 +3205,15 @@ "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 - }, "enable_access_control": { "type": "boolean", "title": "Enable Access Control", - "x-order": 29 + "x-order": 27 }, "disable_access_control": { "type": "boolean", "title": "Disable Access Control", - "x-order": 30 + "x-order": 28 } } } @@ -3306,15 +3296,10 @@ "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 + "x-order": 10 }, "email_alerting_settings": { "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", @@ -3361,7 +3346,7 @@ "x-order": 7 } }, - "x-order": 12 + "x-order": 11 }, "slack_alerting_settings": { "description": "SlackAlertingSettings represents Slack configuration for Alerting.", @@ -3373,12 +3358,12 @@ "x-order": 0 } }, - "x-order": 13 + "x-order": 12 }, "pmm_public_address": { "description": "PMM Server public address.", "type": "string", - "x-order": 14 + "x-order": 13 }, "stt_check_intervals": { "description": "STTCheckIntervals represents intervals between STT checks.", @@ -3400,22 +3385,22 @@ "x-order": 2 } }, - "x-order": 15 + "x-order": 14 }, "backup_management_enabled": { "description": "True if Backup Management is enabled.", "type": "boolean", - "x-order": 16 + "x-order": 15 }, "azurediscover_enabled": { "description": "True if Azure Discover is enabled.", "type": "boolean", - "x-order": 17 + "x-order": 16 }, "connected_to_platform": { "type": "boolean", "title": "True if the PMM instance is connected to Platform", - "x-order": 18 + "x-order": 17 }, "telemetry_summaries": { "type": "array", @@ -3423,18 +3408,18 @@ "items": { "type": "string" }, - "x-order": 19 + "x-order": 18 }, "enable_access_control": { "description": "True if Access Control is enabled.", "type": "boolean", - "x-order": 20 + "x-order": 19 }, "default_role_id": { "description": "Default Access Control role ID for new users.", "type": "integer", "format": "int64", - "x-order": 21 + "x-order": 20 } }, "x-order": 0 @@ -3573,15 +3558,10 @@ "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 + "x-order": 10 }, "email_alerting_settings": { "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", @@ -3628,7 +3608,7 @@ "x-order": 7 } }, - "x-order": 12 + "x-order": 11 }, "slack_alerting_settings": { "description": "SlackAlertingSettings represents Slack configuration for Alerting.", @@ -3640,12 +3620,12 @@ "x-order": 0 } }, - "x-order": 13 + "x-order": 12 }, "pmm_public_address": { "description": "PMM Server public address.", "type": "string", - "x-order": 14 + "x-order": 13 }, "stt_check_intervals": { "description": "STTCheckIntervals represents intervals between STT checks.", @@ -3667,22 +3647,22 @@ "x-order": 2 } }, - "x-order": 15 + "x-order": 14 }, "backup_management_enabled": { "description": "True if Backup Management is enabled.", "type": "boolean", - "x-order": 16 + "x-order": 15 }, "azurediscover_enabled": { "description": "True if Azure Discover is enabled.", "type": "boolean", - "x-order": 17 + "x-order": 16 }, "connected_to_platform": { "type": "boolean", "title": "True if the PMM instance is connected to Platform", - "x-order": 18 + "x-order": 17 }, "telemetry_summaries": { "type": "array", @@ -3690,18 +3670,18 @@ "items": { "type": "string" }, - "x-order": 19 + "x-order": 18 }, "enable_access_control": { "description": "True if Access Control is enabled.", "type": "boolean", - "x-order": 20 + "x-order": 19 }, "default_role_id": { "description": "Default Access Control role ID for new users.", "type": "integer", "format": "int64", - "x-order": 21 + "x-order": 20 } }, "x-order": 0 @@ -19085,7 +19065,7 @@ "Agent" ], "summary": "List Agents", - "operationId": "ListAgentsMixin10", + "operationId": "ListAgentsMixin9", "parameters": [ { "description": "Only one of the parameters below must be set.", @@ -19563,13 +19543,14 @@ } } }, - "/v1/management/DBaaS/Backups/List": { + "/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": [ - "DBClusters" + "External" ], - "summary": "ListS3Backups lists backups stored on s3.", - "operationId": "ListS3Backups", + "summary": "Add External Service", + "operationId": "AddExternal", "parameters": [ { "name": "body", @@ -19578,5235 +19559,89 @@ "schema": { "type": "object", "properties": { - "location_id": { + "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", - "title": "Backup Location ID to list backups from", - "x-order": 0 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "backups": { - "description": "Backup list.", - "type": "array", - "items": { - "type": "object", - "properties": { - "key": { - "description": "Key of a filename on s3.", - "type": "string", - "x-order": 0 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", "x-order": 0 }, - "message": { + "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 }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/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.", + "add_node": { + "description": "AddNodeParams holds node params and is used to add new node to inventory while adding new service.", "type": "object", "properties": { - "default_version": { + "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 }, - "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 - } - } - }, + "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": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 + "x-order": 2 }, - "message": { + "address": { + "description": "Node and Exporter access address (DNS name or IP).\naddress always should be passed with add_node.", "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/DBClusters/Get": { - "post": { - "tags": [ - "DBClusters" - ], - "summary": "GetDBCluster returns parameters used to create a database cluster", - "operationId": "GetDBCluster", - "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 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "pxc_cluster": { - "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 - }, - "configuration": { - "type": "string", - "title": "Configuration for PXC cluster", - "x-order": 3 - }, - "storage_class": { - "description": "Storage Class for PXC cluster.", - "type": "string", - "x-order": 4 - } - }, - "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 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 4 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 5 - } - }, - "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 - }, - "internet_facing": { - "description": "Is DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 7 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 8 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 9 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 10 - }, - "template": { - "type": "object", - "properties": { - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - }, - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 11 - } - }, - "x-order": 0 - }, - "psmdb_cluster": { - "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 - }, - "configuration": { - "type": "string", - "title": "Configuration for PSMDB cluster", - "x-order": 2 - }, - "storage_class": { - "description": "Storage Class for PSMDB cluster.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 3 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 4 - } - }, - "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 - }, - "internet_facing": { - "description": "Is DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 7 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 8 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 9 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 10 - }, - "template": { - "type": "object", - "properties": { - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - }, - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 11 - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/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 - }, - "configuration": { - "type": "string", - "title": "Configuration for PXC cluster", - "x-order": 3 - }, - "storage_class": { - "description": "Storage Class for PXC cluster.", - "type": "string", - "x-order": 4 - } - }, - "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 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 4 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 5 - } - }, - "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 - }, - "internet_facing": { - "description": "Is DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 7 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 8 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 9 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 10 - }, - "template": { - "type": "object", - "properties": { - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - }, - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 11 - } - } - }, - "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 - }, - "configuration": { - "type": "string", - "title": "Configuration for PSMDB cluster", - "x-order": 2 - }, - "storage_class": { - "description": "Storage Class for PSMDB cluster.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 3 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 4 - } - }, - "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 - }, - "internet_facing": { - "description": "Is DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 7 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 8 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 9 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 10 - }, - "template": { - "type": "object", - "properties": { - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - }, - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 11 - } - } - }, - "x-order": 1 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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 - }, - "dbaas": { - "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": 2 - } - }, - "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.\n - KUBERNETES_CLUSTER_STATUS_PROVISIONING: KUBERNETES_CLUSTER_STATUS_PROVISIONING represents that Kubernetes cluster is privisioning.", - "type": "string", - "default": "KUBERNETES_CLUSTER_STATUS_INVALID", - "enum": [ - "KUBERNETES_CLUSTER_STATUS_INVALID", - "KUBERNETES_CLUSTER_STATUS_OK", - "KUBERNETES_CLUSTER_STATUS_UNAVAILABLE", - "KUBERNETES_CLUSTER_STATUS_PROVISIONING" - ], - "x-order": 2 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Kubernetes/StorageClasses/List": { - "post": { - "tags": [ - "Kubernetes" - ], - "summary": "ListStorageClasses returns the names of all storage classes available in a Kubernetes cluster.", - "operationId": "ListStorageClasses", - "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": { - "storage_classes": { - "description": "Kubernetes storage classes names.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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 - }, - "configuration": { - "type": "string", - "title": "Configuration for PSMDB cluster", - "x-order": 2 - }, - "storage_class": { - "description": "Storage Class for PSMDB cluster.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 3 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 4 - } - }, - "x-order": 2 - }, - "expose": { - "description": "Make DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 3 - }, - "internet_facing": { - "description": "Make DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 4 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "template": { - "type": "object", - "properties": { - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - }, - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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 - }, - "configuration": { - "type": "string", - "title": "Configuration for PSMDB cluster", - "x-order": 2 - }, - "storage_class": { - "description": "Storage Class for PSMDB cluster.", - "type": "string", - "x-order": 3 - } - }, - "x-order": 1 - }, - "image": { - "description": "Docker image used for PSMDB.", - "type": "string", - "x-order": 2 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 3 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 4 - } - }, - "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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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 - }, - "configuration": { - "type": "string", - "title": "Configuration for PSMDB cluster", - "x-order": 1 - }, - "storage_class": { - "description": "Storage Class for PSMDB cluster.", - "type": "string", - "x-order": 2 - } - }, - "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 - }, - "expose": { - "description": "Make DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 3 - }, - "internet_facing": { - "description": "Make DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 4 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "template": { - "type": "object", - "properties": { - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - }, - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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 - }, - "configuration": { - "type": "string", - "title": "Configuration for PXC cluster", - "x-order": 3 - }, - "storage_class": { - "description": "Storage Class for PXC cluster.", - "type": "string", - "x-order": 4 - } - }, - "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 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 4 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 5 - } - }, - "x-order": 2 - }, - "expose": { - "description": "Make DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 3 - }, - "internet_facing": { - "description": "Make DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 4 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "template": { - "type": "object", - "properties": { - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - }, - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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 - }, - "configuration": { - "type": "string", - "title": "Configuration for PXC cluster", - "x-order": 3 - }, - "storage_class": { - "description": "Storage Class for PXC cluster.", - "type": "string", - "x-order": 4 - } - }, - "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 - }, - "backup": { - "type": "object", - "title": "Backup configuration for a database cluster", - "properties": { - "location_id": { - "description": "Backup Location id of stored backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "keep_copies": { - "description": "Keep copies represents how many copies should retain.", - "type": "integer", - "format": "int32", - "x-order": 1 - }, - "cron_expression": { - "type": "string", - "title": "Cron expression represents cron expression", - "x-order": 2 - }, - "service_account": { - "type": "string", - "title": "Service acccount used for backups", - "x-order": 3 - } - }, - "x-order": 4 - }, - "restore": { - "type": "object", - "title": "Restore represents restoration payload to restore a database cluster from backup", - "properties": { - "location_id": { - "description": "Backup location in PMM.", - "type": "string", - "x-order": 0 - }, - "destination": { - "description": "Destination filename.", - "type": "string", - "x-order": 1 - }, - "secrets_name": { - "description": "K8s Secrets name.", - "type": "string", - "x-order": 2 - } - }, - "x-order": 5 - } - }, - "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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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 - }, - "configuration": { - "type": "string", - "title": "Configuration for PXC cluster", - "x-order": 2 - }, - "storage_class": { - "description": "Storage Class for PXC cluster.", - "type": "string", - "x-order": 3 - } - }, - "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 - }, - "expose": { - "description": "Make DB cluster accessible outside of K8s cluster.", - "type": "boolean", - "x-order": 3 - }, - "internet_facing": { - "description": "Make DB cluster accessible via public internet.", - "type": "boolean", - "x-order": 4 - }, - "source_ranges": { - "description": "Apply IP source ranges against the cluster.", - "type": "array", - "items": { - "type": "string" - }, - "x-order": 5 - }, - "template": { - "type": "object", - "properties": { - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - }, - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - } - }, - "x-order": 6 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/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": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Secrets/List": { - "post": { - "tags": [ - "DBClusters" - ], - "summary": "ListSecrets returns a list of secrets from k8s", - "operationId": "ListSecrets", - "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": { - "secrets": { - "description": "Secret list.", - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Name of a secret", - "x-order": 0 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/v1/management/DBaaS/Templates/List": { - "post": { - "tags": [ - "Templates" - ], - "summary": "ListTemplates returns a list of all registered templates.", - "operationId": "ListTemplates", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "kubernetes_cluster_name": { - "description": "Kubernetes cluster name.", - "type": "string", - "x-order": 0 - }, - "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": 1 - } - } - } - } - ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": { - "templates": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "description": "Template CR name.", - "type": "string", - "x-order": 0 - }, - "kind": { - "description": "Template CR kind.", - "type": "string", - "x-order": 1 - } - } - }, - "x-order": 0 - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "x-order": 0 - }, - "message": { - "type": "string", - "x-order": 1 - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "x-order": 0 - } - }, - "additionalProperties": false - }, - "x-order": 2 - } - } - } - } - } - } - }, - "/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 holds node params and is used to add new node to inventory while adding new service.", - "type": "object", - "properties": { - "node_type": { - "description": "NodeType describes supported Node types.", - "type": "string", - "default": "NODE_TYPE_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 + "x-order": 3 }, "service_name": { "description": "Unique across all Services user-defined name. Required.", @@ -26707,7 +21542,7 @@ "MgmtNode" ], "summary": "Get Node", - "operationId": "GetNodeMixin11", + "operationId": "GetNodeMixin10", "parameters": [ { "name": "body", @@ -26924,7 +21759,7 @@ "MgmtNode" ], "summary": "List Nodes", - "operationId": "ListNodesMixin11", + "operationId": "ListNodesMixin10", "parameters": [ { "name": "body", @@ -30935,7 +25770,7 @@ "MgmtService" ], "summary": "List Services", - "operationId": "ListServicesMixin12", + "operationId": "ListServicesMixin11", "parameters": [ { "name": "body", @@ -31850,7 +26685,7 @@ "Alerting" ], "summary": "ListTemplates returns a list of all collected alert rule templates.", - "operationId": "ListTemplatesMixin6", + "operationId": "ListTemplates", "parameters": [ { "name": "body", @@ -33066,7 +27901,7 @@ "Backups" ], "summary": "GetLogs returns logs from the underlying tools for a backup/restore job.", - "operationId": "GetLogsMixin7", + "operationId": "GetLogs", "parameters": [ { "name": "body", @@ -37769,27 +32604,6 @@ { "name": "Service" }, - { - "name": "Components" - }, - { - "name": "DBClusters" - }, - { - "name": "Kubernetes" - }, - { - "name": "LogsAPI" - }, - { - "name": "PSMDBClusters" - }, - { - "name": "PXCClusters" - }, - { - "name": "Templates" - }, { "name": "Alerts" }, diff --git a/api/swagger/swagger.json b/api/swagger/swagger.json index 13fd52ea88..7f942e85b7 100644 --- a/api/swagger/swagger.json +++ b/api/swagger/swagger.json @@ -361,25 +361,15 @@ "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 - }, "enable_access_control": { "type": "boolean", "title": "Enable Access Control", - "x-order": 29 + "x-order": 27 }, "disable_access_control": { "type": "boolean", "title": "Disable Access Control", - "x-order": 30 + "x-order": 28 } } } @@ -462,15 +452,10 @@ "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 + "x-order": 10 }, "email_alerting_settings": { "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", @@ -517,7 +502,7 @@ "x-order": 7 } }, - "x-order": 12 + "x-order": 11 }, "slack_alerting_settings": { "description": "SlackAlertingSettings represents Slack configuration for Alerting.", @@ -529,12 +514,12 @@ "x-order": 0 } }, - "x-order": 13 + "x-order": 12 }, "pmm_public_address": { "description": "PMM Server public address.", "type": "string", - "x-order": 14 + "x-order": 13 }, "stt_check_intervals": { "description": "STTCheckIntervals represents intervals between STT checks.", @@ -556,22 +541,22 @@ "x-order": 2 } }, - "x-order": 15 + "x-order": 14 }, "backup_management_enabled": { "description": "True if Backup Management is enabled.", "type": "boolean", - "x-order": 16 + "x-order": 15 }, "azurediscover_enabled": { "description": "True if Azure Discover is enabled.", "type": "boolean", - "x-order": 17 + "x-order": 16 }, "connected_to_platform": { "type": "boolean", "title": "True if the PMM instance is connected to Platform", - "x-order": 18 + "x-order": 17 }, "telemetry_summaries": { "type": "array", @@ -579,18 +564,18 @@ "items": { "type": "string" }, - "x-order": 19 + "x-order": 18 }, "enable_access_control": { "description": "True if Access Control is enabled.", "type": "boolean", - "x-order": 20 + "x-order": 19 }, "default_role_id": { "description": "Default Access Control role ID for new users.", "type": "integer", "format": "int64", - "x-order": 21 + "x-order": 20 } }, "x-order": 0 @@ -729,15 +714,10 @@ "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 + "x-order": 10 }, "email_alerting_settings": { "description": "EmailAlertingSettings represents email (SMTP) configuration for Alerting.", @@ -784,7 +764,7 @@ "x-order": 7 } }, - "x-order": 12 + "x-order": 11 }, "slack_alerting_settings": { "description": "SlackAlertingSettings represents Slack configuration for Alerting.", @@ -796,12 +776,12 @@ "x-order": 0 } }, - "x-order": 13 + "x-order": 12 }, "pmm_public_address": { "description": "PMM Server public address.", "type": "string", - "x-order": 14 + "x-order": 13 }, "stt_check_intervals": { "description": "STTCheckIntervals represents intervals between STT checks.", @@ -823,22 +803,22 @@ "x-order": 2 } }, - "x-order": 15 + "x-order": 14 }, "backup_management_enabled": { "description": "True if Backup Management is enabled.", "type": "boolean", - "x-order": 16 + "x-order": 15 }, "azurediscover_enabled": { "description": "True if Azure Discover is enabled.", "type": "boolean", - "x-order": 17 + "x-order": 16 }, "connected_to_platform": { "type": "boolean", "title": "True if the PMM instance is connected to Platform", - "x-order": 18 + "x-order": 17 }, "telemetry_summaries": { "type": "array", @@ -846,18 +826,18 @@ "items": { "type": "string" }, - "x-order": 19 + "x-order": 18 }, "enable_access_control": { "description": "True if Access Control is enabled.", "type": "boolean", - "x-order": 20 + "x-order": 19 }, "default_role_id": { "description": "Default Access Control role ID for new users.", "type": "integer", "format": "int64", - "x-order": 21 + "x-order": 20 } }, "x-order": 0 diff --git a/build/ansible/roles/pmm2-images/tasks/main.yml b/build/ansible/roles/pmm2-images/tasks/main.yml index 6fed510de7..9208e7cd4f 100644 --- a/build/ansible/roles/pmm2-images/tasks/main.yml +++ b/build/ansible/roles/pmm2-images/tasks/main.yml @@ -29,7 +29,7 @@ # local yum repo for building of pmm server docker image in autobuild jobs - name: PMM | Add local YUM repository - when: ansible_virtualization_type == "docker" + when: ansible_virtualization_type == "docker" yum_repository: name: local description: Local YUM repository - x86_64 @@ -158,8 +158,6 @@ - percona-alertmanager - pmm-managed - pmm-update - - dbaas-controller - - dbaas-tools - grafana-db-migrator - pmm-dump - vmproxy diff --git a/build/docker/server/README.md b/build/docker/server/README.md index 9806ab0513..179c2e26f8 100644 --- a/build/docker/server/README.md +++ b/build/docker/server/README.md @@ -36,7 +36,6 @@ You can use these environment variables (-e VAR) when running the Docker image. | ENABLE_ALERTING | Enable integrated alerting | | ENABLE_AZUREDISCOVER | Enable support for discovery of Azure databases | | ENABLE_BACKUP_MANAGEMENT | Enable integrated backup tools | -| ENABLE_DBAAS | Enable DBaaS features | | PMM_PUBLIC_ADDRESS | External IP address or the DNS name on which PMM server is running. | | PMM_DEBUG | Enables a more verbose log level | | PMM_TRACE | Enables a more verbose log level including traceback information | diff --git a/build/packages/rpm/server/SPECS/dbaas-controller.spec b/build/packages/rpm/server/SPECS/dbaas-controller.spec deleted file mode 100644 index 8ad16ffe4f..0000000000 --- a/build/packages/rpm/server/SPECS/dbaas-controller.spec +++ /dev/null @@ -1,59 +0,0 @@ -%undefine _missing_build_ids_terminate_build -%global _dwz_low_mem_die_limit 0 - -# do not strip debug symbols -%global debug_package %{nil} - -# The commit hash gets sed'ed by build-server-rpm script to set a correct version -# see: https://github.com/percona/pmm/blob/main/build/scripts/build-server-rpm#L58 -%global commit 0000000000000000000000000000000000000000 -%define full_pmm_version 2.0.0 - -%global shortcommit %(c=%{commit}; echo ${c:0:7}) -%define build_timestamp %(date -u +"%y%m%d%H%M") -%define release 1 -%define rpm_release %{release}.%{build_timestamp}.%{shortcommit}%{?dist} - -Name: dbaas-controller -# the line below is sed'ed by build-server-rpm script to set a correct version -# see: https://github.com/Percona-Lab/pmm-submodules/blob/PMM-2.0/build/bin/build-server-rpm -Version: %{version} -Release: %{rpm_release} -Summary: Simplified API for managing Percona Kubernetes Operators - -License: AGPLv3 -URL: https://github.com/percona-platform/dbaas-controller -Source0: https://github.com/percona-platform/dbaas-controller/archive/%{commit}/dbaas-controller-%{shortcommit}.tar.gz - -%description -dbaas-controller exposes a simplified API for managing Percona Kubernetes Operators -See the PMM docs for more information. - - -%prep -%setup -q -n dbaas-controller-%{commit} - - -%build -export COMPONENT_VERSION=%{full_pmm_version} -export PMM_RELEASE_VERSION=%{full_pmm_version} -export PMM_RELEASE_FULLCOMMIT=%{commit} -export PMM_RELEASE_BRANCH="" - -make release - -%install -install -d -p %{buildroot}%{_bindir} -install -d -p %{buildroot}%{_sbindir} -install -p -m 0755 bin/dbaas-controller %{buildroot}%{_sbindir}/dbaas-controller - - -%files -%license LICENSE -%doc README.md -%{_sbindir}/dbaas-controller - - -%changelog -* Tue Aug 4 2020 Mykyta Solomko - 2.10.0-1 -- init version diff --git a/build/packages/rpm/server/SPECS/dbaas-tools.spec b/build/packages/rpm/server/SPECS/dbaas-tools.spec deleted file mode 100644 index a7c19d67f6..0000000000 --- a/build/packages/rpm/server/SPECS/dbaas-tools.spec +++ /dev/null @@ -1,89 +0,0 @@ -%undefine _missing_build_ids_terminate_build -%define debug_package %{nil} - -%global commit_aws ea9bcaeb5e62c110fe326d1db58b03a782d4bdd6 -%global shortcommit_aws %(c=%{commit_aws}; echo ${c:0:7}) - -%global commit_k8s ef70d260f3d036fc22b30538576bbf6b36329995 -%global shortcommit_k8s %(c=%{commit_k8s}; echo ${c:0:7}) -%global version_k8s v1.24.12 - -%global install_golang 1 -%global debug_package %{nil} - -%define build_timestamp %(date -u +"%y%m%d%H%M") -%define release 2 -%define rpm_release %{release}.%{build_timestamp}%{?dist} - -Name: dbaas-tools -Version: 0.6.10 -Release: %{rpm_release} -Summary: A set of tools for Percona DBaaS -License: ASL 2.0 -URL: https://github.com/kubernetes-sigs/aws-iam-authenticator -# Git tag can be moved and pointed to different commit hash which may brake reproducibility of the build -# As by using an exact commit hash, we can ensure that each time source will be identical -Source0: https://github.com/kubernetes-sigs/aws-iam-authenticator/archive/%{commit_aws}/aws-iam-authenticator-%{shortcommit_aws}.tar.gz -Source1: https://github.com/kubernetes/kubernetes/archive/%{commit_k8s}/kubernetes-%{shortcommit_k8s}.tar.gz - -BuildRequires: which - -%description -%{summary} - -%prep -%setup -T -c -n aws-iam-authenticator-%{commit_aws} -%setup -q -c -a 0 -n aws-iam-authenticator-%{commit_aws} -mkdir -p src/github.com/kubernetes-sigs/ -mv aws-iam-authenticator-%{commit_aws} src/github.com/kubernetes-sigs/aws-iam-authenticator-%{commit_aws} - -%setup -T -c -n kubernetes-%{commit_k8s} -%setup -q -c -a 1 -n kubernetes-%{commit_k8s} -mkdir -p src/github.com/kubernetes/ -mv kubernetes-%{commit_k8s} src/github.com/kubernetes/kubernetes-%{commit_k8s} - -%build -cd %{_builddir}/aws-iam-authenticator-%{commit_aws} -export GOPATH="$(pwd)" -export CGO_ENABLED=0 -export USER=builder - -cd src/github.com/kubernetes-sigs/aws-iam-authenticator-%{commit_aws} -sed -i '/- darwin/d;/- windows/d;/- arm64/d;/dockers:/,+23d' .goreleaser.yaml -make goreleaser - -cd %{_builddir}/kubernetes-%{commit_k8s}/ -export GOPATH="$(pwd)" - -cd src/github.com/kubernetes/kubernetes-%{commit_k8s} -make WHAT="cmd/kubectl" - -%install -cd %{_builddir}/aws-iam-authenticator-%{commit_aws}/src/github.com/kubernetes-sigs/aws-iam-authenticator-%{commit_aws} -install -D -p -m 0755 dist/aws-iam-authenticator_linux_amd64_v1/aws-iam-authenticator %{buildroot}/opt/dbaas-tools/bin/aws-iam-authenticator - -cd %{_builddir}/kubernetes-%{commit_k8s}/src/github.com/kubernetes/kubernetes-%{commit_k8s} -install -D -p -m 0775 _output/local/go/bin/kubectl %{buildroot}/opt/dbaas-tools/bin/kubectl-1.23 - - -%files -/opt/dbaas-tools/bin/aws-iam-authenticator -/opt/dbaas-tools/bin/kubectl-1.23 - -%changelog - -* Mon Jun 12 2023 Nurlan Moldomurov - 0.6.10-1 -- Update versions of aws-iam-authenticator - -* Mon Jun 05 2023 Andrew Minkin - 0.6.2-1 -- Update versions of kubectl and aws-iam-authenticator - -* Mon Nov 21 2022 Alex Tymchuk - 0.5.7-2 -- Fix the double description warning - -* Wed May 04 2022 Nurlan Moldomurov - 0.5.7-1 -- Update versions of dbaas-tools - -* Thu Aug 27 2020 Illia Pshonkin - 0.5.1-1 -- Initial packaging for dbaas-tools - diff --git a/build/scripts/build-server-rpm-all b/build/scripts/build-server-rpm-all index d9cb1a59a2..ab21a205ee 100755 --- a/build/scripts/build-server-rpm-all +++ b/build/scripts/build-server-rpm-all @@ -9,8 +9,6 @@ ${bin_dir}/build-server-rpm percona-dashboards grafana-dashboards ${bin_dir}/build-server-rpm pmm-managed pmm ${bin_dir}/build-server-rpm percona-qan-api2 pmm ${bin_dir}/build-server-rpm pmm-update pmm -${bin_dir}/build-server-rpm dbaas-controller -${bin_dir}/build-server-rpm dbaas-tools ${bin_dir}/build-server-rpm pmm-dump ${bin_dir}/build-server-rpm grafana-db-migrator ${bin_dir}/build-server-rpm vmproxy pmm diff --git a/descriptor.bin b/descriptor.bin index 99e65eae43..053780940b 100644 Binary files a/descriptor.bin and b/descriptor.bin differ diff --git a/docker-compose.yml b/docker-compose.yml index 566c7495d8..642897edc5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,18 +17,11 @@ services: environment: - PMM_RELEASE_PATH=/root/go/bin - REVIEWDOG_GITHUB_API_TOKEN=${REVIEWDOG_GITHUB_API_TOKEN} - - ENABLE_DBAAS=${ENABLE_DBAAS:-0} - AWS_ACCESS_KEY=${AWS_ACCESS_KEY} - AWS_SECRET_KEY=${AWS_SECRET_KEY} - ENABLE_RBAC=${ENABLE_RBAC:-0} - LESS_LOG_NOISE=1 - PERCONA_TEST_VERSION_SERVICE_URL=${PERCONA_TEST_VERSION_SERVICE_URL} - - DBAAS_VM_OP_CHANNEL=${DBAAS_VM_OP_CHANNEL} - - DBAAS_PXC_OP_CHANNEL=${DBAAS_PXC_OP_CHANNEL} - - DBAAS_PSMDB_OP_CHANNEL=${DBAAS_PSMDB_OP_CHANNEL} - - DBAAS_DBAAS_OP_CHANNEL=${DBAAS_DBAAS_OP_CHANNEL} - - DBAAS_ALLOW_UNSUPPORTED_OPERATORS=${DBAAS_ALLOW_UNSUPPORTED_OPERATORS:-0} - - PERCONA_TEST_DBAAS_PMM_CLIENT=${PERCONA_TEST_DBAAS_PMM_CLIENT} # - PERCONA_TEST_PLATFORM_ADDRESS=https://check.localhost # - PERCONA_TEST_PLATFORM_INSECURE=1 # - PERCONA_TEST_PLATFORM_PUBLIC_KEY= @@ -39,7 +32,6 @@ services: # - PERCONA_TEST_PMM_CLICKHOUSE_DATABASE=pmm # - PERCONA_TEST_PMM_CLICKHOUSE_BLOCK_SIZE=10000 # - PERCONA_TEST_PMM_CLICKHOUSE_POOL_SIZE=2 - # - PMM_DEBUG=1 # - PERCONA_TEST_CHECKS_FILE=/srv/checks/local-checks.yml # - PERCONA_TEST_POSTGRES_ADDR=pg # - PERCONA_TEST_POSTGRES_DBNAME=pmm-managed @@ -147,7 +139,6 @@ services: environment: - PMM_RELEASE_PATH=/root/go/bin - REVIEWDOG_GITHUB_API_TOKEN=${REVIEWDOG_GITHUB_API_TOKEN} - - ENABLE_DBAAS=${ENABLE_DBAAS:-0} - AWS_ACCESS_KEY=${AWS_ACCESS_KEY} - AWS_SECRET_KEY=${AWS_SECRET_KEY} - ENABLE_BACKUP_MANAGEMENT=1 @@ -161,9 +152,9 @@ services: - PERCONA_TEST_PMM_CLICKHOUSE_DATABASE=pmm - PERCONA_TEST_PMM_CLICKHOUSE_BLOCK_SIZE=10000 - PERCONA_TEST_PMM_CLICKHOUSE_POOL_SIZE=2 + # - PMM_DEBUG=1 - PMM_VM_URL=${PMM_VM_URL:-http://victoriametrics:8428/} - PMM_DEBUG=1 - - PERCONA_TEST_DBAAS_PMM_CLIENT=perconalab/pmm-client:dev-latest extra_hosts: - host.docker.internal:host-gateway @@ -210,15 +201,15 @@ services: ports: - ${POSTGRES_PORT:-5432}:5432 command: | - postgres - -c shared_preload_libraries=pg_stat_statements - -c pg_stat_statements.max=10000 - -c pg_stat_statements.track=all - -c pg_stat_statements.save=off - -c fsync=off - -c ssl=on - -c ssl_ca_file=/certs/root.crt - -c ssl_cert_file=/certs/server.crt + postgres + -c shared_preload_libraries=pg_stat_statements + -c pg_stat_statements.max=10000 + -c pg_stat_statements.track=all + -c pg_stat_statements.save=off + -c fsync=off + -c ssl=on + -c ssl_ca_file=/certs/root.crt + -c ssl_cert_file=/certs/server.crt -c ssl_key_file=/certs/server.key -c hba_file=/conf/pg_hba.conf networks: diff --git a/docs/api/dbaas.md b/docs/api/dbaas.md deleted file mode 100644 index 08eda78960..0000000000 --- a/docs/api/dbaas.md +++ /dev/null @@ -1,473 +0,0 @@ ---- -slug: 'dbaas' ---- - -## Private DBaaS -Database-as-a-Service (DBaaS) is a managed database that doesn’t need to be installed and maintained but is instead provided as a service to the user. - -A common misconception is that a DBaaS is limited to the public cloud. As many enterprises already have large data centers and heavy investments in hardware, an on-premise DBaaS can also be quite appealing. Keeping the database in-house is often favored when the hardware and resources are already available. In addition, there are extra compliance and security concerns when looking at a public cloud offering. - -The [Percona Monitoring and Management](https://www.percona.com/software/database-tools/percona-monitoring-and-management) (PMM) DBaaS component is a private DBaaS that simplifies and automates [Percona kubernetes operators](https://www.percona.com/software/percona-kubernetes-operators) to created DBs in a Kubernetes cluster. - -It creates and manages DBs such as [Percona XtraDB Cluster](https://www.percona.com/doc/kubernetes-operator-for-pxc/index.html) (PXC) and [Percona Server for MongoDB](https://www.percona.com/doc/kubernetes-operator-for-psmongodb/index.html) (PSMDB) and automates tasks such as: - - Installing the database software - - Configuring the database - - Setting up backups - - Managing upgrades - - Handling failover scenarios - -Read more about DBaaS: -- [DBaaS Documentation](https://docs.percona.com/percona-monitoring-and-management/setting-up/server/dbaas.html) -- [DBaaS blogs](https://www.percona.com/blog/tag/dbaas/) - -## How to configure and use - -To configure and use DBaaS you would need to have PMM deployment and Kubernetes cluster. PMM provides functionality to create and manage DBs and Kubernetes cluster is where those DBs will be running. - -How to get this environment up and running you can read in our [documentation](https://docs.percona.com/percona-monitoring-and-management/setting-up/server/dbaas.html#create-a-kubernetes-cluster). - -PMM provides set of API calls to enable DBaaS, configure it and to create and manage DBs: -- [Change Settings](ref:changesettings) -- [Register Kubernetes Cluster](ref:registerkubernetescluster) -- [Create PXC Cluster](ref:createpxccluster) -- [Create PSMDB Cluster](ref:createpsmdbcluster) - -In this example we would use minikube for the kubernetes cluster and will create a PXC DB cluster, but similar API endpoints exist for the PSMDB. - -### Enabling - -To enable DBaaS, first we need: -- Enable DBaaS in settings. -- Specify the DNS name or public IP address of the pmm-server instance to be able to monitor DB clusters we create in DBaaS and Kubernetes cluster itself. - -It is highly recommended to **use DNS name** instead of IP address but in example bellow we have a dev environment and use IP address instead. - -#### Get Docker container IP and set it as public address - -First of all we should get IP address of PMM (or DNS name should be used and that is recommended). If you are running in local minikube environment you can use following command to get IP address: -```bash -IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pmm-server) -``` -If your kubernetes cluster is located outside of your local system you can get public address by calling `ifconfig`. - -Then to enable DBaaS send request to `Settings/Change` endpoint like below where `IP` is public IP address or DNS name of PMM Server instance. -```bash -curl -X POST "http://localhost/v1/Settings/Change" \ - -H "accept: application/json" \ - -H "authorization: Basic YWRtaW46YWRtaW4=" \ - -H "Content-Type: application/json" \ - -d "{ \"pmm_public_address\": \"${IP}\", \"enable_dbaas\": true }" -``` - -API endpoint used in this step: [Change settings](ref:changesettings). - -### Registering new Kubernetes cluster - -Once kubernetes cluster is created it should be registered in PMM where `my_cluster` is a name of kubernetes cluster which will be used later. `sed` command is used to remove newlines, otherwise this script doesn’t work. -```bash -KUBECONFIG=$(kubectl config view --flatten --minify | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/\\n/g') - -curl -X POST "http://localhost/v1/management/DBaaS/Kubernetes/Register" \ - -H "accept: application/json" \ - -H "authorization: Basic YWRtaW46YWRtaW4=" \ - -d "{ \"kubernetes_cluster_name\": \"my_cluster\", \"kube_auth\": { \"kubeconfig\": \"${KUBECONFIG}\" }}" -``` -This command will register kubernetes cluster, start monitoring of kubernetes cluster and install required kubernetes operators. - -API endpoint used in this step: [RegisterKubernetesCluster](ref:registerkubernetescluster) - -### Get available PXC image names - -To create a PXC cluster, we need to provide the image name for the database instance. -Percona maintains a list of available versions for each component. For example, to retrieve the list of the available PXC components we can call the `Components/GetPXC` API method: - -```bash -curl -X POST "http://localhost/v1/management/DBaaS/Components/GetPXC" \ - -H "accept: application/json" \ - -H "authorization: Basic YWRtaW46YWRtaW4=" \ - -H "Content-Type: application/json" \ - -d "{ \"kubernetes_cluster_name\": \"my_cluster\"}" -``` -Example response: - -```json -{ - "versions": [ - { - "product": "pxc-operator", - "operator": "1.10.0", - "matrix": { - "pxc": { - "8.0.19-10.1": { - "image_path": "percona/percona-xtradb-cluster:8.0.19-10.1", - "image_hash": "1058ae8eded735ebdf664807aad7187942fc9a1170b3fd0369574cb61206b63a", - "status": "available" - }, - "8.0.20-11.1": { - "image_path": "percona/percona-xtradb-cluster:8.0.20-11.1", - "image_hash": "54b1b2f5153b78b05d651034d4603a13e685cbb9b45bfa09a39864fa3f169349", - "status": "available" - }, - "8.0.20-11.2": { - "image_path": "percona/percona-xtradb-cluster:8.0.20-11.2", - "image_hash": "feda5612db18da824e971891d6084465aa9cdc9918c18001cd95ba30916da78b", - "status": "available" - }, - "8.0.21-12.1": { - "image_path": "percona/percona-xtradb-cluster:8.0.21-12.1", - "image_hash": "d95cf39a58f09759408a00b519fe0d0b19c1b28332ece94349dd5e9cdbda017e", - "status": "available" - }, - "8.0.22-13.1": { - "image_path": "percona/percona-xtradb-cluster:8.0.22-13.1", - "image_hash": "1295af1153c1d02e9d40131eb0945b53f7f371796913e64116bf2caa77dc186d", - "status": "available" - }, - "8.0.23-14.1": { - "image_path": "percona/percona-xtradb-cluster:8.0.23-14.1", - "image_hash": "8109f7ca4fc465ba862c08021df12e77b65d384395078e31e270d14b77810d79", - "status": "available" - }, - "8.0.25-15.1": { - "image_path": "percona/percona-xtradb-cluster:8.0.25-15.1", - "image_hash": "529e979c86442429e6feabef9a2d9fc362f4626146f208fbfac704e145a492dd", - "status": "recommended", - "default": true - } - }, - "pmm": { - "2.23.0": { - "image_path": "percona/pmm-client:2.23.0", - "image_hash": "8fa0e45f740fa8564cbfbdf5d9a5507a07e331f8f40ea022d3a64d7278478eac", - "status": "recommended", - "default": true - } - }, - "proxysql": { - "2.0.18": { - "image_path": "percona/percona-xtradb-cluster-operator:1.10.0-proxysql", - "image_hash": "f109a62eb316732d59dd80ed0e013fc9594cbae601586b94023b8c068f7ced7b", - "status": "available" - }, - "2.0.18-2": { - "image_path": "percona/percona-xtradb-cluster-operator:1.10.0-proxysql-8.0.25", - "image_hash": "b84701c47a11c6f5ca46481f25f1b6086c0a30014d05584c7987f1d42a17b584", - "status": "recommended", - "default": true - } - }, - "haproxy": { - "2.3.14": { - "image_path": "percona/percona-xtradb-cluster-operator:1.10.0-haproxy", - "image_hash": "2f06ac4a0f39b2c0253421c3d024291d5ba19d41e35e633ff6ddcf4ba67fd51a", - "status": "available" - }, - "2.3.15": { - "image_path": "percona/percona-xtradb-cluster-operator:1.10.0-haproxy-8.0.25", - "image_hash": "62479be2a21192a3215f03d3f9541decd5ef1737741245ac33ee439915a15128", - "status": "recommended", - "default": true - } - }, - "backup": { - "2.4.24": { - "image_path": "percona/percona-xtradb-cluster-operator:1.10.0-pxc5.7-backup", - "image_hash": "2ff5992220ba251cf064cc2b4d5929e0fdb963db18e35d6c672f9aacb0be3bed", - "status": "available" - }, - "2.4.24-2": { - "image_path": "percona/percona-xtradb-cluster-operator:1.10.0-pxc5.7.35-backup", - "image_hash": "ac9fcd3078107c6492c687eb98215d4e5daf27a02fb3c78ba4b9e9c01f2078b3", - "status": "recommended" - }, - "8.0.23": { - "image_path": "percona/percona-xtradb-cluster-operator:1.10.0-pxc8.0-backup", - "image_hash": "6ab8efb3804d1e519e49ee10eb46b428a837cfdcee222cc5ae2089cc1dc02a6d", - "status": "available" - }, - "8.0.25": { - "image_path": "percona/percona-xtradb-cluster-operator:1.10.0-pxc8.0.25-backup", - "image_hash": "c3991f0959a3b4114d7ff629d9d3cdf0dc200c58443ca8ebb1446d8b1cbe416d", - "status": "recommended", - "default": true - } - }, - "operator": { - "1.10.0": { - "image_path": "percona/percona-xtradb-cluster-operator:1.10.0", - "image_hash": "73d2266258b700a691db6196f4b5c830845d34d57bdef5be5ffbd45e88407309", - "status": "recommended", - "default": true - } - }, - "log_collector": { - "1.10.0": { - "image_path": "percona/percona-xtradb-cluster-operator:1.10.0-1-logcollector", - "image_hash": "8f106b1e9134812b77f4e210ad0fcd7d8d3515a90fe53554d24cd49defc9e044", - "status": "available" - }, - "1.10.0-2": { - "image_path": "percona/percona-xtradb-cluster-operator:1.10.0-logcollector-8.0.25", - "image_hash": "d69dad98900532e2ad6d0bf12c34a148462816fa3ee4697e9b73efef7583901a", - "status": "recommended", - "default": true - } - } - } - } - ] -} -``` - -From this response, choose one of the images in the `pxc` section: -```json - "matrix": { - "pxc": { - "8.0.19-10.1": { - "image_path": "percona/percona-xtradb-cluster:8.0.19-10.1", - "image_hash": "1058ae8eded735ebdf664807aad7187942fc9a1170b3fd0369574cb61206b63a", - "status": "available" - }, - "8.0.20-11.1": { - "image_path": "percona/percona-xtradb-cluster:8.0.20-11.1", - "image_hash": "54b1b2f5153b78b05d651034d4603a13e685cbb9b45bfa09a39864fa3f169349", - "status": "available" - }, -``` - -The chosen `image_path` value is the value you should provide in the next API call as the `image` field. We recommend using the one with `"status": "recommended"` -Example: `"image": "percona/percona-xtradb-cluster:8.0.19-10.1"` - -API endpoint used in this step: [ChangePXCComponents](ref:changepxccomponents). - -### Create PXC Cluster - -Once we registered kubernetes cluster we can use it’s name to create DB Clusters. Here is an example for PXC Cluster, the values for parameters are recomended by Percona: - -```bash -curl -X POST "http://localhost/v1/management/DBaaS/PXCCluster/Create" \ - -H "accept: application/json" \ - -H "authorization: Basic YWRtaW46YWRtaW4=" \ - -H "Content-Type: application/json" \ - -d "{ \"kubernetes_cluster_name\": \"my_cluster\", \"name\": \"my-cluster-1\", \"expose\": true, \"params\": { \"cluster_size\": 3, \"pxc\": { \"compute_resources\": { \"cpu_m\": 1000, \"memory_bytes\": 2000000000 }, \"disk_size\": 25000000000, \"image\": \"percona/percona-xtradb-cluster:8.0.25-15.1\" }, \"haproxy\": { \"compute_resources\": { \"cpu_m\": 1000, \"memory_bytes\": 2000000000 } } } }" -``` - -### Request parameters - -``` -{ - "kubernetes_cluster_name": "string", - "name": "string", - "params": { - "cluster_size": 0, - "pxc": { - "image": "string", - "compute_resources": { - "cpu_m": 0, - "memory_bytes": "string" - }, - "disk_size": "string" - }, - "proxysql": { - "image": "string", - "compute_resources": { - "cpu_m": 0, - "memory_bytes": "string" - }, - "disk_size": "string" - }, - "haproxy": { - "image": "string", - "compute_resources": { - "cpu_m": 0, - "memory_bytes": "string" - } - } - }, - "expose": true -} -``` - - -|Parameter |Description |Notes | -|---------------------------------------|------------------------------------------------|---------------------------------------------------------------------| -|kubernetes_cluster_name |Kubernetes cluster name |Required | -|name |PXC cluster name to create |Default: pxc + DB version + 5 chars random string | -|cluster_size |Cluster size |Default: 3 | -|image |Docker image name |Default is the recommended version from the Percona's version service| -|compute_resources.cpu_m |CPU resources millis |Default: 1000 | -|compute_resources.memory_bytes |Max memory size in bytes |Default: 2 GB | -|disk_size |Max disk size for the PXC instance |Default: 25 GB | -|proxysql.image |Docker image for ProxySQL |Default: empty. (Use operator's default) | -|proxysql.compute_resources.cpu_m |CPU resources millis |Default: 1000 | -|proxysql.compute_resources.memory_bytes|Max memory size in bytes |Default 2 GB | -|proxysql.disk_size |Max disk size for ProxySQL |Default: empty, use operator's default | -|haproxyimage |Docker image for HA Proxy |Default: empty, use operator's default | -|haproxy.compute_resources.cpu_m |CPU resources millis |Default: 1000 | -|haproxy.compute_resources.memory_bytes |Max memory size in bytes |Default: 2 GB | -|expose |Make it available outside the Kubernetes cluster|Default: false | - -**Notes:** -Either ProxySQL or HAProxy should be specified in the request. -Memory bytes are strings because the parameter accepts the unit, like *1 Gi* - -#### Minimum request example - -Since the API has the defaults mentioned above, the HTTP request can have the Kubernetes cluster name as the only parameter. - -Example: - -```bash -curl -X POST "http://localhost/v1/management/DBaaS/PXCCluster/Create" \ - -H "accept: application/json" \ - -H "authorization: Basic YWRtaW46YWRtaW4=" \ - -H "Content-Type: application/json" \ - -d '{ "kubernetes_cluster_name": "my_cluster" }' -``` - -API endpoint used in this step: [CreatePXCCluster](ref:createpxccluster). - -### List Kubernetes clusters - -Once you created PXC cluster you can check the status of the cluster by calling the `List` endpoint. -```bash -curl -X POST "http://localhost/v1/management/DBaaS/DBClusters/List" \ - -H "accept: application/json" \ - -H "authorization: Basic YWRtaW46YWRtaW4=" \ - -H "Content-Type: application/json" \ - -d "{ \"kubernetes_cluster_name\": \"my_cluster\"}" -``` - -Example response: -```json -{ - "pxc_clusters": [ - { - "name": "my-cluster-1", - "state": "DB_CLUSTER_STATE_READY", - "operation": { - "finished_steps": 6, - "total_steps": 6 - }, - "params": { - "cluster_size": 3, - "pxc": { - "compute_resources": { - "cpu_m": 1000, - "memory_bytes": "2000000000" - }, - "disk_size": "25000000000" - }, - "haproxy": { - "compute_resources": { - "cpu_m": 1000, - "memory_bytes": "2000000000" - } - } - }, - "installed_image": "percona/percona-xtradb-cluster:8.0.25-15.1" - } - ] -} -``` -Response contains field `state` which provides current state of DB cluster. `DB_CLUSTER_STATE_READY` means that DB cluster is ready for use. - -API endpoint used in this step: [ListDBClusters](ref:listdbclusters) - -### Get credentials - -Once PXC Cluster is ready we can request credentials to connect to DB. - -```bash -curl -X POST "http://localhost/v1/management/DBaaS/PXCClusters/GetCredentials" \ - -H "accept: application/json" \ - -H "authorization: Basic YWRtaW46YWRtaW4=" \ - -H "Content-Type: application/json" \ - -d "{ \"kubernetes_cluster_name\": \"my_cluster\", \"name\": \"my-cluster-1\"}" -``` -**Example response:** -```json -{ - "connection_credentials": { - "username": "root", - "password": "8fhAK0wjBLcjPncEfJM2r4Ny", - "host": "my-cluster-1-haproxy.default", - "port": 3306 - } -} -``` - -API endpoint used in this step: [GetPXCClusterCredentials](ref:getpxcclustercredentials) - -### Create a PSMDB Cluster - -The PSMDB `Create` endpoint can also set defaults, so creating a PSMDB cluster can be made with a request like this: - -```bash -curl -X POST "http://localhost/v1/management/DBaaS/PSMDBCluster/Create" \ - -H "accept: application/json" \ - -H "authorization: Basic YWRtaW46YWRtaW4=" \ - -H "Content-Type: application/json" \ - -d "{ \"kubernetes_cluster_name\": \"my_cluster\", \"expose\": true}" -``` - -#### Request fields - -```json -{ - "kubernetes_cluster_name": "string", - "name": "string", - "params": { - "cluster_size": 0, - "replicaset": { - "compute_resources": { - "cpu_m": 0, - "memory_bytes": "string" - }, - "disk_size": "string" - }, - "image": "string" - }, - "expose": true -} -``` - -| Field | Description | Notes | -| ----------------------------------------- | ------------------------------------- | ------------------------------------------------------------ | -| kubernetes_cluster_name | Kubernetes cluster name | Required | -| name | PSMDB cluster name | Default: `psmdb`+DB version+5 chars random string | -| cluster_size | Cluster size | Default: 3 | -| replicaset.compute_resources.cpu_m | CPU resources millis | Default: 1000 | -| replicaset.compute_resources.memory_bytes | Max memory size in bytes | Default: 2 GB | -| disk_size | Max disk size | Default: 25 Gb | -| image | PSMDB Docker image | Default is the recommended version from the Percona's version service | -| expose | Expose outside the Kubernetes cluster | Default: false | - -### Delete DB Cluster - -If you don’t need the database cluster you can delete it using the request below. -```bash -curl -X POST "http://localhost/v1/management/DBaaS/DBClusters/Delete" \ - -H "accept: application/json" \ - -H "authorization: Basic YWRtaW46YWRtaW4=" \ - -H "Content-Type: application/json" \ - -d "{ \"kubernetes_cluster_name\": \"my_cluster\", \"name\": \"my-cluster-1\", \"cluster_type\": \"DB_CLUSTER_TYPE_PXC\"}" -``` - -API endpoint used in this step: [DeleteDBCluster deletes](ref:deletedbcluster) - -### Unregister Kubernetes Cluster - -After we played with DBaaS we can unregister kubernetes cluster. - -Unregister a kubernetes cluster doesn’t delete anything, it just removes the cluster from the list of registered clusters and all database clusters will remain active and will send metrics to PMM. - -```bash -curl -X POST "http://localhost/v1/management/DBaaS/Kubernetes/Unregister" \ - -H "accept: application/json" \ - -H "authorization: Basic YWRtaW46YWRtaW4=" \ - -H "Content-Type: application/json" \ - -d "{ \"kubernetes_cluster_name\": \"my_cluster\", \"force\": true}" -``` - -API endpoint used in this step: [UnregisterKubernetesCluster](ref:unregisterkubernetescluster) diff --git a/docs/dbaas/olm.md b/docs/dbaas/olm.md deleted file mode 100644 index b13a27f121..0000000000 --- a/docs/dbaas/olm.md +++ /dev/null @@ -1,118 +0,0 @@ ---- -slug: 'dbaas' ---- - -## How OLM (Operator Lifecycle Manager) works. - -DBaaS leverages the installation and upgrade of operators on OLM. -You must create an operator group and a subscription to install an operator. -The official documentation with detailed examples can be found [here](https://olm.operatorframework.io/docs/tasks/install-operator-with-olm/). - -DBaaS installs the following operators by default: -- OLM -- DBaaS -- PSMDB -- PXC - -You can manually list the subscriptions using kubectl: -``` -kubectl get subscriptions -NAME PACKAGE SOURCE CHANNEL -my-percona-server-mongodb-operator percona-server-mongodb-operator operatorhubio-catalog stable -my-percona-xtradb-cluster-operator percona-xtradb-cluster-operator operatorhubio-catalog stable -``` - -### Known issue -When two or more operators are pending installation approval, OLM creates a second subscription that includes both operators. -will have both operators. Listing the install plans could be confusing. For example: -``` -kubectl get installplans -NAME CSV APPROVAL APPROVED -install-9rxvz percona-server-mongodb-operator.v1.13.1 Manual false -install-mghbh percona-server-mongodb-operator.v1.13.1 Manual false -``` -Although both install plans seem to be for PSMDB, it's worth examining each separately: - -**First install plan** - -``` -kubectl get installplan install-9rxvz -oyaml -apiVersion: operators.coreos.com/v1alpha1 -kind: InstallPlan -metadata: - creationTimestamp: "2023-03-07T12:36:28Z" - generateName: install- - generation: 1 - labels: - operators.coreos.com/percona-server-mongodb-operator.default: "" - name: install-9rxvz - namespace: default - ownerReferences: - - apiVersion: operators.coreos.com/v1alpha1 - blockOwnerDeletion: false - controller: false - kind: Subscription - name: my-percona-server-mongodb-operator - uid: 2581b852-36b3-41e3-92f0-02a4f2ebb05d - resourceVersion: "1037" - uid: d02807a7-3b24-49eb-b12b-63bc1ef817d6 -spec: - approval: Manual - approved: false - clusterServiceVersionNames: - - percona-server-mongodb-operator.v1.13.1 - generation: 1 -``` - -**Second install plan** - -``` -kubectl get installplan install-mghbh -oyaml -apiVersion: operators.coreos.com/v1alpha1 -kind: InstallPlan -metadata: - creationTimestamp: "2023-03-07T12:41:46Z" - generateName: install- - generation: 1 - labels: - operators.coreos.com/percona-xtradb-cluster-operator.default: "" - name: install-mghbh - namespace: default - ownerReferences: - - apiVersion: operators.coreos.com/v1alpha1 - blockOwnerDeletion: false - controller: false - kind: Subscription - name: my-percona-server-mongodb-operator - uid: 2581b852-36b3-41e3-92f0-02a4f2ebb05d - - apiVersion: operators.coreos.com/v1alpha1 - blockOwnerDeletion: false - controller: false - kind: Subscription - name: my-percona-xtradb-cluster-operator - uid: 6796d009-9a29-49b4-af9b-6af09a895317 - resourceVersion: "1314" - uid: f6a87327-1f60-4cae-8b7a-d881c8c522c2 -spec: - approval: Manual - approved: false - clusterServiceVersionNames: - - percona-server-mongodb-operator.v1.13.1 - - percona-xtradb-cluster-operator.v1.12.0 - generation: 2 -``` -Spec section of the second install plan indicates it will handle the installation of both operators: -``` -spec: - approval: Manual - approved: false - clusterServiceVersionNames: - - percona-server-mongodb-operator.v1.13.1 - - percona-xtradb-cluster-operator.v1.12.0 -``` -We can only determine the operators being handled by an install plan if we receive the details in YAML or JSON format.``` - -## Conclusion -The short version `kubectl get installplans` will show only the first operator in the list and this can be confusing and misleading but it is not -a consequence of DBaaS. - diff --git a/docs/proposals/dbaas/01-architecture/current_arch.jpg b/docs/proposals/dbaas/01-architecture/current_arch.jpg deleted file mode 100644 index 2c3b598602..0000000000 Binary files a/docs/proposals/dbaas/01-architecture/current_arch.jpg and /dev/null differ diff --git a/docs/proposals/dbaas/01-architecture/dbaas_catalog.jpg b/docs/proposals/dbaas/01-architecture/dbaas_catalog.jpg deleted file mode 100644 index 0c75533afa..0000000000 Binary files a/docs/proposals/dbaas/01-architecture/dbaas_catalog.jpg and /dev/null differ diff --git a/docs/proposals/dbaas/01-architecture/olm_arch.jpg b/docs/proposals/dbaas/01-architecture/olm_arch.jpg deleted file mode 100644 index 1f61c8a186..0000000000 Binary files a/docs/proposals/dbaas/01-architecture/olm_arch.jpg and /dev/null differ diff --git a/docs/proposals/dbaas/01-architecture/proposal.md b/docs/proposals/dbaas/01-architecture/proposal.md deleted file mode 100644 index 8b14c5fbfb..0000000000 --- a/docs/proposals/dbaas/01-architecture/proposal.md +++ /dev/null @@ -1,628 +0,0 @@ -# Kubernetes-native implementation for PMM/DBaaS - -## Summary - -PMM DBaaS has a lot of functionality to install/manage operators and CRUD operations for either a Percona XtraDB or a Percona Server For MongoDB cluster. However, the current implementation is not extensible enough and lacks scalability features. - -This proposal introduces architectural changes that are required to make DBaaS more extensible and more native for K8S. - -## Motivation - -The current architecture for DBaaS has the following components: - -1. PMM that exposes REST API for UI and some automation -2. DBaaS controller that exposes gRPC API to PMM and works with Kubernetes clusters - -![Current DBaaS architecture](./current_arch.jpg) - -As a proof of concept, this architecture covers everything. However, it has the following issues: - -1. Non-native Kubernetes API to work with clusters. DBaaS controller has only gRPC API and this creates additional friction for community users to work with the controller. One needs to generate a gRPC client to communicate with the DBaaS controller. -2. DBaaS controller has a set of CRUD endpoints for each database type (e.g. PXC and PSMDB). It adds additional room for bugs/inconsistencies and has the following issues: - * There’s no simple and generic API for any database cluster - * PMM needs to make two requests to get a list of created clusters (one for PSMDB and one for PXC clusters). In case we need to add support for another database, DBaaS controller would have an additional set of CRUD endpoints and PMM whould also call the list method for the new database type. - -3. DBaaS controller suffers from insufficient test coverage and integration testing because of the reasons mentioned above. Yet we can create an integration testing framework and increase coverage, but in that case it’ll require a substantial effort. -4. Currently, DBaaS controller has only basic features such as CRUD operators for the database cluster and a lack of backup/restore features and additional configuration. There’s no way to specify additional parameters (Database configuration options, load balancer rules, storage class, backup schedule) -5. DBaaS logic is coupled with PMM release lifecycle. Using operator and OLM we can make DBaaS released independent from PMM release lifecycle. -6. The current implementation requires to implement 5 endpoints to add a new database/operator support (Create, Update, List, Restart, Delete). However, following operator pattern a software engineer needs to implement reconcile logic. -7. Listing database clusters on the current solution has performance issues. Firstly, it requires making one request per database cluster type to list them (e.g. `kubectl get pxc` to get PXC clusters and `kubectl get psmdb` to get PSMDB clusters. For any new database cluster it required to run an additional request against Kubernetes cluster). Secondly, it requires its own implementation of working with client-go caches. Using the operator provides cache integration out-of-the-box and having cr bound to underlying operator's CR (e.g. for PXC and PSMDB) will provide a one call to get all database clusters created. - -Moving to OLM and a DBaaS operator will improve this situation because of the following reasons - -1. It'll be better for the Percona community because the operator pattern as well as OLM are widely spread industry standards. Using standard tools requires no additional learning, hence, better developer/user experience of using the product and contributing to it. From the implementation standpoint we do not need to implemnent custom CLI tools to manage DBaaS/Database clusters because it will be integrated with kubectl. -2. It'll be easier to implement an independent release cycle by removing all hardcoded parameters from PMM and integrating it with dbaas-operator. The dbaas-operator knows about supported databases and it can return available databases engines via `kubectl get dbengines` command -3. DBaaS-operator can be easily added to any other service because it contains everything dbaas-specific such as database configuration templates, supported engines, database cluster sizes and other features. -4. OLM provides a robust way to manage operator lifecycle (Install/Update/Delete operator, resolving conflicts, managind dependencies of one operator from another and so on). It's preinstalled - -## Goals - -1. Make DBaaS Kubernetes native will make it a first-class citizen in the Kubernetes ecosystem. End users can use kubectl to work with PMM/DBaaS to edit/manage database clusters. -2. Provide a simplified way to create templates for a database cluster creation with sane defaults. -3. Reduce the complexity of managing operator's installation/management. OLM will implement lifecycle management for operators and we can drop code that does the same for PMM. - - -## Non-goals - -1. Bloat the size of PMM docker container -2. Overcomplicate the overall development process -3. Change REST API design. It'll be changed by providing an additional proposal - - -## Proposal - -The main idea is to move from the dbaas-controller that manages operators’ installation/updating its version database creation/management inside Kubernetes to a `dbaas-operator` and [OLM](https://olm.operatorframework.io/). The high-level architecture is described below. - -![Proposed architecture](./proposed_arch_full.jpg) - -In that case, the `dbaas-operator` provides Kubernetes native implementation of the creating/managing database clusters and acts like `unified operator to create any database cluster`. OLM installs and updates a version of the operators (psmdb, pxc, dbaas, victoria metrics). - -### Working with the operators - -An Operator catalog is a repository of metadata that Operator Lifecycle Manager (OLM) can query to discover and install Operators and their dependencies on a cluster. OLM always installs Operators from the latest version of a catalog. We can store Percona operators as well as Community operators inside Percona Catalog as shown below. - -![DBaaS Catalog architecture](./dbaas_catalog.jpg) - -Catalog also gives us the benefits of using CatalogSource and ClusterServiceVersion. ClusterServiceVersion (CSV) can solve the issue by getting the current version of installed operators via OLM API. Currently, we rely on the API version of Percona Operators by requesting `api-versions` via `kubectl` and using the latest API version as an operator’s version. However, there'll be no way to get information about the version after the 1.13 release of PSMDB and the 1.12 release of PXC operator. In that case, we can request an operator image and split the version information from the tag, but in the case of the overridden image tag, we can have discrepancies between versions. With OLM we’ll have a single source of truth for the installed operator version. [Read more](https://olm.operatorframework.io/docs/concepts/crds/clusterserviceversion/) - -Example for PXC operator (It's only 1.10 available on operatorhub, however it demonstrates the idea) - -```bash -kubectl get csv -n my-percona-xtradb-cluster-operator -NAME DISPLAY VERSION REPLACES PHASE -percona-xtradb-cluster-operator.v1.10.0 Percona Distribution for MySQL Operator 1.10.0 percona-xtradb-cluster-operator.v1.9.0 Installing -``` - -In that case, PMM DBaaS will provide a consistent way to get operator version. In addition, OLM can manage a complex upgrades for operators via [InstallPlan](https://olm.operatorframework.io/docs/concepts/crds/installplan/), [OperatorGroup](https://olm.operatorframework.io/docs/concepts/crds/operatorgroup/) or [UpgradeGraph](https://olm.operatorframework.io/docs/glossary/#update-graph). - -A high-level architecture diagram of OLM -![OLM Architecture](./olm_arch.jpg) - -High-level sequence diagram that illustrates registering of K8s cluster - -```mermaid -sequenceDiagram - - PMM UI->>ManageD: Add kubernetes cluster - ManageD->>K8S: Install OLM - break when olm is installed - K8S->>OLM: provisions an OLM - end - Note right of K8S: OLM is provisioned! -``` -High-level sequence diagram that illustrates an Installation and upgrading process inside PMM/DBaaS in terms of end user - -```mermaid -sequenceDiagram - Note right of PMM UI: Once OLM is available - PMM UI->>ManageD: Install operators - ManageD->>OLM: Install required operators and create a manual subscription - OLM->>Catalog: Gets the latest version of the operator - loop when subscription is created - OLM->>Catalog: manages subscription and checks for a new version - end - Note right of OLM: A new version of operator is available - OLM->>Catalog: Downloads and installs a new version of operator and waiting for a user approval to switch to a new version. - PMM UI->>ManageD: Check for unapproved install plans - OLM->>ManageD: Sure. I downloaded it for you and waiting for your approval to switch to a new version - ManageD->>PMM UI: Yeah, there's a new version of operator available - Note left of PMM UI: A user approved the upgrade request - PMM UI->> ManageD: approve a new version of operator - ManageD->>OLM: approve an subscription upgrade request - Note left of OLM: A new version of operator is available -``` -This process makes version service usage for supported versions of operators obsolete because it gets the latest version of available operator from the catalog. However, the catalog can be managed by our team and we'll push only supported versions of operators to the catalog. This also will improve integration testing for unreleased versions of operators. - -### Working with the databases - -The second part of the proposal is implementing the generic and simplified API to create database clusters via k8s operator. The proposal discusses the drawbacks of the current implementation in the Motivation section and moving to the `dbaas-operator` will have the following benefits - -1. Kubernetes native way to work with database clusters via unified and general specifications. -2. PMM DBaaS does not need to care about the state of a managed database. -3. PMM/DBaaS should manage clusters that were created via PMM/DBaaS. Yet, it manages clusters that were created via Percona operators now. `dbaas-operator` uses its own custom resources to specify database clusters managed by PMM/DBaaS. Also, it opens room for additional features such as CR templates to create a database cluster and update a version of a template using the same annotations spec. -4. Installation and upgrading of `dbaas-operator` will be managed by OLM as proposed above. -5. `dbaas-operator` opens a possibility to create an easy to use integration testing framework using codecept.js/playwright or even simple bash scripts. Integration testing can be covered by development team. It can use Github actions as a pipeline to run additional tests to check create/load/run queries against exposed/non-exposed database clusters. -6. PMM/DBaaS will have native integration with `dbaas-operator` via `client-go` package that will improve the overall performance on large-scale clusters - -The sequential diagram illustrates a creation of PXC cluster - -```mermaid -sequenceDiagram - - PMM UI->>ManageD: Create a Database cluster - Note right of PMM UI: (DatabaseType: PXC) - ManageD->>K8S: Create a DatabaseCluster Kind object - K8S->>DBaaS Operator: Reconcile DatabaseCluster object - DBaaS Operator->>PXC Operator: Create a PXC cluster Object - Note right of DBaaS Operator: Binds objects to each other - Note right of DBaaS Operator: (Database->PerconaXtraDBCluster) - break when PXC cluster is in ready state - PXC Operator->>Statefulset: provisions PXC cluster - end - Note right of PXC Operator: PXC Cluster is created - - -``` - -Listing DatabaseClusters - -```mermaid -sequenceDiagram - PMM UI->>ManageD: Give me a list of database clusters - ManageD->>K8S: Get list of DatabaseCluster Kind objects - Note left of K8S: They can be with DatabaseType either PXC or PSMDB - K8S->>ManageD: Returns list of databases - ManageD->>PMM UI: Returns list of database clusters -``` - -#### Communication speed benchmarks - -Currently [dbaas-controller](https://github.com/percona-platform/dbaas-controller) implements proxy api to k8s Percona operators thus `dbaas-controller` needs to call k8s and gets data from k8s operators. That could be expensive call to k8s as api returns full spec and in case of 100 or 1000 of server it could be quite large and time consuming response. - -Also if there is no good connection to the k8s cluster situation would be much worse. - -Here are some measurements made against PMM in different setups (local PMM -> Remote k8s, Remote PMM inside the same cluster, Direct API calls against K8S) - -**Local PMM connected to LKE cluster - -``` -➜ ~ time curl -s -k -o file1.out --request POST --url http://localhost:81/v1/management/DBaaS/DBClusters/List --header 'accept: application/json' -u "admin:admin" --header 'content-type: application/json' --data '{ - "kubernetes_cluster_name": "lke84438" -}' -9.08s -➜ ~ time curl -s -k -o file1.out --request POST --url http://localhost:81/v1/management/DBaaS/DBClusters/List --header 'accept: application/json' -u "admin:admin" --header 'content-type: application/json' --data '{ - "kubernetes_cluster_name": "lke84438" -}' -9.08s -➜ ~ time curl -s -k -o file1.out --request POST --url http://localhost:81/v1/management/DBaaS/DBClusters/List --header 'accept: application/json' -u "admin:admin" --header 'content-type: application/json' --data '{ - "kubernetes_cluster_name": "lke84438" -}' -11.06s -➜ ~ time curl -s -k -o file1.out --request POST --url http://localhost:81/v1/management/DBaaS/DBClusters/List --header 'accept: application/json' -u "admin:admin" --header 'content-type: application/json' --data '{ - "kubernetes_cluster_name": "lke84438" -}' -10.19s -➜ ~ -➜ ~ time curl -s -k -o file1.out --request POST --url http://localhost:81/v1/management/DBaaS/DBClusters/List --header 'accept: application/json' -u "admin:admin" --header 'content-type: application/json' --data '{ - "kubernetes_cluster_name": "lke84438" -}' -``` - -** Same as above but uses dbaas-operator and communicates via client-go library** - -``` - -## Listing 10 clusters -➜ ~ time curl -s -k -o file1.out --request POST --url http://localhost/v1/management/DBaaS/DBClusters/List --header 'accept: application/json' -u "admin:admin" --header 'content-type: application/json' --data '{ - "kubernetes_cluster_name": "lke84438" -}' -1.02s -➜ ~ time curl -s -k -o file1.out --request POST --url http://localhost/v1/management/DBaaS/DBClusters/List --header 'accept: application/json' -u "admin:admin" --header 'content-type: application/json' --data '{ - "kubernetes_cluster_name": "lke84438" -}' -0.99s -➜ ~ time curl -s -k -o file1.out --request POST --url http://localhost/v1/management/DBaaS/DBClusters/List --header 'accept: application/json' -u "admin:admin" --header 'content-type: application/json' --data '{ - "kubernetes_cluster_name": "lke84438" -}' -1.07s -➜ ~ time curl -s -k -o file1.out --request POST --url http://localhost/v1/management/DBaaS/DBClusters/List --header 'accept: application/json' -u "admin:admin" --header 'content-type: application/json' --data '{ - "kubernetes_cluster_name": "lke84438" -}' -0.90s -➜ ~ time curl -s -k -o file1.out --request POST --url http://localhost/v1/management/DBaaS/DBClusters/List --header 'accept: application/json' -u "admin:admin" --header 'content-type: application/json' --data '{ - "kubernetes_cluster_name": "lke84438" -}' -0.90s - -``` -The environment for the benchmark above uses the same testing environment - -1. PMM -2. Remote kubernetes cluster -3. Communicates either via dbaas-controller (first two test runs) or via dbaas-operator (the last test run) - -Note: Communication with dbaas-operator via client-go made without caches, however, using [client-go caches](https://pkg.go.dev/k8s.io/client-go/tools/cache) as well as [Limit and Continue](https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#ListOptions) will improve performance for large scale deployments (more than 500 clusters created) - - -### User Stories - -#### Story 1 -As an SRE person, I should be able to register the Kubernetes cluster using a service account without admin access to the cluster. - -#### Story 2 -As an SRE person, I should be able to understand what’s going wrong during the bootstrapping DBaaS feature inside of PMM in case of insufficient permissions so that I can debug and solve my issues. (E.g. No permissions to run kube-state-metrics, pxc, or psmdb operator). - -#### Story 3 -As an SRE person, I should be able to rename a Kubernetes cluster once it was provisioned automatically so that I can keep my naming conventions. - -#### Story 4 -As an SRE person, I should be able to specify which database operators I need to install in the cluster. - -#### Story 5 -As an SRE person, I should be able to create logical spaces to deploy databases so that I can easily split my environments. (e.g. dev namespace goes to the dev environment and the staging namespace goes to the staging environment. For the production environment I should be able to register and setup an additional cluster.) - -#### Story 6 -As an SRE person, I should be able to create a resource template for a database engine so that I don’t need to manually provide it every time. - -#### Story 7 -As an SRE person, I should be able to create an engine configuration template for a database engine. - -#### Story 8 -As an SRE person, I should be able to manage database engine versions that are allowed to use because I need to control which versions are used in my environment. - -#### Story 9 -As an SRE person, I should be able to specify a backup schedule template for a database cluster. - -#### Story 10 -As an SRE person, I should be able to configure storage for backups. - -#### Story 11 -As a user, I should be able to deploy a database with the recommended defaults - -#### Story 12 -As a user, I should be able to deploy a database with the selected version or cluster size - -#### Story 13 -As a user, I should be able to select a resource template to deploy a database - -#### Story 14 -As a user, I should be able to select a resource template and database engine configuration template to deploy a database - -#### Story 15 -As a user, I should be able to edit a database cluster (If I have sufficient permissions) - -#### Story 16 -As a user, I should be able to delete a database cluster (If I have sufficient permissions) - -#### Story 17 -As a user, I should be able to create a database cluster from a provided backup file. - -#### Story 18 -As a DBA, I should be able to edit database configuration parameters. - -#### Story 19 -As a DBA(?), I should be able to view cluster resources available before creating a database. - -## Design Details - -### Air gapped environments -The design does not support air gapped environments because of internet connectivity dependency. - -### OLM installation -PMM always installs the latest version of OLM using the following process: - -1. Get the latest release from Github -2. Download crds.yaml and olm.yaml -3. Apply crds.yaml and olm.yaml against Kubernetes cluster - -### Installation of dbaas-catalog - -PMM uses [Percona DBaaS catalog](https://github.com/percona/dbaas-catalog/blob/main/docs/design/Percona-DBaaS-Platform-design.md). Percona DBaaS catalog is a repository of metadata that Operator Lifecycle Manager (OLM) can query to discover and install Operators and their dependencies on a cluster. OLM always installs Operators from the latest version of a catalog. It installs the following operators from this catalog: - -1. Percona XtraDB Cluster Operator -2. Percona Server MongoDB Operator -3. Victoria Metrics Operator -4. DBaaS operator - -Any additional operators should be added to the catalog. Installation of an operator has the following steps: - -1. PMM should have DBaaS operator installed -2. PMM creates [Operator Group](https://docs.openshift.com/container-platform/4.8/operators/understanding/olm/olm-understanding-operatorgroups.html) if it does not exist -3. PMM creates [subscription](https://olm.operatorframework.io/docs/concepts/olm-architecture/) for the selected operator - -**Using OLM with pre-installed operators** - -1. PMM gets versions of installed operators -2. PMM creates subscription with specified versions -3. OLM installs [specific version](https://olm.operatorframework.io/docs/tasks/install-operator-with-olm/#example-install-a-specific-version-of-an-operator) -4. Operator restarts and continues to work normally but now OLM manages installation of new versions - - -### CR design for dbaas-operator - -Go struct that represents the payload to create/list database clusters -```go -const ( - PXCEngine EngineType = "pxc" - PSMDBEngine EngineType = "psmdb" - - LoadBalancerMongos LoadBalancerType = "mongos" - LoadBalancerHAProxy LoadBalancerType = "haproxy" - LoadBalancerProxySQL LoadBalancerType = "proxysql" -) -type ( - // EngineType stands for the supported database engines. Right now it's only pxc - // and psmdb. However, it can be ps, pg and any other source - EngineType string - // LoadBalancerType contains supported loadbalancers. It can be proxysql or haproxy - // for PXC clusters and mongos for PSMDB clusters. - // - // Once PG support will be added, it can be pg-bouncer or something else. - LoadBalancerType string - // DatabaseSpec defines the desired state of Database - DatabaseSpec struct { - // Database type stands for supported databases by the PMM API - // Now it's pxc or psmdb types but we can extend it - Database EngineType `json:"databaseType"` - // DatabaseVersion sets from version service and uses the recommended version - // by default - DatabaseImage string `json:"databaseImage"` - // DatabaseConfig contains a config settings for the specified database - DatabaseConfig string `json:"databaseConfig"` - SecretsName string `json:"secretsName,omitempty"` - Pause bool `json:"pause,omitempty"` - // ClusterSize is amount of nodes that required for the cluster. - // A database starts in cluster mode if clusterSize >= 3. - ClusterSize int32 `json:"clusterSize"` - // LoadBalancer contains a load balancer settings. For PXC it's haproxy - // or proxysql. For PSMDB it's mongos. - LoadBalancer LoadBalancerSpec `json:"loadBalancer,omitempty"` - Monitoring MonitoringSpec `json:"monitoring,omitempty"` - DBInstance DBInstanceSpec `json:"dbInstance"` - Backup BackupSpec `json:"backup,omitempty"` - } - // LoadBalancer contains a load balancer settings. For PXC it's haproxy - // or proxysql. For PSMDB it's mongos. - LoadBalancerSpec struct { - Type LoadBalancerType `json:"type,omitempty"` - ExposeType corev1.ServiceType `json:"exposeType,omitempty"` - Image string `json:"image,omitempty"` - Size int32 `json:"size,omitempty"` - Configuration string `json:"configuration,omitempty"` - LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty"` - Annotations map[string]string `json:"annotations,omitempty"` - TrafficPolicy corev1.ServiceExternalTrafficPolicyType `json:"trafficPolicy,omitempty"` - Resources corev1.ResourceRequirements `json:"resources,omitempty"` - } - MonitoringSpec struct { - PMM *PMMSpec `json:"pmm,omitempty"` - ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"` - Resources corev1.ResourceRequirements `json:"resources,omitempty"` - RuntimeClassName *string `json:"runtimeClassName,omitempty"` - ContainerSecurityContext *corev1.SecurityContext `json:"containerSecurityContext,omitempty"` - } - PMMSpec struct { - Image string `json:"image,omitempty"` - ServerHost string `json:"serverHost,omitempty"` - ServerUser string `json:"serverUser,omitempty"` - PublicAddress string `json:"publicAddress,omitempty"` - Login string `json:"login,omitempty"` - Password string `json:"password,omitempty"` - } - DBInstanceSpec struct { - CPU string `json:"cpu,omitempty"` - Memory string `json:"memory,omitempty"` - DiskSize string `json:"diskSize,omitempty"` - StorageClassName *string `json:"storageClassName,omitempty"` - } -``` -Since, the main focus for the PMM/DBaaS is to support AWS EKS clusters. The main focus is supporting managed kubernetes clusters as a main provider. However, the requirements can be changed and PMM/DBaaS may support bare-metal or EC2 setups. That adds additional constraints on the architecture. Everything related to the current implementation of k8s provider is located under `managed/services/dbaas` folder. However, it would be great to have `managed/services/dbaas/provider.go` file with the following interface - -```go -// Provider is the interface that a developer should implement to add support of any other provider that required for DBaaS. -// Currently, PMM supports only K8s/EKS provider but bare-metal setup or using EC2 instances support can be adopted by implementing this inteface -type Provider interface { - // ProvisionCluster provisions a specified cluster. In this case, it'll install - // all required operators that we need (pxc, psmdb, dbaas-operator and victoria metrics - // operator via OLM - ProvisionCluster() error - // CleanupCluster cleans up cluster and removes VMAgent operator - // and, or, dbaas-operator, pxc operator and psmdb operator via --force tag. - // At the moment PMM should remove VMAgent operator only and keep everything that related to databases - // untouched and the end user can decide what to clean - CleanupCluster() error - // CreateDatabase cluster creates a cluster by using Database struct - // and it'll make a request to dbaas-operator to create a database - CreateDatabase(Database) error - // EditDatabase edit's deployed database CR specs by using Database struct - EditDatabase(Database) error - // UpgradeDatabase upgrades database to a desired version - UpgradeDatabase(Database) error - // DestroyDatabase destroys a database from the cluster - DestroyDatabase(Database) error - // UpdateClusterDependencies upgrades cluster dependencies. For k8s it upgrades dbaas and database operators versions and CR configuration - UpdateClusterDependencies() error -} -``` -Every additional provider should implement this interface. Kubernetes related implementations - -#### Further steps with OLM and dbaas-operator - -Since PMM used OLM to install/update operators, PMM can get the information about supported database engines from dbaas-operator. That will help us to make releases of PMM/DBaaS independent from PMM release cycle. As an additional feature, SRE or Admin can select database engines she wants to use and PMM will provision it accordingly - - -### Templates - -There are number of possible template use cases: -- as a DBA I would like to template Cluster and DB parameters for number of different environments -- as a SRE I would like to template k8s and cloud infrastructural parameters - -When DBA would like to have more control over DBs and DB Clusters (versions, sizing, backups, configs, parameters), SRE would like to control over Kubernetes and Cloud infrastructure (networking, storage, secrets) and how that infrastructure connected to applications (affinity, networking, rbac). - -Percona Kubernetes operators have CRs that include both parts of those requirements: -- configs, sizing, backup parameters, cluster parameters (sharding, replsets) -- toleration, affinity, annotations, storage classes, networking - -All those template requirements are subset of Kubernetes CR objects that are supported by operators and kubernetes addons (such as special annotations). - -To define similar properties for different environments, clusters, namespaces - templates could also have different visibility: -- namespace -- environment -- cluster -- set of clusters - -And that visibility would probably define where those will be stored: -- template for a namespace (prod/staging namespaces): as object in a namespace -- environment templates: template with environment labels to select from -- cluster wide templates: as object in a cluster for all namespaces -- global templates: in a external storage in CI/CD, or in PMM as app that manages many clusters - -#### DatabaseCluster templates - -`dbaas-operator` would provide simplifier interface to abstract internal mechanics of kubernetes and different clouds, so templates for it's interface are probably more related to Developer's and DBA's use case. And that makes `dbaas-operator` a more simpler interface that is just a subset of bigger CR template. - -As these kind of templates are more higher level, they would take priority over more low level templates and could be defined later when more business logic on operating templates would be defined. - -![Template Layers](./tpl_layers.png) - -Proposal on a current stage is to propagate low level templates (Database Engine defined by SRE/DBA in a cluster) to a higher level for the know fields. When middle level and high level templates (DBA, Dev) business logic would be better known, it will just a simple layer on top low level template and be presented to the user instead. - - -#### Database Engine Templates - -These templates provide possibility to template full Database operator CR even for the fields that `dbaas-operator` don't really care or even don't know (annotations, parameters for the future CSI drivers and etc). - -1. SRE/DBA creates DB templates (through UI/API/YAML) and they are stored in the Kubernetes cluster. -2. UI requests [PMM API](proposal.md#pmm-rest-api-high-level-design) `GET /dbaas/templates` -3. PMM gets templates from k8s cluster -4. User chooses template in UI. -5. UI parses and present fields from template that are recognized -6. User creates database with or without modifications to the values from template -7. UI call PMM with results of user choices `POST /dbaas/dbclusters` - -Priority: - 1. changes from PMM UI configured by user - 2. chosen template - 3. defaults from `dbaas-operator` - -`dbaas-operator` merges all those 3 sources according to priority and produces CR (custom resource) for specific engine. - -Corner cases: -- user uses PMM UI and there are no default template (or none selected) - - PMM uses old scheme with version service and some default values -- user uses k8s directly without PMM and there neither default templates and submits nor optional fields - - `dbaas-operator` uses default CR that comes from alm-examples of CSV - -There are might be couple of ways for `dbaas-operator` to know about templates. - -Also this use case defaults to namespace and cluster visibility. So if there would be a need to have similar template for different clusters/namespaces - SRE need to copy them over to the another cluster/namespace and apply there (or use automation for it). - -**New parameter in API** -```go - // Optional unique template name for specified EngineType - TemplateName string `json:"templateName,omitempty"` -``` -`dbass-operator` receives `TemplateName` parameters and get template from k8s by combining engine type and template name. Or would implement additional controller for templates and track them. - -That is a possible way is to extend `dbaas-operator` with template functionality. But there are too many questions open: -- what type to choose (string, unstructured) -- how to validate that parameters in template are correct -- how to track template versioning if it will be a controller -- how to extend templates when adding new Database operators - -So instead of committing to the API, annotations could solve the problem for now. - -**Annotations** - -It could be a good solution to not blow up API and keep it simple by making that convention with annotations and later decide to keep it or to switch to something else. Annotations are more flexible and are conventions instead of hard contract, thus we could avoid migrations/mutations later. - -Annotations that PMM or user could set for `dbaas-operator` that related to the templates: -- `dbaas.percona.com/dbtemplate-kind: PSMDBtemplate`: is CustomResource (CR) Kind that implements template -- `dbaas.percona.com/dbtemplate-name: prod-app-X-small`: `metadata.name` identifier for CR that provides template -- `dbaas.percona.com/origin: pmm`: who created CR for `database-operator`: pmm, user, sre, dba, ci - -If one of those 2 parameters (kind, name) are not set - `dbaas-operator` wouldn't be able to identify template and thus would ignore another one. - -Annotations that are set by `dbaas-operator` for any engine to provide additional information about inputs for template: -- all annotations from the template should be propagated to CR of the DB Cluster CR. -- `dbaas.percona.com/dbtemplate-kind: PSMDBtemplate` -- `dbaas.percona.com/dbtemplate-name: prod-app-X-small` -- `dbaas.percona.com/origin: pmm` -- `dbaas.percona.com/dbtemplate-default: yes`: default CR was created without origin and parameters - -**Labels** - -All the labels of the DB Template should be propagated to the DB Cluster CR. - -**Database Engine Templates implementation** - -On a first phase to simplify template creation it might be better to restrict templates to simple k8s custom objects without operator that handles them. Architecture for interacting and layering for some additional operators is not yet defined. - -To simplify implementation of `dbaas-operator` it is better to build templates with exactly the same definitions as the corresponding CR of DB Cluster instances. So `dbaas-operator` would just blindly merge template with user input without validating and knowing details of template implementation. Thus templates should have exactly same CRD as CRD for DB clusters. CRD for templates are needed to avoid errors as templates would be validated by k8s. - -Here are CRDs for DB Clusters: -- PSMDBtemplate: [psmdbtpl.dbaas.percona.com.crd.yaml](psmdbtpl.dbaas.percona.com.crd.yaml) -- PXCtemplate: [pxctpl.dbaas.percona.com.crd.yaml](pxctpl.dbaas.percona.com.crd.yaml) - -Example of CRs for templates: -- [psmdbtpl.dbaas.percona.com.cr.yaml](psmdbtpl.dbaas.percona.com.crd.yaml) -- [pxctpl.dbaas.percona.com.cr.yaml](pxctpl.dbaas.percona.com.crd.yaml) - -CRs should have these annotations: -- `dbaas.percona.com/dbtemplate-origin: sre`: who created template: sre, dba and etc -- TBD - -CRs should have these labels: -- `IsDefaultTpl: "yes"`: yes, or no -- `dbaas.percona.com/engine: psmdb`: engine type -- `dbaas.percona.com/template: "yes"`: indicates that this is a template -- TBD - -There could be more labels to identify env, teams and defaults for teams. That logic could be defined later and probably defined in a separate document with versions of apps that could understand such convention. - -Here is example of 2 templates creation: -```sh -minikube start - -kubectl apply -f pxctmpl.dbaas.percona.com.crd.yaml -customresourcedefinition.apiextensions.k8s.io/pxctemplates.dbaas.percona.com created - -kubectl apply -f psmdbtpl.dbaas.percona.com.crd.yaml -customresourcedefinition.apiextensions.k8s.io/psmdbtemplates.dbaas.percona.com created - -kubectl apply -f pxctpl.dbaas.percona.com.cr.yaml -pxctemplate.dbaas.percona.com/prod-app-n-large created - -kubectl apply -f psmdbtpl.dbaas.percona.com.cr.yaml -psmdbtemplate.dbaas.percona.com/dev-app-x created - -kubectl get psmdbtpl,pxctpl -NAME ENDPOINT STATUS AGE -psmdbtemplate.dbaas.percona.com/dev-app-x 31s - -NAME ENDPOINT STATUS PXC PROXYSQL HAPROXY AGE -pxctemplate.dbaas.percona.com/prod-app-n-large - -``` - -PMM could get templates by selecting specific dbaas resources: -```sh -kubectl api-resources --api-group=dbaas.percona.com -NAME SHORTNAMES APIVERSION NAMESPACED KIND -psmdbtemplates psmdbtpl dbaas.percona.com/v1alpha1 true PSMDBtemplate -pxctemplates pxctpl dbaas.percona.com/v1alpha1 true PXCtemplate - -kubectl api-resources --api-group=dbaas.percona.com --verbs=list --namespaced -o name | xargs -n 1 kubectl get -l 'dbaas.percona.com/engine in (psmdb,pxc)',dbaas.percona.com/template="yes" -NAME ENDPOINT STATUS AGE -dev-app-x 7s -NAME ENDPOINT STATUS PXC PROXYSQL HAPROXY AGE -prod-app-n-large 5m24s -``` - -### Test Plan - -During moving from dbaas-controller to `dbaas-operator` we'll keep the same user experience for the end user - -#### Prerequisite testing updates - -1. Setup Github actions pipelines for dbaas-operator -2. Setup Github actions pipelines for dbaas-catalog - -#### Unit tests - -1. Add unit tests for PMM integration with dbaas-operator -2. Add unit tests for PMM CR generation -3. Add unit tests for PMM k8s client - -#### Integration tests - -1. Use current PMM integration tests for DBaaS during the migration to understand what goes wrong -2. Add additional tests for OLM integration - - -#### e2e tests - -1. Add e2e tests for dbaas-operator to test create/upgrade/update/scale database cluster -2. Add e2e tests to ensure dbaas-operator works well with only one installed operator - - diff --git a/docs/proposals/dbaas/01-architecture/proposed_arch_full.jpg b/docs/proposals/dbaas/01-architecture/proposed_arch_full.jpg deleted file mode 100644 index eee9caa242..0000000000 Binary files a/docs/proposals/dbaas/01-architecture/proposed_arch_full.jpg and /dev/null differ diff --git a/docs/proposals/dbaas/01-architecture/psmdbtpl.dbaas.percona.com.cr.yaml b/docs/proposals/dbaas/01-architecture/psmdbtpl.dbaas.percona.com.cr.yaml deleted file mode 100644 index 2cebf43857..0000000000 --- a/docs/proposals/dbaas/01-architecture/psmdbtpl.dbaas.percona.com.cr.yaml +++ /dev/null @@ -1,492 +0,0 @@ -apiVersion: dbaas.percona.com/v1alpha1 -kind: PSMDBtemplate -metadata: - name: dev-app-x - labels: - dbaas.percona.com/engine: psmdb - dbaas.percona.com/template: "yes" - env: prod - annotations: - dbaas.percona.com/team: GAS -spec: -# platform: openshift -# clusterServiceDNSSuffix: svc.cluster.local -# clusterServiceDNSMode: "Internal" -# pause: true -# unmanaged: false - crVersion: 1.13.0 - image: percona/percona-server-mongodb:5.0.11-10 - imagePullPolicy: Always -# tls: -# # 90 days in hours -# certValidityDuration: 2160h -# imagePullSecrets: -# - name: private-registry-credentials - allowUnsafeConfigurations: false - updateStrategy: SmartUpdate -# multiCluster: -# enabled: true -# DNSSuffix: svc.clusterset.local - upgradeOptions: - versionServiceEndpoint: https://check.percona.com - apply: disabled - schedule: "0 2 * * *" - setFCV: false - secrets: - users: my-cluster-name-secrets - encryptionKey: my-cluster-name-mongodb-encryption-key -# vault: my-cluster-name-vault - pmm: - enabled: false - image: percona/pmm-client:2.30.0 - serverHost: monitoring-service -# mongodParams: --environment=ENVIRONMENT -# mongosParams: --environment=ENVIRONMENT - replsets: - - - name: rs0 - size: 3 -# externalNodes: -# - host: 34.124.76.90 -# - host: 34.124.76.91 -# port: 27017 -# votes: 0 -# priority: 0 -# - host: 34.124.76.92 -# # for more configuration fields refer to https://docs.mongodb.com/manual/reference/configuration-options/ -# configuration: | -# net: -# tls: -# mode: preferTLS -# operationProfiling: -# mode: slowOp -# systemLog: -# verbosity: 1 -# storage: -# engine: wiredTiger -# wiredTiger: -# engineConfig: -# directoryForIndexes: false -# journalCompressor: snappy -# collectionConfig: -# blockCompressor: snappy -# indexConfig: -# prefixCompression: true - affinity: - antiAffinityTopologyKey: "kubernetes.io/hostname" -# advanced: -# nodeAffinity: -# requiredDuringSchedulingIgnoredDuringExecution: -# nodeSelectorTerms: -# - matchExpressions: -# - key: kubernetes.io/e2e-az-name -# operator: In -# values: -# - e2e-az1 -# - e2e-az2 -# tolerations: -# - key: "node.alpha.kubernetes.io/unreachable" -# operator: "Exists" -# effect: "NoExecute" -# tolerationSeconds: 6000 -# priorityClassName: high-priority -# annotations: -# iam.amazonaws.com/role: role-arn -# labels: -# rack: rack-22 -# nodeSelector: -# disktype: ssd -# storage: -# engine: wiredTiger -# wiredTiger: -# engineConfig: -# cacheSizeRatio: 0.5 -# directoryForIndexes: false -# journalCompressor: snappy -# collectionConfig: -# blockCompressor: snappy -# indexConfig: -# prefixCompression: true -# inMemory: -# engineConfig: -# inMemorySizeRatio: 0.5 -# livenessProbe: -# failureThreshold: 4 -# initialDelaySeconds: 60 -# periodSeconds: 30 -# timeoutSeconds: 10 -# startupDelaySeconds: 7200 -# readinessProbe: -# failureThreshold: 8 -# initialDelaySeconds: 10 -# periodSeconds: 3 -# successThreshold: 1 -# timeoutSeconds: 2 -# runtimeClassName: image-rc -# sidecars: -# - image: busybox -# command: ["/bin/sh"] -# args: ["-c", "while true; do echo echo $(date -u) 'test' >> /dev/null; sleep 5;done"] -# name: rs-sidecar-1 -# volumeMounts: -# - mountPath: /volume1 -# name: sidecar-volume-claim -# - mountPath: /secret -# name: sidecar-secret -# - mountPath: /configmap -# name: sidecar-config -# sidecarVolumes: -# - name: sidecar-secret -# secret: -# secretName: mysecret -# - name: sidecar-config -# configMap: -# name: myconfigmap -# sidecarPVCs: -# - apiVersion: v1 -# kind: PersistentVolumeClaim -# metadata: -# name: sidecar-volume-claim -# spec: -# resources: -# requests: -# storage: 1Gi -# volumeMode: Filesystem -# accessModes: -# - ReadWriteOnce - podDisruptionBudget: - maxUnavailable: 1 -# minAvailable: 0 - expose: - enabled: false - exposeType: ClusterIP -# loadBalancerSourceRanges: -# - 10.0.0.0/8 -# serviceAnnotations: -# service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http -# serviceLabels: -# rack: rack-22 - resources: - limits: - cpu: "300m" - memory: "0.5G" - requests: - cpu: "300m" - memory: "0.5G" - volumeSpec: -# emptyDir: {} -# hostPath: -# path: /data -# type: Directory - persistentVolumeClaim: -# storageClassName: standard -# accessModes: [ "ReadWriteOnce" ] - resources: - requests: - storage: 3Gi - - nonvoting: - enabled: false -# podSecurityContext: {} -# containerSecurityContext: {} - size: 3 -# # for more configuration fields refer to https://docs.mongodb.com/manual/reference/configuration-options/ -# configuration: | -# operationProfiling: -# mode: slowOp -# systemLog: -# verbosity: 1 - affinity: - antiAffinityTopologyKey: "kubernetes.io/hostname" -# advanced: -# nodeAffinity: -# requiredDuringSchedulingIgnoredDuringExecution: -# nodeSelectorTerms: -# - matchExpressions: -# - key: kubernetes.io/e2e-az-name -# operator: In -# values: -# - e2e-az1 -# - e2e-az2 -# tolerations: -# - key: "node.alpha.kubernetes.io/unreachable" -# operator: "Exists" -# effect: "NoExecute" -# tolerationSeconds: 6000 -# priorityClassName: high-priority -# annotations: -# iam.amazonaws.com/role: role-arn -# labels: -# rack: rack-22 -# nodeSelector: -# disktype: ssd - podDisruptionBudget: - maxUnavailable: 1 -# minAvailable: 0 - resources: - limits: - cpu: "300m" - memory: "0.5G" - requests: - cpu: "300m" - memory: "0.5G" - volumeSpec: -# emptyDir: {} -# hostPath: -# path: /data -# type: Directory - persistentVolumeClaim: -# storageClassName: standard -# accessModes: [ "ReadWriteOnce" ] - resources: - requests: - storage: 3Gi - arbiter: - enabled: false - size: 1 - affinity: - antiAffinityTopologyKey: "kubernetes.io/hostname" -# advanced: -# nodeAffinity: -# requiredDuringSchedulingIgnoredDuringExecution: -# nodeSelectorTerms: -# - matchExpressions: -# - key: kubernetes.io/e2e-az-name -# operator: In -# values: -# - e2e-az1 -# - e2e-az2 -# tolerations: -# - key: "node.alpha.kubernetes.io/unreachable" -# operator: "Exists" -# effect: "NoExecute" -# tolerationSeconds: 6000 -# priorityClassName: high-priority -# annotations: -# iam.amazonaws.com/role: role-arn -# labels: -# rack: rack-22 -# nodeSelector: -# disktype: ssd - - sharding: - enabled: true - - configsvrReplSet: - size: 3 -# externalNodes: -# - host: 34.124.76.93 -# - host: 34.124.76.94 -# port: 27017 -# votes: 0 -# priority: 0 -# - host: 34.124.76.95 -# # for more configuration fields refer to https://docs.mongodb.com/manual/reference/configuration-options/ -# configuration: | -# operationProfiling: -# mode: slowOp -# systemLog: -# verbosity: 1 - affinity: - antiAffinityTopologyKey: "kubernetes.io/hostname" -# advanced: -# nodeAffinity: -# requiredDuringSchedulingIgnoredDuringExecution: -# nodeSelectorTerms: -# - matchExpressions: -# - key: kubernetes.io/e2e-az-name -# operator: In -# values: -# - e2e-az1 -# - e2e-az2 -# tolerations: -# - key: "node.alpha.kubernetes.io/unreachable" -# operator: "Exists" -# effect: "NoExecute" -# tolerationSeconds: 6000 -# priorityClassName: high-priority -# annotations: -# iam.amazonaws.com/role: role-arn -# labels: -# rack: rack-22 -# nodeSelector: -# disktype: ssd -# livenessProbe: -# failureThreshold: 4 -# initialDelaySeconds: 60 -# periodSeconds: 30 -# timeoutSeconds: 10 -# startupDelaySeconds: 7200 -# readinessProbe: -# failureThreshold: 3 -# initialDelaySeconds: 10 -# periodSeconds: 3 -# successThreshold: 1 -# timeoutSeconds: 2 -# runtimeClassName: image-rc -# sidecars: -# - image: busybox -# command: ["/bin/sh"] -# args: ["-c", "while true; do echo echo $(date -u) 'test' >> /dev/null; sleep 5;done"] -# name: rs-sidecar-1 - podDisruptionBudget: - maxUnavailable: 1 - expose: - enabled: false - exposeType: ClusterIP -# loadBalancerSourceRanges: -# - 10.0.0.0/8 -# serviceAnnotations: -# service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http -# serviceLabels: -# rack: rack-22 - resources: - limits: - cpu: "300m" - memory: "0.5G" - requests: - cpu: "300m" - memory: "0.5G" - volumeSpec: -# emptyDir: {} -# hostPath: -# path: /data -# type: Directory - persistentVolumeClaim: -# storageClassName: standard -# accessModes: [ "ReadWriteOnce" ] - resources: - requests: - storage: 3Gi - - mongos: - size: 3 -# # for more configuration fields refer to https://docs.mongodb.com/manual/reference/configuration-options/ -# configuration: | -# systemLog: -# verbosity: 1 - affinity: - antiAffinityTopologyKey: "kubernetes.io/hostname" -# advanced: -# nodeAffinity: -# requiredDuringSchedulingIgnoredDuringExecution: -# nodeSelectorTerms: -# - matchExpressions: -# - key: kubernetes.io/e2e-az-name -# operator: In -# values: -# - e2e-az1 -# - e2e-az2 -# tolerations: -# - key: "node.alpha.kubernetes.io/unreachable" -# operator: "Exists" -# effect: "NoExecute" -# tolerationSeconds: 6000 -# priorityClassName: high-priority -# annotations: -# iam.amazonaws.com/role: role-arn -# labels: -# rack: rack-22 -# nodeSelector: -# disktype: ssd -# livenessProbe: -# failureThreshold: 4 -# initialDelaySeconds: 60 -# periodSeconds: 30 -# timeoutSeconds: 10 -# startupDelaySeconds: 7200 -# readinessProbe: -# failureThreshold: 3 -# initialDelaySeconds: 10 -# periodSeconds: 3 -# successThreshold: 1 -# timeoutSeconds: 2 -# runtimeClassName: image-rc -# sidecars: -# - image: busybox -# command: ["/bin/sh"] -# args: ["-c", "while true; do echo echo $(date -u) 'test' >> /dev/null; sleep 5;done"] -# name: rs-sidecar-1 - podDisruptionBudget: - maxUnavailable: 1 - resources: - limits: - cpu: "300m" - memory: "0.5G" - requests: - cpu: "300m" - memory: "0.5G" - expose: - exposeType: ClusterIP -# servicePerPod: true -# loadBalancerSourceRanges: -# - 10.0.0.0/8 -# serviceAnnotations: -# service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http -# serviceLabels: -# rack: rack-22 - -# mongod: -# security: -# encryptionKeySecret: "my-cluster-name-mongodb-encryption-key" - - backup: - enabled: true - image: percona/percona-backup-mongodb:1.8.1 - serviceAccountName: percona-server-mongodb-operator -# annotations: -# iam.amazonaws.com/role: role-arn -# resources: -# limits: -# cpu: "300m" -# memory: "0.5G" -# requests: -# cpu: "300m" -# memory: "0.5G" -# storages: -# s3-us-west: -# type: s3 -# s3: -# bucket: S3-BACKUP-BUCKET-NAME-HERE -# credentialsSecret: my-cluster-name-backup-s3 -# region: us-west-2 -# prefix: "" -# uploadPartSize: 10485760 -# maxUploadParts: 10000 -# storageClass: STANDARD -# insecureSkipTLSVerify: false -# minio: -# type: s3 -# s3: -# bucket: MINIO-BACKUP-BUCKET-NAME-HERE -# region: us-east-1 -# credentialsSecret: my-cluster-name-backup-minio -# endpointUrl: http://minio.psmdb.svc.cluster.local:9000/minio/ -# insecureSkipTLSVerify: false -# prefix: "" -# azure-blob: -# type: azure -# azure: -# container: CONTAINER-NAME -# prefix: PREFIX-NAME -# credentialsSecret: SECRET-NAME - pitr: - enabled: false -# oplogSpanMin: 10 - compressionType: gzip - compressionLevel: 6 -# tasks: -# - name: daily-s3-us-west -# enabled: true -# schedule: "0 0 * * *" -# keep: 3 -# storageName: s3-us-west -# compressionType: gzip -# compressionLevel: 6 -# - name: weekly-s3-us-west -# enabled: false -# schedule: "0 0 * * 0" -# keep: 5 -# storageName: s3-us-west -# compressionType: gzip -# compressionLevel: 6 diff --git a/docs/proposals/dbaas/01-architecture/psmdbtpl.dbaas.percona.com.crd.yaml b/docs/proposals/dbaas/01-architecture/psmdbtpl.dbaas.percona.com.crd.yaml deleted file mode 100644 index 4223b1101d..0000000000 --- a/docs/proposals/dbaas/01-architecture/psmdbtpl.dbaas.percona.com.crd.yaml +++ /dev/null @@ -1,15536 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - dbaas.percona.com/dbtemplate-engine: psmdb - creationTimestamp: null - name: psmdbtemplates.dbaas.percona.com -spec: - group: dbaas.percona.com - names: - kind: PSMDBtemplate - plural: psmdbtemplates - shortNames: - - psmdbtpl - singular: psmdbtemplate - scope: Namespaced - versions: - - additionalPrinterColumns: - - jsonPath: .status.host - name: ENDPOINT - type: string - - jsonPath: .status.state - name: Status - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - allowUnsafeConfigurations: - type: boolean - backup: - properties: - annotations: - additionalProperties: - type: string - type: object - containerSecurityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - enabled: - type: boolean - image: - type: string - labels: - additionalProperties: - type: string - type: object - pitr: - properties: - compressionLevel: - type: integer - compressionType: - type: string - enabled: - type: boolean - oplogSpanMin: - type: number - type: object - podSecurityContext: - properties: - fsGroup: - format: int64 - type: integer - fsGroupChangePolicy: - type: string - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - supplementalGroups: - items: - format: int64 - type: integer - type: array - sysctls: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - runtimeClassName: - type: string - serviceAccountName: - type: string - storages: - additionalProperties: - properties: - azure: - properties: - container: - type: string - credentialsSecret: - type: string - prefix: - type: string - required: - - credentialsSecret - type: object - s3: - properties: - bucket: - type: string - credentialsSecret: - type: string - endpointUrl: - type: string - insecureSkipTLSVerify: - type: boolean - maxUploadParts: - type: integer - prefix: - type: string - region: - type: string - storageClass: - type: string - uploadPartSize: - type: integer - required: - - bucket - type: object - type: - type: string - required: - - type - type: object - type: object - tasks: - items: - properties: - compressionLevel: - type: integer - compressionType: - type: string - enabled: - type: boolean - keep: - type: integer - name: - type: string - schedule: - type: string - storageName: - type: string - required: - - enabled - - name - type: object - type: array - required: - - enabled - type: object - clusterServiceDNSMode: - type: string - clusterServiceDNSSuffix: - type: string - crVersion: - type: string - image: - type: string - imagePullPolicy: - type: string - imagePullSecrets: - items: - properties: - name: - type: string - type: object - type: array - initImage: - type: string - mongod: - properties: - auditLog: - properties: - destination: - type: string - filter: - type: string - format: - type: string - type: object - net: - properties: - hostPort: - format: int32 - type: integer - port: - format: int32 - type: integer - type: object - operationProfiling: - properties: - mode: - type: string - rateLimit: - type: integer - slowOpThresholdMs: - type: integer - type: object - replication: - properties: - oplogSizeMB: - type: integer - type: object - security: - properties: - enableEncryption: - type: boolean - encryptionCipherMode: - type: string - encryptionKeySecret: - type: string - redactClientLogData: - type: boolean - type: object - setParameter: - properties: - cursorTimeoutMillis: - type: integer - ttlMonitorSleepSecs: - type: integer - wiredTigerConcurrentReadTransactions: - type: integer - wiredTigerConcurrentWriteTransactions: - type: integer - type: object - storage: - properties: - directoryPerDB: - type: boolean - engine: - type: string - inMemory: - properties: - engineConfig: - properties: - inMemorySizeRatio: - type: number - type: object - type: object - mmapv1: - properties: - nsSize: - type: integer - smallfiles: - type: boolean - type: object - syncPeriodSecs: - type: integer - wiredTiger: - properties: - collectionConfig: - properties: - blockCompressor: - type: string - type: object - engineConfig: - properties: - cacheSizeRatio: - type: number - directoryForIndexes: - type: boolean - journalCompressor: - type: string - type: object - indexConfig: - properties: - prefixCompression: - type: boolean - type: object - type: object - type: object - type: object - multiCluster: - properties: - DNSSuffix: - type: string - enabled: - type: boolean - required: - - enabled - type: object - pause: - type: boolean - platform: - type: string - pmm: - properties: - enabled: - type: boolean - image: - type: string - mongodParams: - type: string - mongosParams: - type: string - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - serverHost: - type: string - type: object - replsets: - items: - properties: - affinity: - properties: - advanced: - properties: - nodeAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - preference: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - weight: - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - antiAffinityTopologyKey: - type: string - type: object - annotations: - additionalProperties: - type: string - type: object - arbiter: - properties: - affinity: - properties: - advanced: - properties: - nodeAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - preference: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - weight: - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - antiAffinityTopologyKey: - type: string - type: object - annotations: - additionalProperties: - type: string - type: object - enabled: - type: boolean - labels: - additionalProperties: - type: string - type: object - nodeSelector: - additionalProperties: - type: string - type: object - podDisruptionBudget: - properties: - maxUnavailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - minAvailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - type: object - priorityClassName: - type: string - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - runtimeClassName: - type: string - serviceAccountName: - type: string - sidecarPVCs: - items: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - status: - properties: - accessModes: - items: - type: string - type: array - allocatedResources: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - capacity: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - status - - type - type: object - type: array - phase: - type: string - resizeStatus: - type: string - type: object - type: object - type: array - sidecarVolumes: - items: - properties: - awsElasticBlockStore: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - azureDisk: - properties: - cachingMode: - type: string - diskName: - type: string - diskURI: - type: string - fsType: - type: string - kind: - type: string - readOnly: - type: boolean - required: - - diskName - - diskURI - type: object - azureFile: - properties: - readOnly: - type: boolean - secretName: - type: string - shareName: - type: string - required: - - secretName - - shareName - type: object - cephfs: - properties: - monitors: - items: - type: string - type: array - path: - type: string - readOnly: - type: boolean - secretFile: - type: string - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - monitors - type: object - cinder: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeID: - type: string - required: - - volumeID - type: object - configMap: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - csi: - properties: - driver: - type: string - fsType: - type: string - nodePublishSecretRef: - properties: - name: - type: string - type: object - readOnly: - type: boolean - volumeAttributes: - additionalProperties: - type: string - type: object - required: - - driver - type: object - downwardAPI: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: - properties: - volumeClaimTemplate: - properties: - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - required: - - spec - type: object - type: object - fc: - properties: - fsType: - type: string - lun: - format: int32 - type: integer - readOnly: - type: boolean - targetWWNs: - items: - type: string - type: array - wwids: - items: - type: string - type: array - type: object - flexVolume: - properties: - driver: - type: string - fsType: - type: string - options: - additionalProperties: - type: string - type: object - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - required: - - driver - type: object - flocker: - properties: - datasetName: - type: string - datasetUUID: - type: string - type: object - gcePersistentDisk: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - pdName: - type: string - readOnly: - type: boolean - required: - - pdName - type: object - gitRepo: - properties: - directory: - type: string - repository: - type: string - revision: - type: string - required: - - repository - type: object - glusterfs: - properties: - endpoints: - type: string - path: - type: string - readOnly: - type: boolean - required: - - endpoints - - path - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - iscsi: - properties: - chapAuthDiscovery: - type: boolean - chapAuthSession: - type: boolean - fsType: - type: string - initiatorName: - type: string - iqn: - type: string - iscsiInterface: - type: string - lun: - format: int32 - type: integer - portals: - items: - type: string - type: array - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - targetPortal: - type: string - required: - - iqn - - lun - - targetPortal - type: object - name: - type: string - nfs: - properties: - path: - type: string - readOnly: - type: boolean - server: - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - properties: - claimName: - type: string - readOnly: - type: boolean - required: - - claimName - type: object - photonPersistentDisk: - properties: - fsType: - type: string - pdID: - type: string - required: - - pdID - type: object - portworxVolume: - properties: - fsType: - type: string - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - projected: - properties: - defaultMode: - format: int32 - type: integer - sources: - items: - properties: - configMap: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - downwardAPI: - properties: - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - secret: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - serviceAccountToken: - properties: - audience: - type: string - expirationSeconds: - format: int64 - type: integer - path: - type: string - required: - - path - type: object - type: object - type: array - type: object - quobyte: - properties: - group: - type: string - readOnly: - type: boolean - registry: - type: string - tenant: - type: string - user: - type: string - volume: - type: string - required: - - registry - - volume - type: object - rbd: - properties: - fsType: - type: string - image: - type: string - keyring: - type: string - monitors: - items: - type: string - type: array - pool: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - image - - monitors - type: object - scaleIO: - properties: - fsType: - type: string - gateway: - type: string - protectionDomain: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - sslEnabled: - type: boolean - storageMode: - type: string - storagePool: - type: string - system: - type: string - volumeName: - type: string - required: - - gateway - - secretRef - - system - type: object - secret: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - optional: - type: boolean - secretName: - type: string - type: object - storageos: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeName: - type: string - volumeNamespace: - type: string - type: object - vsphereVolume: - properties: - fsType: - type: string - storagePolicyID: - type: string - storagePolicyName: - type: string - volumePath: - type: string - required: - - volumePath - type: object - required: - - name - type: object - type: array - sidecars: - items: - properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - type: object - required: - - name - type: object - type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - default: TCP - type: string - required: - - containerPort - type: object - type: array - x-kubernetes-list-map-keys: - - containerPort - - protocol - x-kubernetes-list-type: map - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: - properties: - devicePath: - type: string - name: - type: string - required: - - devicePath - - name - type: object - type: array - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - required: - - mountPath - - name - type: object - type: array - workingDir: - type: string - required: - - name - type: object - type: array - size: - format: int32 - type: integer - tolerations: - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - required: - - enabled - - size - type: object - clusterRole: - type: string - configuration: - type: string - containerSecurityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - expose: - properties: - enabled: - type: boolean - exposeType: - type: string - loadBalancerSourceRanges: - items: - type: string - type: array - serviceAnnotations: - additionalProperties: - type: string - type: object - serviceLabels: - additionalProperties: - type: string - type: object - required: - - enabled - type: object - externalNodes: - items: - properties: - host: - type: string - port: - type: integer - priority: - type: integer - votes: - type: integer - required: - - host - - priority - - votes - type: object - type: array - labels: - additionalProperties: - type: string - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - startupDelaySeconds: - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - nodeSelector: - additionalProperties: - type: string - type: object - nonvoting: - properties: - affinity: - properties: - advanced: - properties: - nodeAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - preference: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - weight: - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - antiAffinityTopologyKey: - type: string - type: object - annotations: - additionalProperties: - type: string - type: object - configuration: - type: string - containerSecurityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - enabled: - type: boolean - labels: - additionalProperties: - type: string - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - startupDelaySeconds: - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - nodeSelector: - additionalProperties: - type: string - type: object - podDisruptionBudget: - properties: - maxUnavailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - minAvailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - type: object - podSecurityContext: - properties: - fsGroup: - format: int64 - type: integer - fsGroupChangePolicy: - type: string - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - supplementalGroups: - items: - format: int64 - type: integer - type: array - sysctls: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - priorityClassName: - type: string - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - runtimeClassName: - type: string - serviceAccountName: - type: string - sidecarPVCs: - items: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - status: - properties: - accessModes: - items: - type: string - type: array - allocatedResources: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - capacity: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - status - - type - type: object - type: array - phase: - type: string - resizeStatus: - type: string - type: object - type: object - type: array - sidecarVolumes: - items: - properties: - awsElasticBlockStore: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - azureDisk: - properties: - cachingMode: - type: string - diskName: - type: string - diskURI: - type: string - fsType: - type: string - kind: - type: string - readOnly: - type: boolean - required: - - diskName - - diskURI - type: object - azureFile: - properties: - readOnly: - type: boolean - secretName: - type: string - shareName: - type: string - required: - - secretName - - shareName - type: object - cephfs: - properties: - monitors: - items: - type: string - type: array - path: - type: string - readOnly: - type: boolean - secretFile: - type: string - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - monitors - type: object - cinder: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeID: - type: string - required: - - volumeID - type: object - configMap: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - csi: - properties: - driver: - type: string - fsType: - type: string - nodePublishSecretRef: - properties: - name: - type: string - type: object - readOnly: - type: boolean - volumeAttributes: - additionalProperties: - type: string - type: object - required: - - driver - type: object - downwardAPI: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: - properties: - volumeClaimTemplate: - properties: - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - required: - - spec - type: object - type: object - fc: - properties: - fsType: - type: string - lun: - format: int32 - type: integer - readOnly: - type: boolean - targetWWNs: - items: - type: string - type: array - wwids: - items: - type: string - type: array - type: object - flexVolume: - properties: - driver: - type: string - fsType: - type: string - options: - additionalProperties: - type: string - type: object - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - required: - - driver - type: object - flocker: - properties: - datasetName: - type: string - datasetUUID: - type: string - type: object - gcePersistentDisk: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - pdName: - type: string - readOnly: - type: boolean - required: - - pdName - type: object - gitRepo: - properties: - directory: - type: string - repository: - type: string - revision: - type: string - required: - - repository - type: object - glusterfs: - properties: - endpoints: - type: string - path: - type: string - readOnly: - type: boolean - required: - - endpoints - - path - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - iscsi: - properties: - chapAuthDiscovery: - type: boolean - chapAuthSession: - type: boolean - fsType: - type: string - initiatorName: - type: string - iqn: - type: string - iscsiInterface: - type: string - lun: - format: int32 - type: integer - portals: - items: - type: string - type: array - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - targetPortal: - type: string - required: - - iqn - - lun - - targetPortal - type: object - name: - type: string - nfs: - properties: - path: - type: string - readOnly: - type: boolean - server: - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - properties: - claimName: - type: string - readOnly: - type: boolean - required: - - claimName - type: object - photonPersistentDisk: - properties: - fsType: - type: string - pdID: - type: string - required: - - pdID - type: object - portworxVolume: - properties: - fsType: - type: string - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - projected: - properties: - defaultMode: - format: int32 - type: integer - sources: - items: - properties: - configMap: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - downwardAPI: - properties: - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - secret: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - serviceAccountToken: - properties: - audience: - type: string - expirationSeconds: - format: int64 - type: integer - path: - type: string - required: - - path - type: object - type: object - type: array - type: object - quobyte: - properties: - group: - type: string - readOnly: - type: boolean - registry: - type: string - tenant: - type: string - user: - type: string - volume: - type: string - required: - - registry - - volume - type: object - rbd: - properties: - fsType: - type: string - image: - type: string - keyring: - type: string - monitors: - items: - type: string - type: array - pool: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - image - - monitors - type: object - scaleIO: - properties: - fsType: - type: string - gateway: - type: string - protectionDomain: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - sslEnabled: - type: boolean - storageMode: - type: string - storagePool: - type: string - system: - type: string - volumeName: - type: string - required: - - gateway - - secretRef - - system - type: object - secret: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - optional: - type: boolean - secretName: - type: string - type: object - storageos: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeName: - type: string - volumeNamespace: - type: string - type: object - vsphereVolume: - properties: - fsType: - type: string - storagePolicyID: - type: string - storagePolicyName: - type: string - volumePath: - type: string - required: - - volumePath - type: object - required: - - name - type: object - type: array - sidecars: - items: - properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - type: object - required: - - name - type: object - type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - default: TCP - type: string - required: - - containerPort - type: object - type: array - x-kubernetes-list-map-keys: - - containerPort - - protocol - x-kubernetes-list-type: map - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: - properties: - devicePath: - type: string - name: - type: string - required: - - devicePath - - name - type: object - type: array - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - required: - - mountPath - - name - type: object - type: array - workingDir: - type: string - required: - - name - type: object - type: array - size: - format: int32 - type: integer - tolerations: - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - volumeSpec: - properties: - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - persistentVolumeClaim: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - type: object - required: - - enabled - - size - type: object - podDisruptionBudget: - properties: - maxUnavailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - minAvailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - type: object - podSecurityContext: - properties: - fsGroup: - format: int64 - type: integer - fsGroupChangePolicy: - type: string - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - supplementalGroups: - items: - format: int64 - type: integer - type: array - sysctls: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - priorityClassName: - type: string - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - runtimeClassName: - type: string - serviceAccountName: - type: string - sidecarPVCs: - items: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - status: - properties: - accessModes: - items: - type: string - type: array - allocatedResources: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - capacity: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - status - - type - type: object - type: array - phase: - type: string - resizeStatus: - type: string - type: object - type: object - type: array - sidecarVolumes: - items: - properties: - awsElasticBlockStore: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - azureDisk: - properties: - cachingMode: - type: string - diskName: - type: string - diskURI: - type: string - fsType: - type: string - kind: - type: string - readOnly: - type: boolean - required: - - diskName - - diskURI - type: object - azureFile: - properties: - readOnly: - type: boolean - secretName: - type: string - shareName: - type: string - required: - - secretName - - shareName - type: object - cephfs: - properties: - monitors: - items: - type: string - type: array - path: - type: string - readOnly: - type: boolean - secretFile: - type: string - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - monitors - type: object - cinder: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeID: - type: string - required: - - volumeID - type: object - configMap: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - csi: - properties: - driver: - type: string - fsType: - type: string - nodePublishSecretRef: - properties: - name: - type: string - type: object - readOnly: - type: boolean - volumeAttributes: - additionalProperties: - type: string - type: object - required: - - driver - type: object - downwardAPI: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: - properties: - volumeClaimTemplate: - properties: - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - required: - - spec - type: object - type: object - fc: - properties: - fsType: - type: string - lun: - format: int32 - type: integer - readOnly: - type: boolean - targetWWNs: - items: - type: string - type: array - wwids: - items: - type: string - type: array - type: object - flexVolume: - properties: - driver: - type: string - fsType: - type: string - options: - additionalProperties: - type: string - type: object - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - required: - - driver - type: object - flocker: - properties: - datasetName: - type: string - datasetUUID: - type: string - type: object - gcePersistentDisk: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - pdName: - type: string - readOnly: - type: boolean - required: - - pdName - type: object - gitRepo: - properties: - directory: - type: string - repository: - type: string - revision: - type: string - required: - - repository - type: object - glusterfs: - properties: - endpoints: - type: string - path: - type: string - readOnly: - type: boolean - required: - - endpoints - - path - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - iscsi: - properties: - chapAuthDiscovery: - type: boolean - chapAuthSession: - type: boolean - fsType: - type: string - initiatorName: - type: string - iqn: - type: string - iscsiInterface: - type: string - lun: - format: int32 - type: integer - portals: - items: - type: string - type: array - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - targetPortal: - type: string - required: - - iqn - - lun - - targetPortal - type: object - name: - type: string - nfs: - properties: - path: - type: string - readOnly: - type: boolean - server: - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - properties: - claimName: - type: string - readOnly: - type: boolean - required: - - claimName - type: object - photonPersistentDisk: - properties: - fsType: - type: string - pdID: - type: string - required: - - pdID - type: object - portworxVolume: - properties: - fsType: - type: string - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - projected: - properties: - defaultMode: - format: int32 - type: integer - sources: - items: - properties: - configMap: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - downwardAPI: - properties: - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - secret: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - serviceAccountToken: - properties: - audience: - type: string - expirationSeconds: - format: int64 - type: integer - path: - type: string - required: - - path - type: object - type: object - type: array - type: object - quobyte: - properties: - group: - type: string - readOnly: - type: boolean - registry: - type: string - tenant: - type: string - user: - type: string - volume: - type: string - required: - - registry - - volume - type: object - rbd: - properties: - fsType: - type: string - image: - type: string - keyring: - type: string - monitors: - items: - type: string - type: array - pool: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - image - - monitors - type: object - scaleIO: - properties: - fsType: - type: string - gateway: - type: string - protectionDomain: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - sslEnabled: - type: boolean - storageMode: - type: string - storagePool: - type: string - system: - type: string - volumeName: - type: string - required: - - gateway - - secretRef - - system - type: object - secret: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - optional: - type: boolean - secretName: - type: string - type: object - storageos: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeName: - type: string - volumeNamespace: - type: string - type: object - vsphereVolume: - properties: - fsType: - type: string - storagePolicyID: - type: string - storagePolicyName: - type: string - volumePath: - type: string - required: - - volumePath - type: object - required: - - name - type: object - type: array - sidecars: - items: - properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - type: object - required: - - name - type: object - type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - default: TCP - type: string - required: - - containerPort - type: object - type: array - x-kubernetes-list-map-keys: - - containerPort - - protocol - x-kubernetes-list-type: map - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: - properties: - devicePath: - type: string - name: - type: string - required: - - devicePath - - name - type: object - type: array - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - required: - - mountPath - - name - type: object - type: array - workingDir: - type: string - required: - - name - type: object - type: array - size: - format: int32 - type: integer - storage: - properties: - directoryPerDB: - type: boolean - engine: - type: string - inMemory: - properties: - engineConfig: - properties: - inMemorySizeRatio: - type: number - type: object - type: object - mmapv1: - properties: - nsSize: - type: integer - smallfiles: - type: boolean - type: object - syncPeriodSecs: - type: integer - wiredTiger: - properties: - collectionConfig: - properties: - blockCompressor: - type: string - type: object - engineConfig: - properties: - cacheSizeRatio: - type: number - directoryForIndexes: - type: boolean - journalCompressor: - type: string - type: object - indexConfig: - properties: - prefixCompression: - type: boolean - type: object - type: object - type: object - tolerations: - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - volumeSpec: - properties: - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - persistentVolumeClaim: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - type: object - required: - - size - type: object - type: array - schedulerName: - type: string - secrets: - properties: - encryptionKey: - type: string - ssl: - type: string - sslInternal: - type: string - users: - type: string - vault: - type: string - type: object - sharding: - properties: - configsvrReplSet: - properties: - affinity: - properties: - advanced: - properties: - nodeAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - preference: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - weight: - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - antiAffinityTopologyKey: - type: string - type: object - annotations: - additionalProperties: - type: string - type: object - arbiter: - properties: - affinity: - properties: - advanced: - properties: - nodeAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - preference: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - weight: - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - antiAffinityTopologyKey: - type: string - type: object - annotations: - additionalProperties: - type: string - type: object - enabled: - type: boolean - labels: - additionalProperties: - type: string - type: object - nodeSelector: - additionalProperties: - type: string - type: object - podDisruptionBudget: - properties: - maxUnavailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - minAvailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - type: object - priorityClassName: - type: string - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - runtimeClassName: - type: string - serviceAccountName: - type: string - sidecarPVCs: - items: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - status: - properties: - accessModes: - items: - type: string - type: array - allocatedResources: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - capacity: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - status - - type - type: object - type: array - phase: - type: string - resizeStatus: - type: string - type: object - type: object - type: array - sidecarVolumes: - items: - properties: - awsElasticBlockStore: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - azureDisk: - properties: - cachingMode: - type: string - diskName: - type: string - diskURI: - type: string - fsType: - type: string - kind: - type: string - readOnly: - type: boolean - required: - - diskName - - diskURI - type: object - azureFile: - properties: - readOnly: - type: boolean - secretName: - type: string - shareName: - type: string - required: - - secretName - - shareName - type: object - cephfs: - properties: - monitors: - items: - type: string - type: array - path: - type: string - readOnly: - type: boolean - secretFile: - type: string - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - monitors - type: object - cinder: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeID: - type: string - required: - - volumeID - type: object - configMap: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - csi: - properties: - driver: - type: string - fsType: - type: string - nodePublishSecretRef: - properties: - name: - type: string - type: object - readOnly: - type: boolean - volumeAttributes: - additionalProperties: - type: string - type: object - required: - - driver - type: object - downwardAPI: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: - properties: - volumeClaimTemplate: - properties: - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - required: - - spec - type: object - type: object - fc: - properties: - fsType: - type: string - lun: - format: int32 - type: integer - readOnly: - type: boolean - targetWWNs: - items: - type: string - type: array - wwids: - items: - type: string - type: array - type: object - flexVolume: - properties: - driver: - type: string - fsType: - type: string - options: - additionalProperties: - type: string - type: object - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - required: - - driver - type: object - flocker: - properties: - datasetName: - type: string - datasetUUID: - type: string - type: object - gcePersistentDisk: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - pdName: - type: string - readOnly: - type: boolean - required: - - pdName - type: object - gitRepo: - properties: - directory: - type: string - repository: - type: string - revision: - type: string - required: - - repository - type: object - glusterfs: - properties: - endpoints: - type: string - path: - type: string - readOnly: - type: boolean - required: - - endpoints - - path - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - iscsi: - properties: - chapAuthDiscovery: - type: boolean - chapAuthSession: - type: boolean - fsType: - type: string - initiatorName: - type: string - iqn: - type: string - iscsiInterface: - type: string - lun: - format: int32 - type: integer - portals: - items: - type: string - type: array - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - targetPortal: - type: string - required: - - iqn - - lun - - targetPortal - type: object - name: - type: string - nfs: - properties: - path: - type: string - readOnly: - type: boolean - server: - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - properties: - claimName: - type: string - readOnly: - type: boolean - required: - - claimName - type: object - photonPersistentDisk: - properties: - fsType: - type: string - pdID: - type: string - required: - - pdID - type: object - portworxVolume: - properties: - fsType: - type: string - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - projected: - properties: - defaultMode: - format: int32 - type: integer - sources: - items: - properties: - configMap: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - downwardAPI: - properties: - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - secret: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - serviceAccountToken: - properties: - audience: - type: string - expirationSeconds: - format: int64 - type: integer - path: - type: string - required: - - path - type: object - type: object - type: array - type: object - quobyte: - properties: - group: - type: string - readOnly: - type: boolean - registry: - type: string - tenant: - type: string - user: - type: string - volume: - type: string - required: - - registry - - volume - type: object - rbd: - properties: - fsType: - type: string - image: - type: string - keyring: - type: string - monitors: - items: - type: string - type: array - pool: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - image - - monitors - type: object - scaleIO: - properties: - fsType: - type: string - gateway: - type: string - protectionDomain: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - sslEnabled: - type: boolean - storageMode: - type: string - storagePool: - type: string - system: - type: string - volumeName: - type: string - required: - - gateway - - secretRef - - system - type: object - secret: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - optional: - type: boolean - secretName: - type: string - type: object - storageos: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeName: - type: string - volumeNamespace: - type: string - type: object - vsphereVolume: - properties: - fsType: - type: string - storagePolicyID: - type: string - storagePolicyName: - type: string - volumePath: - type: string - required: - - volumePath - type: object - required: - - name - type: object - type: array - sidecars: - items: - properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - type: object - required: - - name - type: object - type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - default: TCP - type: string - required: - - containerPort - type: object - type: array - x-kubernetes-list-map-keys: - - containerPort - - protocol - x-kubernetes-list-type: map - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: - properties: - devicePath: - type: string - name: - type: string - required: - - devicePath - - name - type: object - type: array - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - required: - - mountPath - - name - type: object - type: array - workingDir: - type: string - required: - - name - type: object - type: array - size: - format: int32 - type: integer - tolerations: - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - required: - - enabled - - size - type: object - clusterRole: - type: string - configuration: - type: string - containerSecurityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - expose: - properties: - enabled: - type: boolean - exposeType: - type: string - loadBalancerSourceRanges: - items: - type: string - type: array - serviceAnnotations: - additionalProperties: - type: string - type: object - serviceLabels: - additionalProperties: - type: string - type: object - required: - - enabled - type: object - externalNodes: - items: - properties: - host: - type: string - port: - type: integer - priority: - type: integer - votes: - type: integer - required: - - host - - priority - - votes - type: object - type: array - labels: - additionalProperties: - type: string - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - startupDelaySeconds: - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - nodeSelector: - additionalProperties: - type: string - type: object - nonvoting: - properties: - affinity: - properties: - advanced: - properties: - nodeAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - preference: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - weight: - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - antiAffinityTopologyKey: - type: string - type: object - annotations: - additionalProperties: - type: string - type: object - configuration: - type: string - containerSecurityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - enabled: - type: boolean - labels: - additionalProperties: - type: string - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - startupDelaySeconds: - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - nodeSelector: - additionalProperties: - type: string - type: object - podDisruptionBudget: - properties: - maxUnavailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - minAvailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - type: object - podSecurityContext: - properties: - fsGroup: - format: int64 - type: integer - fsGroupChangePolicy: - type: string - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - supplementalGroups: - items: - format: int64 - type: integer - type: array - sysctls: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - priorityClassName: - type: string - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - runtimeClassName: - type: string - serviceAccountName: - type: string - sidecarPVCs: - items: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - status: - properties: - accessModes: - items: - type: string - type: array - allocatedResources: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - capacity: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - status - - type - type: object - type: array - phase: - type: string - resizeStatus: - type: string - type: object - type: object - type: array - sidecarVolumes: - items: - properties: - awsElasticBlockStore: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - azureDisk: - properties: - cachingMode: - type: string - diskName: - type: string - diskURI: - type: string - fsType: - type: string - kind: - type: string - readOnly: - type: boolean - required: - - diskName - - diskURI - type: object - azureFile: - properties: - readOnly: - type: boolean - secretName: - type: string - shareName: - type: string - required: - - secretName - - shareName - type: object - cephfs: - properties: - monitors: - items: - type: string - type: array - path: - type: string - readOnly: - type: boolean - secretFile: - type: string - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - monitors - type: object - cinder: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeID: - type: string - required: - - volumeID - type: object - configMap: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - csi: - properties: - driver: - type: string - fsType: - type: string - nodePublishSecretRef: - properties: - name: - type: string - type: object - readOnly: - type: boolean - volumeAttributes: - additionalProperties: - type: string - type: object - required: - - driver - type: object - downwardAPI: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: - properties: - volumeClaimTemplate: - properties: - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - required: - - spec - type: object - type: object - fc: - properties: - fsType: - type: string - lun: - format: int32 - type: integer - readOnly: - type: boolean - targetWWNs: - items: - type: string - type: array - wwids: - items: - type: string - type: array - type: object - flexVolume: - properties: - driver: - type: string - fsType: - type: string - options: - additionalProperties: - type: string - type: object - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - required: - - driver - type: object - flocker: - properties: - datasetName: - type: string - datasetUUID: - type: string - type: object - gcePersistentDisk: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - pdName: - type: string - readOnly: - type: boolean - required: - - pdName - type: object - gitRepo: - properties: - directory: - type: string - repository: - type: string - revision: - type: string - required: - - repository - type: object - glusterfs: - properties: - endpoints: - type: string - path: - type: string - readOnly: - type: boolean - required: - - endpoints - - path - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - iscsi: - properties: - chapAuthDiscovery: - type: boolean - chapAuthSession: - type: boolean - fsType: - type: string - initiatorName: - type: string - iqn: - type: string - iscsiInterface: - type: string - lun: - format: int32 - type: integer - portals: - items: - type: string - type: array - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - targetPortal: - type: string - required: - - iqn - - lun - - targetPortal - type: object - name: - type: string - nfs: - properties: - path: - type: string - readOnly: - type: boolean - server: - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - properties: - claimName: - type: string - readOnly: - type: boolean - required: - - claimName - type: object - photonPersistentDisk: - properties: - fsType: - type: string - pdID: - type: string - required: - - pdID - type: object - portworxVolume: - properties: - fsType: - type: string - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - projected: - properties: - defaultMode: - format: int32 - type: integer - sources: - items: - properties: - configMap: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - downwardAPI: - properties: - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - secret: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - serviceAccountToken: - properties: - audience: - type: string - expirationSeconds: - format: int64 - type: integer - path: - type: string - required: - - path - type: object - type: object - type: array - type: object - quobyte: - properties: - group: - type: string - readOnly: - type: boolean - registry: - type: string - tenant: - type: string - user: - type: string - volume: - type: string - required: - - registry - - volume - type: object - rbd: - properties: - fsType: - type: string - image: - type: string - keyring: - type: string - monitors: - items: - type: string - type: array - pool: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - image - - monitors - type: object - scaleIO: - properties: - fsType: - type: string - gateway: - type: string - protectionDomain: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - sslEnabled: - type: boolean - storageMode: - type: string - storagePool: - type: string - system: - type: string - volumeName: - type: string - required: - - gateway - - secretRef - - system - type: object - secret: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - optional: - type: boolean - secretName: - type: string - type: object - storageos: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeName: - type: string - volumeNamespace: - type: string - type: object - vsphereVolume: - properties: - fsType: - type: string - storagePolicyID: - type: string - storagePolicyName: - type: string - volumePath: - type: string - required: - - volumePath - type: object - required: - - name - type: object - type: array - sidecars: - items: - properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - type: object - required: - - name - type: object - type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - default: TCP - type: string - required: - - containerPort - type: object - type: array - x-kubernetes-list-map-keys: - - containerPort - - protocol - x-kubernetes-list-type: map - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: - properties: - devicePath: - type: string - name: - type: string - required: - - devicePath - - name - type: object - type: array - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - required: - - mountPath - - name - type: object - type: array - workingDir: - type: string - required: - - name - type: object - type: array - size: - format: int32 - type: integer - tolerations: - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - volumeSpec: - properties: - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - persistentVolumeClaim: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - type: object - required: - - enabled - - size - type: object - podDisruptionBudget: - properties: - maxUnavailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - minAvailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - type: object - podSecurityContext: - properties: - fsGroup: - format: int64 - type: integer - fsGroupChangePolicy: - type: string - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - supplementalGroups: - items: - format: int64 - type: integer - type: array - sysctls: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - priorityClassName: - type: string - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - runtimeClassName: - type: string - serviceAccountName: - type: string - sidecarPVCs: - items: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - status: - properties: - accessModes: - items: - type: string - type: array - allocatedResources: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - capacity: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - status - - type - type: object - type: array - phase: - type: string - resizeStatus: - type: string - type: object - type: object - type: array - sidecarVolumes: - items: - properties: - awsElasticBlockStore: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - azureDisk: - properties: - cachingMode: - type: string - diskName: - type: string - diskURI: - type: string - fsType: - type: string - kind: - type: string - readOnly: - type: boolean - required: - - diskName - - diskURI - type: object - azureFile: - properties: - readOnly: - type: boolean - secretName: - type: string - shareName: - type: string - required: - - secretName - - shareName - type: object - cephfs: - properties: - monitors: - items: - type: string - type: array - path: - type: string - readOnly: - type: boolean - secretFile: - type: string - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - monitors - type: object - cinder: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeID: - type: string - required: - - volumeID - type: object - configMap: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - csi: - properties: - driver: - type: string - fsType: - type: string - nodePublishSecretRef: - properties: - name: - type: string - type: object - readOnly: - type: boolean - volumeAttributes: - additionalProperties: - type: string - type: object - required: - - driver - type: object - downwardAPI: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: - properties: - volumeClaimTemplate: - properties: - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - required: - - spec - type: object - type: object - fc: - properties: - fsType: - type: string - lun: - format: int32 - type: integer - readOnly: - type: boolean - targetWWNs: - items: - type: string - type: array - wwids: - items: - type: string - type: array - type: object - flexVolume: - properties: - driver: - type: string - fsType: - type: string - options: - additionalProperties: - type: string - type: object - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - required: - - driver - type: object - flocker: - properties: - datasetName: - type: string - datasetUUID: - type: string - type: object - gcePersistentDisk: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - pdName: - type: string - readOnly: - type: boolean - required: - - pdName - type: object - gitRepo: - properties: - directory: - type: string - repository: - type: string - revision: - type: string - required: - - repository - type: object - glusterfs: - properties: - endpoints: - type: string - path: - type: string - readOnly: - type: boolean - required: - - endpoints - - path - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - iscsi: - properties: - chapAuthDiscovery: - type: boolean - chapAuthSession: - type: boolean - fsType: - type: string - initiatorName: - type: string - iqn: - type: string - iscsiInterface: - type: string - lun: - format: int32 - type: integer - portals: - items: - type: string - type: array - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - targetPortal: - type: string - required: - - iqn - - lun - - targetPortal - type: object - name: - type: string - nfs: - properties: - path: - type: string - readOnly: - type: boolean - server: - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - properties: - claimName: - type: string - readOnly: - type: boolean - required: - - claimName - type: object - photonPersistentDisk: - properties: - fsType: - type: string - pdID: - type: string - required: - - pdID - type: object - portworxVolume: - properties: - fsType: - type: string - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - projected: - properties: - defaultMode: - format: int32 - type: integer - sources: - items: - properties: - configMap: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - downwardAPI: - properties: - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - secret: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - serviceAccountToken: - properties: - audience: - type: string - expirationSeconds: - format: int64 - type: integer - path: - type: string - required: - - path - type: object - type: object - type: array - type: object - quobyte: - properties: - group: - type: string - readOnly: - type: boolean - registry: - type: string - tenant: - type: string - user: - type: string - volume: - type: string - required: - - registry - - volume - type: object - rbd: - properties: - fsType: - type: string - image: - type: string - keyring: - type: string - monitors: - items: - type: string - type: array - pool: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - image - - monitors - type: object - scaleIO: - properties: - fsType: - type: string - gateway: - type: string - protectionDomain: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - sslEnabled: - type: boolean - storageMode: - type: string - storagePool: - type: string - system: - type: string - volumeName: - type: string - required: - - gateway - - secretRef - - system - type: object - secret: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - optional: - type: boolean - secretName: - type: string - type: object - storageos: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeName: - type: string - volumeNamespace: - type: string - type: object - vsphereVolume: - properties: - fsType: - type: string - storagePolicyID: - type: string - storagePolicyName: - type: string - volumePath: - type: string - required: - - volumePath - type: object - required: - - name - type: object - type: array - sidecars: - items: - properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - type: object - required: - - name - type: object - type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - default: TCP - type: string - required: - - containerPort - type: object - type: array - x-kubernetes-list-map-keys: - - containerPort - - protocol - x-kubernetes-list-type: map - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: - properties: - devicePath: - type: string - name: - type: string - required: - - devicePath - - name - type: object - type: array - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - required: - - mountPath - - name - type: object - type: array - workingDir: - type: string - required: - - name - type: object - type: array - size: - format: int32 - type: integer - storage: - properties: - directoryPerDB: - type: boolean - engine: - type: string - inMemory: - properties: - engineConfig: - properties: - inMemorySizeRatio: - type: number - type: object - type: object - mmapv1: - properties: - nsSize: - type: integer - smallfiles: - type: boolean - type: object - syncPeriodSecs: - type: integer - wiredTiger: - properties: - collectionConfig: - properties: - blockCompressor: - type: string - type: object - engineConfig: - properties: - cacheSizeRatio: - type: number - directoryForIndexes: - type: boolean - journalCompressor: - type: string - type: object - indexConfig: - properties: - prefixCompression: - type: boolean - type: object - type: object - type: object - tolerations: - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - volumeSpec: - properties: - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - persistentVolumeClaim: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - type: object - required: - - size - type: object - enabled: - type: boolean - mongos: - properties: - affinity: - properties: - advanced: - properties: - nodeAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - preference: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - weight: - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - antiAffinityTopologyKey: - type: string - type: object - annotations: - additionalProperties: - type: string - type: object - auditLog: - properties: - destination: - type: string - filter: - type: string - format: - type: string - type: object - configuration: - type: string - containerSecurityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - expose: - properties: - exposeType: - type: string - loadBalancerSourceRanges: - items: - type: string - type: array - serviceAnnotations: - additionalProperties: - type: string - type: object - serviceLabels: - additionalProperties: - type: string - type: object - servicePerPod: - type: boolean - type: object - hostPort: - format: int32 - type: integer - labels: - additionalProperties: - type: string - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - startupDelaySeconds: - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - nodeSelector: - additionalProperties: - type: string - type: object - podDisruptionBudget: - properties: - maxUnavailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - minAvailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - type: object - podSecurityContext: - properties: - fsGroup: - format: int64 - type: integer - fsGroupChangePolicy: - type: string - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - supplementalGroups: - items: - format: int64 - type: integer - type: array - sysctls: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - port: - format: int32 - type: integer - priorityClassName: - type: string - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - runtimeClassName: - type: string - serviceAccountName: - type: string - setParameter: - properties: - cursorTimeoutMillis: - type: integer - type: object - sidecarPVCs: - items: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - status: - properties: - accessModes: - items: - type: string - type: array - allocatedResources: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - capacity: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - status - - type - type: object - type: array - phase: - type: string - resizeStatus: - type: string - type: object - type: object - type: array - sidecarVolumes: - items: - properties: - awsElasticBlockStore: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - azureDisk: - properties: - cachingMode: - type: string - diskName: - type: string - diskURI: - type: string - fsType: - type: string - kind: - type: string - readOnly: - type: boolean - required: - - diskName - - diskURI - type: object - azureFile: - properties: - readOnly: - type: boolean - secretName: - type: string - shareName: - type: string - required: - - secretName - - shareName - type: object - cephfs: - properties: - monitors: - items: - type: string - type: array - path: - type: string - readOnly: - type: boolean - secretFile: - type: string - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - monitors - type: object - cinder: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeID: - type: string - required: - - volumeID - type: object - configMap: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - csi: - properties: - driver: - type: string - fsType: - type: string - nodePublishSecretRef: - properties: - name: - type: string - type: object - readOnly: - type: boolean - volumeAttributes: - additionalProperties: - type: string - type: object - required: - - driver - type: object - downwardAPI: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: - properties: - volumeClaimTemplate: - properties: - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - required: - - spec - type: object - type: object - fc: - properties: - fsType: - type: string - lun: - format: int32 - type: integer - readOnly: - type: boolean - targetWWNs: - items: - type: string - type: array - wwids: - items: - type: string - type: array - type: object - flexVolume: - properties: - driver: - type: string - fsType: - type: string - options: - additionalProperties: - type: string - type: object - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - required: - - driver - type: object - flocker: - properties: - datasetName: - type: string - datasetUUID: - type: string - type: object - gcePersistentDisk: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - pdName: - type: string - readOnly: - type: boolean - required: - - pdName - type: object - gitRepo: - properties: - directory: - type: string - repository: - type: string - revision: - type: string - required: - - repository - type: object - glusterfs: - properties: - endpoints: - type: string - path: - type: string - readOnly: - type: boolean - required: - - endpoints - - path - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - iscsi: - properties: - chapAuthDiscovery: - type: boolean - chapAuthSession: - type: boolean - fsType: - type: string - initiatorName: - type: string - iqn: - type: string - iscsiInterface: - type: string - lun: - format: int32 - type: integer - portals: - items: - type: string - type: array - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - targetPortal: - type: string - required: - - iqn - - lun - - targetPortal - type: object - name: - type: string - nfs: - properties: - path: - type: string - readOnly: - type: boolean - server: - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - properties: - claimName: - type: string - readOnly: - type: boolean - required: - - claimName - type: object - photonPersistentDisk: - properties: - fsType: - type: string - pdID: - type: string - required: - - pdID - type: object - portworxVolume: - properties: - fsType: - type: string - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - projected: - properties: - defaultMode: - format: int32 - type: integer - sources: - items: - properties: - configMap: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - downwardAPI: - properties: - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - secret: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - serviceAccountToken: - properties: - audience: - type: string - expirationSeconds: - format: int64 - type: integer - path: - type: string - required: - - path - type: object - type: object - type: array - type: object - quobyte: - properties: - group: - type: string - readOnly: - type: boolean - registry: - type: string - tenant: - type: string - user: - type: string - volume: - type: string - required: - - registry - - volume - type: object - rbd: - properties: - fsType: - type: string - image: - type: string - keyring: - type: string - monitors: - items: - type: string - type: array - pool: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - image - - monitors - type: object - scaleIO: - properties: - fsType: - type: string - gateway: - type: string - protectionDomain: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - sslEnabled: - type: boolean - storageMode: - type: string - storagePool: - type: string - system: - type: string - volumeName: - type: string - required: - - gateway - - secretRef - - system - type: object - secret: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - optional: - type: boolean - secretName: - type: string - type: object - storageos: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeName: - type: string - volumeNamespace: - type: string - type: object - vsphereVolume: - properties: - fsType: - type: string - storagePolicyID: - type: string - storagePolicyName: - type: string - volumePath: - type: string - required: - - volumePath - type: object - required: - - name - type: object - type: array - sidecars: - items: - properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - type: object - required: - - name - type: object - type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - default: TCP - type: string - required: - - containerPort - type: object - type: array - x-kubernetes-list-map-keys: - - containerPort - - protocol - x-kubernetes-list-type: map - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: - properties: - devicePath: - type: string - name: - type: string - required: - - devicePath - - name - type: object - type: array - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - required: - - mountPath - - name - type: object - type: array - workingDir: - type: string - required: - - name - type: object - type: array - size: - format: int32 - type: integer - tolerations: - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - type: object - required: - - enabled - type: object - tls: - properties: - certValidityDuration: - type: string - type: object - unmanaged: - type: boolean - updateStrategy: - type: string - upgradeOptions: - properties: - apply: - type: string - schedule: - type: string - setFCV: - type: boolean - versionServiceEndpoint: - type: string - type: object - type: object - status: - properties: - backup: - type: string - backupVersion: - type: string - conditions: - items: - properties: - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - status - - type - type: object - type: array - host: - type: string - message: - type: string - mongoImage: - type: string - mongoVersion: - type: string - mongos: - properties: - message: - type: string - ready: - type: integer - size: - type: integer - status: - type: string - required: - - ready - - size - type: object - observedGeneration: - format: int64 - type: integer - pmmStatus: - type: string - pmmVersion: - type: string - ready: - format: int32 - type: integer - replsets: - additionalProperties: - properties: - added_as_shard: - type: boolean - clusterRole: - type: string - initialized: - type: boolean - members: - items: - properties: - name: - type: string - version: - type: string - type: object - type: array - message: - type: string - ready: - format: int32 - type: integer - size: - format: int32 - type: integer - status: - type: string - required: - - ready - - size - type: object - type: object - size: - format: int32 - type: integer - state: - type: string - required: - - ready - - size - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/docs/proposals/dbaas/01-architecture/pxctpl.dbaas.percona.com.cr.yaml b/docs/proposals/dbaas/01-architecture/pxctpl.dbaas.percona.com.cr.yaml deleted file mode 100644 index 515281b9b3..0000000000 --- a/docs/proposals/dbaas/01-architecture/pxctpl.dbaas.percona.com.cr.yaml +++ /dev/null @@ -1,579 +0,0 @@ -apiVersion: dbaas.percona.com/v1alpha1 -kind: PXCtemplate -metadata: - name: prod-app-n-large - annotations: - dbaas.percona.com/dbtemplate-origin: sre -# percona.com/issue-vault-token: "false" - labels: - dbaas.percona.com/engine: pxc - dbaas.percona.com/template: "yes" - IsDefaultTpl: "yes" -spec: - crVersion: 1.11.0 -# secretsName: my-cluster-secrets -# vaultSecretName: keyring-secret-vault -# sslSecretName: my-cluster-ssl -# sslInternalSecretName: my-cluster-ssl-internal -# logCollectorSecretName: my-log-collector-secrets -# initImage: percona/percona-xtradb-cluster-operator:1.11.0 -# enableCRValidationWebhook: true -# tls: -# SANs: -# - pxc-1.example.com -# - pxc-2.example.com -# - pxc-3.example.com -# issuerConf: -# name: special-selfsigned-issuer -# kind: ClusterIssuer -# group: cert-manager.io - allowUnsafeConfigurations: false -# pause: false - updateStrategy: SmartUpdate - upgradeOptions: - versionServiceEndpoint: https://check.percona.com - apply: 8.0-recommended - schedule: "0 4 * * *" - pxc: - size: 3 - image: percona/percona-xtradb-cluster:8.0.27-18.1 - autoRecovery: true -# expose: -# enabled: true -# type: LoadBalancer -# trafficPolicy: Local -# loadBalancerSourceRanges: -# - 10.0.0.0/8 -# annotations: -# networking.gke.io/load-balancer-type: "Internal" -# replicationChannels: -# - name: pxc1_to_pxc2 -# isSource: true -# - name: pxc2_to_pxc1 -# isSource: false -# configuration: -# sourceRetryCount: 3 -# sourceConnectRetry: 60 -# sourcesList: -# - host: 10.95.251.101 -# port: 3306 -# weight: 100 -# schedulerName: mycustom-scheduler -# readinessDelaySec: 15 -# livenessDelaySec: 600 -# configuration: | -# [mysqld] -# wsrep_debug=CLIENT -# wsrep_provider_options="gcache.size=1G; gcache.recover=yes" -# [sst] -# xbstream-opts=--decompress -# [xtrabackup] -# compress=lz4 -# for PXC 5.7 -# [xtrabackup] -# compress -# imagePullSecrets: -# - name: private-registry-credentials -# priorityClassName: high-priority -# annotations: -# iam.amazonaws.com/role: role-arn -# labels: -# rack: rack-22 -# readinessProbes: -# initialDelaySeconds: 15 -# timeoutSeconds: 15 -# periodSeconds: 30 -# successThreshold: 1 -# failureThreshold: 5 -# livenessProbes: -# initialDelaySeconds: 300 -# timeoutSeconds: 5 -# periodSeconds: 10 -# successThreshold: 1 -# failureThreshold: 3 -# containerSecurityContext: -# privileged: false -# podSecurityContext: -# runAsUser: 1001 -# runAsGroup: 1001 -# supplementalGroups: [1001] -# serviceAccountName: percona-xtradb-cluster-operator-workload -# imagePullPolicy: Always -# runtimeClassName: image-rc -# sidecars: -# - image: busybox -# command: ["/bin/sh"] -# args: ["-c", "while true; do trap 'exit 0' SIGINT SIGTERM SIGQUIT SIGKILL; done;"] -# name: my-sidecar-1 -# resources: -# requests: -# memory: 100M -# cpu: 100m -# limits: -# memory: 200M -# cpu: 200m -# envVarsSecret: my-env-var-secrets - resources: - requests: - memory: 1G - cpu: 600m -# ephemeral-storage: 1G -# limits: -# memory: 1G -# cpu: "1" -# ephemeral-storage: 1G -# nodeSelector: -# disktype: ssd - affinity: - antiAffinityTopologyKey: "kubernetes.io/hostname" -# advanced: -# nodeAffinity: -# requiredDuringSchedulingIgnoredDuringExecution: -# nodeSelectorTerms: -# - matchExpressions: -# - key: kubernetes.io/e2e-az-name -# operator: In -# values: -# - e2e-az1 -# - e2e-az2 -# tolerations: -# - key: "node.alpha.kubernetes.io/unreachable" -# operator: "Exists" -# effect: "NoExecute" -# tolerationSeconds: 6000 - podDisruptionBudget: - maxUnavailable: 1 -# minAvailable: 0 - volumeSpec: -# emptyDir: {} -# hostPath: -# path: /data -# type: Directory - persistentVolumeClaim: -# storageClassName: standard -# accessModes: [ "ReadWriteOnce" ] - resources: - requests: - storage: 6G - gracePeriod: 600 - haproxy: - enabled: true - size: 3 - image: percona/percona-xtradb-cluster-operator:1.11.0-haproxy -# replicasServiceEnabled: false -# imagePullPolicy: Always -# schedulerName: mycustom-scheduler -# readinessDelaySec: 15 -# livenessDelaySec: 600 -# configuration: | -# -# the actual default configuration file can be found here https://github.com/percona/percona-docker/blob/main/haproxy/dockerdir/etc/haproxy/haproxy-global.cfg -# -# global -# maxconn 2048 -# external-check -# insecure-fork-wanted -# stats socket /etc/haproxy/pxc/haproxy.sock mode 600 expose-fd listeners level admin -# -# defaults -# default-server init-addr last,libc,none -# log global -# mode tcp -# retries 10 -# timeout client 28800s -# timeout connect 100500 -# timeout server 28800s -# -# frontend galera-in -# bind *:3309 accept-proxy -# bind *:3306 -# mode tcp -# option clitcpka -# default_backend galera-nodes -# -# frontend galera-admin-in -# bind *:33062 -# mode tcp -# option clitcpka -# default_backend galera-admin-nodes -# -# frontend galera-replica-in -# bind *:3307 -# mode tcp -# option clitcpka -# default_backend galera-replica-nodes -# -# frontend galera-mysqlx-in -# bind *:33060 -# mode tcp -# option clitcpka -# default_backend galera-mysqlx-nodes -# -# frontend stats -# bind *:8404 -# mode http -# option http-use-htx -# http-request use-service prometheus-exporter if { path /metrics } -# imagePullSecrets: -# - name: private-registry-credentials -# annotations: -# iam.amazonaws.com/role: role-arn -# labels: -# rack: rack-22 -# readinessProbes: -# initialDelaySeconds: 15 -# timeoutSeconds: 1 -# periodSeconds: 5 -# successThreshold: 1 -# failureThreshold: 3 -# livenessProbes: -# initialDelaySeconds: 60 -# timeoutSeconds: 5 -# periodSeconds: 30 -# successThreshold: 1 -# failureThreshold: 4 -# serviceType: ClusterIP -# externalTrafficPolicy: Cluster -# replicasServiceType: ClusterIP -# replicasExternalTrafficPolicy: Cluster -# runtimeClassName: image-rc -# sidecars: -# - image: busybox -# command: ["/bin/sh"] -# args: ["-c", "while true; do trap 'exit 0' SIGINT SIGTERM SIGQUIT SIGKILL; done;"] -# name: my-sidecar-1 -# resources: -# requests: -# memory: 100M -# cpu: 100m -# limits: -# memory: 200M -# cpu: 200m -# envVarsSecret: my-env-var-secrets - resources: - requests: - memory: 1G - cpu: 600m -# limits: -# memory: 1G -# cpu: 700m -# priorityClassName: high-priority -# nodeSelector: -# disktype: ssd -# sidecarResources: -# requests: -# memory: 1G -# cpu: 500m -# limits: -# memory: 2G -# cpu: 600m -# containerSecurityContext: -# privileged: false -# podSecurityContext: -# runAsUser: 1001 -# runAsGroup: 1001 -# supplementalGroups: [1001] -# serviceAccountName: percona-xtradb-cluster-operator-workload - affinity: - antiAffinityTopologyKey: "kubernetes.io/hostname" -# advanced: -# nodeAffinity: -# requiredDuringSchedulingIgnoredDuringExecution: -# nodeSelectorTerms: -# - matchExpressions: -# - key: kubernetes.io/e2e-az-name -# operator: In -# values: -# - e2e-az1 -# - e2e-az2 -# tolerations: -# - key: "node.alpha.kubernetes.io/unreachable" -# operator: "Exists" -# effect: "NoExecute" -# tolerationSeconds: 6000 - podDisruptionBudget: - maxUnavailable: 1 -# minAvailable: 0 - gracePeriod: 30 -# loadBalancerSourceRanges: -# - 10.0.0.0/8 -# serviceAnnotations: -# service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http -# serviceLabels: -# rack: rack-23 - proxysql: - enabled: false - size: 3 - image: percona/percona-xtradb-cluster-operator:1.11.0-proxysql -# imagePullPolicy: Always -# configuration: | -# datadir="/var/lib/proxysql" -# -# admin_variables = -# { -# admin_credentials="proxyadmin:admin_password" -# mysql_ifaces="0.0.0.0:6032" -# refresh_interval=2000 -# -# cluster_username="proxyadmin" -# cluster_password="admin_password" -# checksum_admin_variables=false -# checksum_ldap_variables=false -# checksum_mysql_variables=false -# cluster_check_interval_ms=200 -# cluster_check_status_frequency=100 -# cluster_mysql_query_rules_save_to_disk=true -# cluster_mysql_servers_save_to_disk=true -# cluster_mysql_users_save_to_disk=true -# cluster_proxysql_servers_save_to_disk=true -# cluster_mysql_query_rules_diffs_before_sync=1 -# cluster_mysql_servers_diffs_before_sync=1 -# cluster_mysql_users_diffs_before_sync=1 -# cluster_proxysql_servers_diffs_before_sync=1 -# } -# -# mysql_variables= -# { -# monitor_password="monitor" -# monitor_galera_healthcheck_interval=1000 -# threads=2 -# max_connections=2048 -# default_query_delay=0 -# default_query_timeout=10000 -# poll_timeout=2000 -# interfaces="0.0.0.0:3306" -# default_schema="information_schema" -# stacksize=1048576 -# connect_timeout_server=10000 -# monitor_history=60000 -# monitor_connect_interval=20000 -# monitor_ping_interval=10000 -# ping_timeout_server=200 -# commands_stats=true -# sessions_sort=true -# have_ssl=true -# ssl_p2s_ca="/etc/proxysql/ssl-internal/ca.crt" -# ssl_p2s_cert="/etc/proxysql/ssl-internal/tls.crt" -# ssl_p2s_key="/etc/proxysql/ssl-internal/tls.key" -# ssl_p2s_cipher="ECDHE-RSA-AES128-GCM-SHA256" -# } -# readinessDelaySec: 15 -# livenessDelaySec: 600 -# schedulerName: mycustom-scheduler -# imagePullSecrets: -# - name: private-registry-credentials -# annotations: -# iam.amazonaws.com/role: role-arn -# labels: -# rack: rack-22 -# serviceType: ClusterIP -# externalTrafficPolicy: Cluster -# runtimeClassName: image-rc -# sidecars: -# - image: busybox -# command: ["/bin/sh"] -# args: ["-c", "while true; do trap 'exit 0' SIGINT SIGTERM SIGQUIT SIGKILL; done;"] -# name: my-sidecar-1 -# resources: -# requests: -# memory: 100M -# cpu: 100m -# limits: -# memory: 200M -# cpu: 200m -# envVarsSecret: my-env-var-secrets - resources: - requests: - memory: 1G - cpu: 600m -# limits: -# memory: 1G -# cpu: 700m -# priorityClassName: high-priority -# nodeSelector: -# disktype: ssd -# sidecarResources: -# requests: -# memory: 1G -# cpu: 500m -# limits: -# memory: 2G -# cpu: 600m -# containerSecurityContext: -# privileged: false -# podSecurityContext: -# runAsUser: 1001 -# runAsGroup: 1001 -# supplementalGroups: [1001] -# serviceAccountName: percona-xtradb-cluster-operator-workload - affinity: - antiAffinityTopologyKey: "kubernetes.io/hostname" -# advanced: -# nodeAffinity: -# requiredDuringSchedulingIgnoredDuringExecution: -# nodeSelectorTerms: -# - matchExpressions: -# - key: kubernetes.io/e2e-az-name -# operator: In -# values: -# - e2e-az1 -# - e2e-az2 -# tolerations: -# - key: "node.alpha.kubernetes.io/unreachable" -# operator: "Exists" -# effect: "NoExecute" -# tolerationSeconds: 6000 - volumeSpec: -# emptyDir: {} -# hostPath: -# path: /data -# type: Directory - persistentVolumeClaim: -# storageClassName: standard -# accessModes: [ "ReadWriteOnce" ] - resources: - requests: - storage: 2G - podDisruptionBudget: - maxUnavailable: 1 -# minAvailable: 0 - gracePeriod: 30 -# loadBalancerSourceRanges: -# - 10.0.0.0/8 -# serviceAnnotations: -# service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http -# serviceLabels: -# rack: rack-23 - logcollector: - enabled: true - image: percona/percona-xtradb-cluster-operator:1.11.0-logcollector -# configuration: | -# [OUTPUT] -# Name es -# Match * -# Host 192.168.2.3 -# Port 9200 -# Index my_index -# Type my_type - resources: - requests: - memory: 100M - cpu: 200m - pmm: - enabled: false - image: percona/pmm-client:2.28.0 - serverHost: monitoring-service -# serverUser: admin -# pxcParams: "--disable-tablestats-limit=2000" -# proxysqlParams: "--custom-labels=CUSTOM-LABELS" - resources: - requests: - memory: 150M - cpu: 300m - backup: - image: percona/percona-xtradb-cluster-operator:1.11.0-pxc8.0-backup -# backoffLimit: 6 -# serviceAccountName: percona-xtradb-cluster-operator -# imagePullSecrets: -# - name: private-registry-credentials - pitr: - enabled: false - storageName: STORAGE-NAME-HERE - timeBetweenUploads: 60 -# resources: -# requests: -# memory: 0.1G -# cpu: 100m -# limits: -# memory: 1G -# cpu: 700m - storages: - s3-us-west: - type: s3 - verifyTLS: true -# nodeSelector: -# storage: tape -# backupWorker: 'True' -# resources: -# requests: -# memory: 1G -# cpu: 600m -# affinity: -# nodeAffinity: -# requiredDuringSchedulingIgnoredDuringExecution: -# nodeSelectorTerms: -# - matchExpressions: -# - key: backupWorker -# operator: In -# values: -# - 'True' -# tolerations: -# - key: "backupWorker" -# operator: "Equal" -# value: "True" -# effect: "NoSchedule" -# annotations: -# testName: scheduled-backup -# labels: -# backupWorker: 'True' -# schedulerName: 'default-scheduler' -# priorityClassName: 'high-priority' -# containerSecurityContext: -# privileged: true -# podSecurityContext: -# fsGroup: 1001 -# supplementalGroups: [1001, 1002, 1003] - s3: - bucket: S3-BACKUP-BUCKET-NAME-HERE - credentialsSecret: my-cluster-name-backup-s3 - region: us-west-2 - fs-pvc: - type: filesystem -# nodeSelector: -# storage: tape -# backupWorker: 'True' -# resources: -# requests: -# memory: 1G -# cpu: 600m -# affinity: -# nodeAffinity: -# requiredDuringSchedulingIgnoredDuringExecution: -# nodeSelectorTerms: -# - matchExpressions: -# - key: backupWorker -# operator: In -# values: -# - 'True' -# tolerations: -# - key: "backupWorker" -# operator: "Equal" -# value: "True" -# effect: "NoSchedule" -# annotations: -# testName: scheduled-backup -# labels: -# backupWorker: 'True' -# schedulerName: 'default-scheduler' -# priorityClassName: 'high-priority' -# containerSecurityContext: -# privileged: true -# podSecurityContext: -# fsGroup: 1001 -# supplementalGroups: [1001, 1002, 1003] - volume: - persistentVolumeClaim: -# storageClassName: standard - accessModes: [ "ReadWriteOnce" ] - resources: - requests: - storage: 6G - schedule: - - name: "sat-night-backup" - schedule: "0 0 * * 6" - keep: 3 - storageName: s3-us-west - - name: "daily-backup" - schedule: "0 0 * * *" - keep: 5 - storageName: fs-pvc diff --git a/docs/proposals/dbaas/01-architecture/pxctpl.dbaas.percona.com.crd.yaml b/docs/proposals/dbaas/01-architecture/pxctpl.dbaas.percona.com.crd.yaml deleted file mode 100644 index 1a60ff1c47..0000000000 --- a/docs/proposals/dbaas/01-architecture/pxctpl.dbaas.percona.com.crd.yaml +++ /dev/null @@ -1,8107 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: pxctemplates.dbaas.percona.com - annotations: - dbaas.percona.com/dbtemplate-engine: pxc -spec: - group: dbaas.percona.com - names: - kind: PXCtemplate - plural: pxctemplates - singular: pxctemplate - shortNames: - - pxctpl - scope: Namespaced - versions: - - name: v1alpha1 - additionalPrinterColumns: - - jsonPath: .status.host - name: Endpoint - type: string - - jsonPath: .status.state - name: Status - type: string - - description: Ready pxc nodes - jsonPath: .status.pxc.ready - name: PXC - type: string - - description: Ready proxysql nodes - jsonPath: .status.proxysql.ready - name: proxysql - type: string - - description: Ready haproxy nodes - jsonPath: .status.haproxy.ready - name: haproxy - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - schema: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - allowUnsafeConfigurations: - type: boolean - backup: - properties: - annotations: - additionalProperties: - type: string - type: object - backoffLimit: - format: int32 - type: integer - image: - type: string - imagePullPolicy: - type: string - imagePullSecrets: - items: - properties: - name: - type: string - type: object - type: array - pitr: - properties: - enabled: - type: boolean - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - storageName: - type: string - timeBetweenUploads: - type: number - type: object - schedule: - items: - properties: - keep: - type: integer - name: - type: string - schedule: - type: string - storageName: - type: string - type: object - type: array - serviceAccountName: - type: string - storages: - additionalProperties: - properties: - affinity: - properties: - nodeAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - preference: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - weight: - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - annotations: - additionalProperties: - type: string - type: object - containerSecurityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - labels: - additionalProperties: - type: string - type: object - nodeSelector: - additionalProperties: - type: string - type: object - podSecurityContext: - properties: - fsGroup: - format: int64 - type: integer - fsGroupChangePolicy: - type: string - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - supplementalGroups: - items: - format: int64 - type: integer - type: array - sysctls: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - priorityClassName: - type: string - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - runtimeClassName: - type: string - s3: - properties: - bucket: - type: string - credentialsSecret: - type: string - endpointUrl: - type: string - region: - type: string - type: object - schedulerName: - type: string - tolerations: - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - type: - type: string - verifyTLS: - type: boolean - volume: - properties: - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - persistentVolumeClaim: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - type: object - type: object - type: object - type: object - crVersion: - type: string - enableCRValidationWebhook: - type: boolean - haproxy: - properties: - affinity: - properties: - advanced: - properties: - nodeAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - preference: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - weight: - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - antiAffinityTopologyKey: - type: string - type: object - annotations: - additionalProperties: - type: string - type: object - configuration: - type: string - containerSecurityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - enabled: - type: boolean - envVarsSecret: - type: string - externalTrafficPolicy: - type: string - forceUnsafeBootstrap: - type: boolean - gracePeriod: - format: int64 - type: integer - hookScript: - type: string - image: - type: string - imagePullPolicy: - type: string - imagePullSecrets: - items: - properties: - name: - type: string - type: object - type: array - labels: - additionalProperties: - type: string - type: object - livenessDelaySec: - format: int32 - type: integer - livenessProbes: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - loadBalancerSourceRanges: - items: - type: string - type: array - nodeSelector: - additionalProperties: - type: string - type: object - podDisruptionBudget: - properties: - maxUnavailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - minAvailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - type: object - podSecurityContext: - properties: - fsGroup: - format: int64 - type: integer - fsGroupChangePolicy: - type: string - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - supplementalGroups: - items: - format: int64 - type: integer - type: array - sysctls: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - priorityClassName: - type: string - readinessDelaySec: - format: int32 - type: integer - readinessProbes: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - replicasExternalTrafficPolicy: - type: string - replicasServiceEnabled: - type: boolean - replicasServiceType: - type: string - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - runtimeClassName: - type: string - schedulerName: - type: string - serviceAccountName: - type: string - serviceAnnotations: - additionalProperties: - type: string - type: object - serviceLabels: - additionalProperties: - type: string - type: object - serviceType: - type: string - sidecarPVCs: - items: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - status: - properties: - accessModes: - items: - type: string - type: array - allocatedResources: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - capacity: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - status - - type - type: object - type: array - phase: - type: string - resizeStatus: - type: string - type: object - type: object - type: array - sidecarResources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - sidecarVolumes: - items: - properties: - awsElasticBlockStore: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - azureDisk: - properties: - cachingMode: - type: string - diskName: - type: string - diskURI: - type: string - fsType: - type: string - kind: - type: string - readOnly: - type: boolean - required: - - diskName - - diskURI - type: object - azureFile: - properties: - readOnly: - type: boolean - secretName: - type: string - shareName: - type: string - required: - - secretName - - shareName - type: object - cephfs: - properties: - monitors: - items: - type: string - type: array - path: - type: string - readOnly: - type: boolean - secretFile: - type: string - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - monitors - type: object - cinder: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeID: - type: string - required: - - volumeID - type: object - configMap: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - csi: - properties: - driver: - type: string - fsType: - type: string - nodePublishSecretRef: - properties: - name: - type: string - type: object - readOnly: - type: boolean - volumeAttributes: - additionalProperties: - type: string - type: object - required: - - driver - type: object - downwardAPI: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: - properties: - volumeClaimTemplate: - properties: - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - required: - - spec - type: object - type: object - fc: - properties: - fsType: - type: string - lun: - format: int32 - type: integer - readOnly: - type: boolean - targetWWNs: - items: - type: string - type: array - wwids: - items: - type: string - type: array - type: object - flexVolume: - properties: - driver: - type: string - fsType: - type: string - options: - additionalProperties: - type: string - type: object - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - required: - - driver - type: object - flocker: - properties: - datasetName: - type: string - datasetUUID: - type: string - type: object - gcePersistentDisk: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - pdName: - type: string - readOnly: - type: boolean - required: - - pdName - type: object - gitRepo: - properties: - directory: - type: string - repository: - type: string - revision: - type: string - required: - - repository - type: object - glusterfs: - properties: - endpoints: - type: string - path: - type: string - readOnly: - type: boolean - required: - - endpoints - - path - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - iscsi: - properties: - chapAuthDiscovery: - type: boolean - chapAuthSession: - type: boolean - fsType: - type: string - initiatorName: - type: string - iqn: - type: string - iscsiInterface: - type: string - lun: - format: int32 - type: integer - portals: - items: - type: string - type: array - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - targetPortal: - type: string - required: - - iqn - - lun - - targetPortal - type: object - name: - type: string - nfs: - properties: - path: - type: string - readOnly: - type: boolean - server: - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - properties: - claimName: - type: string - readOnly: - type: boolean - required: - - claimName - type: object - photonPersistentDisk: - properties: - fsType: - type: string - pdID: - type: string - required: - - pdID - type: object - portworxVolume: - properties: - fsType: - type: string - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - projected: - properties: - defaultMode: - format: int32 - type: integer - sources: - items: - properties: - configMap: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - downwardAPI: - properties: - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - secret: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - serviceAccountToken: - properties: - audience: - type: string - expirationSeconds: - format: int64 - type: integer - path: - type: string - required: - - path - type: object - type: object - type: array - type: object - quobyte: - properties: - group: - type: string - readOnly: - type: boolean - registry: - type: string - tenant: - type: string - user: - type: string - volume: - type: string - required: - - registry - - volume - type: object - rbd: - properties: - fsType: - type: string - image: - type: string - keyring: - type: string - monitors: - items: - type: string - type: array - pool: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - image - - monitors - type: object - scaleIO: - properties: - fsType: - type: string - gateway: - type: string - protectionDomain: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - sslEnabled: - type: boolean - storageMode: - type: string - storagePool: - type: string - system: - type: string - volumeName: - type: string - required: - - gateway - - secretRef - - system - type: object - secret: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - optional: - type: boolean - secretName: - type: string - type: object - storageos: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeName: - type: string - volumeNamespace: - type: string - type: object - vsphereVolume: - properties: - fsType: - type: string - storagePolicyID: - type: string - storagePolicyName: - type: string - volumePath: - type: string - required: - - volumePath - type: object - required: - - name - type: object - type: array - sidecars: - items: - properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - type: object - required: - - name - type: object - type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - default: TCP - type: string - required: - - protocol - - containerPort - type: object - type: array - x-kubernetes-list-map-keys: - - protocol - - containerPort - x-kubernetes-list-type: map - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: - properties: - devicePath: - type: string - name: - type: string - required: - - devicePath - - name - type: object - type: array - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - required: - - mountPath - - name - type: object - type: array - workingDir: - type: string - required: - - name - type: object - type: array - size: - format: int32 - type: integer - sslInternalSecretName: - type: string - sslSecretName: - type: string - tolerations: - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - vaultSecretName: - type: string - volumeSpec: - properties: - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - persistentVolumeClaim: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - type: object - type: object - initImage: - type: string - logCollectorSecretName: - type: string - logcollector: - properties: - configuration: - type: string - containerSecurityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - enabled: - type: boolean - hookScript: - type: string - image: - type: string - imagePullPolicy: - type: string - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - runtimeClassName: - type: string - type: object - pause: - type: boolean - platform: - type: string - pmm: - properties: - containerSecurityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - enabled: - type: boolean - image: - type: string - imagePullPolicy: - type: string - proxysqlParams: - type: string - pxcParams: - type: string - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - runtimeClassName: - type: string - serverHost: - type: string - serverUser: - type: string - type: object - proxysql: - properties: - affinity: - properties: - advanced: - properties: - nodeAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - preference: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - weight: - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - antiAffinityTopologyKey: - type: string - type: object - annotations: - additionalProperties: - type: string - type: object - configuration: - type: string - containerSecurityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - enabled: - type: boolean - envVarsSecret: - type: string - externalTrafficPolicy: - type: string - forceUnsafeBootstrap: - type: boolean - gracePeriod: - format: int64 - type: integer - hookScript: - type: string - image: - type: string - imagePullPolicy: - type: string - imagePullSecrets: - items: - properties: - name: - type: string - type: object - type: array - labels: - additionalProperties: - type: string - type: object - livenessDelaySec: - format: int32 - type: integer - livenessProbes: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - loadBalancerSourceRanges: - items: - type: string - type: array - nodeSelector: - additionalProperties: - type: string - type: object - podDisruptionBudget: - properties: - maxUnavailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - minAvailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - type: object - podSecurityContext: - properties: - fsGroup: - format: int64 - type: integer - fsGroupChangePolicy: - type: string - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - supplementalGroups: - items: - format: int64 - type: integer - type: array - sysctls: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - priorityClassName: - type: string - readinessDelaySec: - format: int32 - type: integer - readinessProbes: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - replicasExternalTrafficPolicy: - type: string - replicasServiceType: - type: string - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - runtimeClassName: - type: string - schedulerName: - type: string - serviceAccountName: - type: string - serviceAnnotations: - additionalProperties: - type: string - type: object - serviceLabels: - additionalProperties: - type: string - type: object - serviceType: - type: string - sidecarPVCs: - items: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - status: - properties: - accessModes: - items: - type: string - type: array - allocatedResources: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - capacity: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - status - - type - type: object - type: array - phase: - type: string - resizeStatus: - type: string - type: object - type: object - type: array - sidecarResources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - sidecarVolumes: - items: - properties: - awsElasticBlockStore: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - azureDisk: - properties: - cachingMode: - type: string - diskName: - type: string - diskURI: - type: string - fsType: - type: string - kind: - type: string - readOnly: - type: boolean - required: - - diskName - - diskURI - type: object - azureFile: - properties: - readOnly: - type: boolean - secretName: - type: string - shareName: - type: string - required: - - secretName - - shareName - type: object - cephfs: - properties: - monitors: - items: - type: string - type: array - path: - type: string - readOnly: - type: boolean - secretFile: - type: string - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - monitors - type: object - cinder: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeID: - type: string - required: - - volumeID - type: object - configMap: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - csi: - properties: - driver: - type: string - fsType: - type: string - nodePublishSecretRef: - properties: - name: - type: string - type: object - readOnly: - type: boolean - volumeAttributes: - additionalProperties: - type: string - type: object - required: - - driver - type: object - downwardAPI: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: - properties: - volumeClaimTemplate: - properties: - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - required: - - spec - type: object - type: object - fc: - properties: - fsType: - type: string - lun: - format: int32 - type: integer - readOnly: - type: boolean - targetWWNs: - items: - type: string - type: array - wwids: - items: - type: string - type: array - type: object - flexVolume: - properties: - driver: - type: string - fsType: - type: string - options: - additionalProperties: - type: string - type: object - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - required: - - driver - type: object - flocker: - properties: - datasetName: - type: string - datasetUUID: - type: string - type: object - gcePersistentDisk: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - pdName: - type: string - readOnly: - type: boolean - required: - - pdName - type: object - gitRepo: - properties: - directory: - type: string - repository: - type: string - revision: - type: string - required: - - repository - type: object - glusterfs: - properties: - endpoints: - type: string - path: - type: string - readOnly: - type: boolean - required: - - endpoints - - path - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - iscsi: - properties: - chapAuthDiscovery: - type: boolean - chapAuthSession: - type: boolean - fsType: - type: string - initiatorName: - type: string - iqn: - type: string - iscsiInterface: - type: string - lun: - format: int32 - type: integer - portals: - items: - type: string - type: array - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - targetPortal: - type: string - required: - - iqn - - lun - - targetPortal - type: object - name: - type: string - nfs: - properties: - path: - type: string - readOnly: - type: boolean - server: - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - properties: - claimName: - type: string - readOnly: - type: boolean - required: - - claimName - type: object - photonPersistentDisk: - properties: - fsType: - type: string - pdID: - type: string - required: - - pdID - type: object - portworxVolume: - properties: - fsType: - type: string - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - projected: - properties: - defaultMode: - format: int32 - type: integer - sources: - items: - properties: - configMap: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - downwardAPI: - properties: - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - secret: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - serviceAccountToken: - properties: - audience: - type: string - expirationSeconds: - format: int64 - type: integer - path: - type: string - required: - - path - type: object - type: object - type: array - type: object - quobyte: - properties: - group: - type: string - readOnly: - type: boolean - registry: - type: string - tenant: - type: string - user: - type: string - volume: - type: string - required: - - registry - - volume - type: object - rbd: - properties: - fsType: - type: string - image: - type: string - keyring: - type: string - monitors: - items: - type: string - type: array - pool: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - image - - monitors - type: object - scaleIO: - properties: - fsType: - type: string - gateway: - type: string - protectionDomain: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - sslEnabled: - type: boolean - storageMode: - type: string - storagePool: - type: string - system: - type: string - volumeName: - type: string - required: - - gateway - - secretRef - - system - type: object - secret: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - optional: - type: boolean - secretName: - type: string - type: object - storageos: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeName: - type: string - volumeNamespace: - type: string - type: object - vsphereVolume: - properties: - fsType: - type: string - storagePolicyID: - type: string - storagePolicyName: - type: string - volumePath: - type: string - required: - - volumePath - type: object - required: - - name - type: object - type: array - sidecars: - items: - properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - type: object - required: - - name - type: object - type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - default: TCP - type: string - required: - - protocol - - containerPort - type: object - type: array - x-kubernetes-list-map-keys: - - protocol - - containerPort - x-kubernetes-list-type: map - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: - properties: - devicePath: - type: string - name: - type: string - required: - - devicePath - - name - type: object - type: array - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - required: - - mountPath - - name - type: object - type: array - workingDir: - type: string - required: - - name - type: object - type: array - size: - format: int32 - type: integer - sslInternalSecretName: - type: string - sslSecretName: - type: string - tolerations: - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - vaultSecretName: - type: string - volumeSpec: - properties: - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - persistentVolumeClaim: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - type: object - type: object - pxc: - properties: - affinity: - properties: - advanced: - properties: - nodeAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - preference: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - weight: - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - properties: - nodeSelectorTerms: - items: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - type: array - required: - - nodeSelectorTerms - type: object - type: object - podAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - properties: - preferredDuringSchedulingIgnoredDuringExecution: - items: - properties: - podAffinityTerm: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - weight: - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - items: - properties: - labelSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaceSelector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - namespaces: - items: - type: string - type: array - topologyKey: - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - antiAffinityTopologyKey: - type: string - type: object - annotations: - additionalProperties: - type: string - type: object - autoRecovery: - type: boolean - configuration: - type: string - containerSecurityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - enabled: - type: boolean - envVarsSecret: - type: string - expose: - properties: - annotations: - additionalProperties: - type: string - type: object - enabled: - type: boolean - loadBalancerSourceRanges: - items: - type: string - type: array - trafficPolicy: - type: string - type: - type: string - type: object - externalTrafficPolicy: - type: string - forceUnsafeBootstrap: - type: boolean - gracePeriod: - format: int64 - type: integer - hookScript: - type: string - image: - type: string - imagePullPolicy: - type: string - imagePullSecrets: - items: - properties: - name: - type: string - type: object - type: array - labels: - additionalProperties: - type: string - type: object - livenessDelaySec: - format: int32 - type: integer - livenessProbes: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - loadBalancerSourceRanges: - items: - type: string - type: array - nodeSelector: - additionalProperties: - type: string - type: object - podDisruptionBudget: - properties: - maxUnavailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - minAvailable: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - type: object - podSecurityContext: - properties: - fsGroup: - format: int64 - type: integer - fsGroupChangePolicy: - type: string - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - supplementalGroups: - items: - format: int64 - type: integer - type: array - sysctls: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - priorityClassName: - type: string - readinessDelaySec: - format: int32 - type: integer - readinessProbes: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - replicasExternalTrafficPolicy: - type: string - replicasServiceType: - type: string - replicationChannels: - items: - properties: - configuration: - properties: - sourceConnectRetry: - type: integer - sourceRetryCount: - type: integer - type: object - isSource: - type: boolean - name: - type: string - sourcesList: - items: - properties: - host: - type: string - port: - type: integer - weight: - type: integer - type: object - type: array - type: object - type: array - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - runtimeClassName: - type: string - schedulerName: - type: string - serviceAccountName: - type: string - serviceAnnotations: - additionalProperties: - type: string - type: object - serviceLabels: - additionalProperties: - type: string - type: object - serviceType: - type: string - sidecarPVCs: - items: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - status: - properties: - accessModes: - items: - type: string - type: array - allocatedResources: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - capacity: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - conditions: - items: - properties: - lastProbeTime: - format: date-time - type: string - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - required: - - status - - type - type: object - type: array - phase: - type: string - resizeStatus: - type: string - type: object - type: object - type: array - sidecarResources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - sidecarVolumes: - items: - properties: - awsElasticBlockStore: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - azureDisk: - properties: - cachingMode: - type: string - diskName: - type: string - diskURI: - type: string - fsType: - type: string - kind: - type: string - readOnly: - type: boolean - required: - - diskName - - diskURI - type: object - azureFile: - properties: - readOnly: - type: boolean - secretName: - type: string - shareName: - type: string - required: - - secretName - - shareName - type: object - cephfs: - properties: - monitors: - items: - type: string - type: array - path: - type: string - readOnly: - type: boolean - secretFile: - type: string - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - monitors - type: object - cinder: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeID: - type: string - required: - - volumeID - type: object - configMap: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - csi: - properties: - driver: - type: string - fsType: - type: string - nodePublishSecretRef: - properties: - name: - type: string - type: object - readOnly: - type: boolean - volumeAttributes: - additionalProperties: - type: string - type: object - required: - - driver - type: object - downwardAPI: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: - properties: - volumeClaimTemplate: - properties: - metadata: - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - required: - - spec - type: object - type: object - fc: - properties: - fsType: - type: string - lun: - format: int32 - type: integer - readOnly: - type: boolean - targetWWNs: - items: - type: string - type: array - wwids: - items: - type: string - type: array - type: object - flexVolume: - properties: - driver: - type: string - fsType: - type: string - options: - additionalProperties: - type: string - type: object - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - required: - - driver - type: object - flocker: - properties: - datasetName: - type: string - datasetUUID: - type: string - type: object - gcePersistentDisk: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - pdName: - type: string - readOnly: - type: boolean - required: - - pdName - type: object - gitRepo: - properties: - directory: - type: string - repository: - type: string - revision: - type: string - required: - - repository - type: object - glusterfs: - properties: - endpoints: - type: string - path: - type: string - readOnly: - type: boolean - required: - - endpoints - - path - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - iscsi: - properties: - chapAuthDiscovery: - type: boolean - chapAuthSession: - type: boolean - fsType: - type: string - initiatorName: - type: string - iqn: - type: string - iscsiInterface: - type: string - lun: - format: int32 - type: integer - portals: - items: - type: string - type: array - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - targetPortal: - type: string - required: - - iqn - - lun - - targetPortal - type: object - name: - type: string - nfs: - properties: - path: - type: string - readOnly: - type: boolean - server: - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - properties: - claimName: - type: string - readOnly: - type: boolean - required: - - claimName - type: object - photonPersistentDisk: - properties: - fsType: - type: string - pdID: - type: string - required: - - pdID - type: object - portworxVolume: - properties: - fsType: - type: string - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - projected: - properties: - defaultMode: - format: int32 - type: integer - sources: - items: - properties: - configMap: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - downwardAPI: - properties: - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - required: - - path - type: object - type: array - type: object - secret: - properties: - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - name: - type: string - optional: - type: boolean - type: object - serviceAccountToken: - properties: - audience: - type: string - expirationSeconds: - format: int64 - type: integer - path: - type: string - required: - - path - type: object - type: object - type: array - type: object - quobyte: - properties: - group: - type: string - readOnly: - type: boolean - registry: - type: string - tenant: - type: string - user: - type: string - volume: - type: string - required: - - registry - - volume - type: object - rbd: - properties: - fsType: - type: string - image: - type: string - keyring: - type: string - monitors: - items: - type: string - type: array - pool: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - user: - type: string - required: - - image - - monitors - type: object - scaleIO: - properties: - fsType: - type: string - gateway: - type: string - protectionDomain: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - sslEnabled: - type: boolean - storageMode: - type: string - storagePool: - type: string - system: - type: string - volumeName: - type: string - required: - - gateway - - secretRef - - system - type: object - secret: - properties: - defaultMode: - format: int32 - type: integer - items: - items: - properties: - key: - type: string - mode: - format: int32 - type: integer - path: - type: string - required: - - key - - path - type: object - type: array - optional: - type: boolean - secretName: - type: string - type: object - storageos: - properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - volumeName: - type: string - volumeNamespace: - type: string - type: object - vsphereVolume: - properties: - fsType: - type: string - storagePolicyID: - type: string - storagePolicyName: - type: string - volumePath: - type: string - required: - - volumePath - type: object - required: - - name - type: object - type: array - sidecars: - items: - properties: - args: - items: - type: string - type: array - command: - items: - type: string - type: array - env: - items: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - optional: - type: boolean - required: - - key - type: object - type: object - required: - - name - type: object - type: array - envFrom: - items: - properties: - configMapRef: - properties: - name: - type: string - optional: - type: boolean - type: object - prefix: - type: string - secretRef: - properties: - name: - type: string - optional: - type: boolean - type: object - type: object - type: array - image: - type: string - imagePullPolicy: - type: string - lifecycle: - properties: - postStart: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - preStop: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - type: object - type: object - livenessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - name: - type: string - ports: - items: - properties: - containerPort: - format: int32 - type: integer - hostIP: - type: string - hostPort: - format: int32 - type: integer - name: - type: string - protocol: - default: TCP - type: string - required: - - protocol - - containerPort - type: object - type: array - x-kubernetes-list-map-keys: - - protocol - - containerPort - x-kubernetes-list-type: map - readinessProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - securityContext: - properties: - allowPrivilegeEscalation: - type: boolean - capabilities: - properties: - add: - items: - type: string - type: array - drop: - items: - type: string - type: array - type: object - privileged: - type: boolean - procMount: - type: string - readOnlyRootFilesystem: - type: boolean - runAsGroup: - format: int64 - type: integer - runAsNonRoot: - type: boolean - runAsUser: - format: int64 - type: integer - seLinuxOptions: - properties: - level: - type: string - role: - type: string - type: - type: string - user: - type: string - type: object - seccompProfile: - properties: - localhostProfile: - type: string - type: - type: string - required: - - type - type: object - windowsOptions: - properties: - gmsaCredentialSpec: - type: string - gmsaCredentialSpecName: - type: string - hostProcess: - type: boolean - runAsUserName: - type: string - type: object - type: object - startupProbe: - properties: - exec: - properties: - command: - items: - type: string - type: array - type: object - failureThreshold: - format: int32 - type: integer - grpc: - properties: - port: - format: int32 - type: integer - service: - type: string - required: - - port - type: object - httpGet: - properties: - host: - type: string - httpHeaders: - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - path: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - type: string - required: - - port - type: object - initialDelaySeconds: - format: int32 - type: integer - periodSeconds: - format: int32 - type: integer - successThreshold: - format: int32 - type: integer - tcpSocket: - properties: - host: - type: string - port: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - required: - - port - type: object - terminationGracePeriodSeconds: - format: int64 - type: integer - timeoutSeconds: - format: int32 - type: integer - type: object - stdin: - type: boolean - stdinOnce: - type: boolean - terminationMessagePath: - type: string - terminationMessagePolicy: - type: string - tty: - type: boolean - volumeDevices: - items: - properties: - devicePath: - type: string - name: - type: string - required: - - devicePath - - name - type: object - type: array - volumeMounts: - items: - properties: - mountPath: - type: string - mountPropagation: - type: string - name: - type: string - readOnly: - type: boolean - subPath: - type: string - subPathExpr: - type: string - required: - - mountPath - - name - type: object - type: array - workingDir: - type: string - required: - - name - type: object - type: array - size: - format: int32 - type: integer - sslInternalSecretName: - type: string - sslSecretName: - type: string - tolerations: - items: - properties: - effect: - type: string - key: - type: string - operator: - type: string - tolerationSeconds: - format: int64 - type: integer - value: - type: string - type: object - type: array - vaultSecretName: - type: string - volumeSpec: - properties: - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - persistentVolumeClaim: - properties: - accessModes: - items: - type: string - type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - resources: - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - type: object - type: object - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string - type: object - type: object - type: object - secretsName: - type: string - sslInternalSecretName: - type: string - sslSecretName: - type: string - tls: - properties: - SANs: - items: - type: string - type: array - issuerConf: - properties: - group: - type: string - kind: - type: string - name: - type: string - required: - - name - type: object - type: object - updateStrategy: - type: string - upgradeOptions: - properties: - apply: - type: string - schedule: - type: string - versionServiceEndpoint: - type: string - type: object - vaultSecretName: - type: string - type: object - status: - properties: - backup: - properties: - image: - type: string - labelSelectorPath: - type: string - message: - type: string - status: - type: string - version: - type: string - type: object - conditions: - items: - properties: - lastTransitionTime: - format: date-time - type: string - message: - type: string - reason: - type: string - status: - type: string - type: - type: string - type: object - type: array - haproxy: - properties: - image: - type: string - labelSelectorPath: - type: string - message: - type: string - ready: - format: int32 - type: integer - size: - format: int32 - type: integer - status: - type: string - version: - type: string - type: object - host: - type: string - logcollector: - properties: - image: - type: string - labelSelectorPath: - type: string - message: - type: string - status: - type: string - version: - type: string - type: object - message: - items: - type: string - type: array - observedGeneration: - format: int64 - type: integer - pmm: - properties: - image: - type: string - labelSelectorPath: - type: string - message: - type: string - status: - type: string - version: - type: string - type: object - proxysql: - properties: - image: - type: string - labelSelectorPath: - type: string - message: - type: string - ready: - format: int32 - type: integer - size: - format: int32 - type: integer - status: - type: string - version: - type: string - type: object - pxc: - properties: - image: - type: string - labelSelectorPath: - type: string - message: - type: string - ready: - format: int32 - type: integer - size: - format: int32 - type: integer - status: - type: string - version: - type: string - type: object - pxcReplication: - properties: - replicationChannels: - items: - properties: - name: - type: string - sourceConnectRetry: - type: integer - sourceRetryCount: - type: integer - type: object - type: array - type: object - ready: - format: int32 - type: integer - size: - format: int32 - type: integer - state: - type: string - type: object - type: object - served: true - storage: true - subresources: - status: {} diff --git a/docs/proposals/dbaas/01-architecture/tpl_layers.png b/docs/proposals/dbaas/01-architecture/tpl_layers.png deleted file mode 100644 index 1f4fb8c131..0000000000 Binary files a/docs/proposals/dbaas/01-architecture/tpl_layers.png and /dev/null differ diff --git a/go.mod b/go.mod index 1c1e5169d3..bf0a9aee9f 100644 --- a/go.mod +++ b/go.mod @@ -52,11 +52,7 @@ require ( github.com/jotaen/kong-completion v0.0.5 github.com/lib/pq v1.10.6 github.com/minio/minio-go/v7 v7.0.55 - github.com/operator-framework/api v0.17.6 - github.com/operator-framework/operator-lifecycle-manager v0.24.0 - github.com/percona-platform/dbaas-api v0.0.0-20230103182808-d79c449a9f4c github.com/percona-platform/saas v0.0.0-20230728161159-ad6bdeb8a3d9 - github.com/percona/dbaas-operator v0.1.6 github.com/percona/exporter_shared v0.7.4 github.com/percona/go-mysql v0.0.0-20210427141028-73d29c6da78c github.com/percona/percona-toolkit v3.2.1+incompatible @@ -86,63 +82,26 @@ require ( gopkg.in/alecthomas/kingpin.v2 v2.2.6 gopkg.in/reform.v1 v1.5.1 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.28.0 - k8s.io/apiextensions-apiserver v0.26.2 - k8s.io/apimachinery v0.28.0 - k8s.io/cli-runtime v0.28.0 - k8s.io/client-go v0.28.0 - k8s.io/kubectl v0.28.0 modernc.org/sqlite v1.25.0 - sigs.k8s.io/controller-runtime v0.14.6 ) require ( - github.com/Azure/azure-pipeline-go v0.2.3 // indirect - github.com/Azure/azure-storage-blob-go v0.14.0 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/benbjohnson/clock v1.3.5 // indirect - github.com/blang/semver/v4 v4.0.0 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect - github.com/emicklei/go-restful/v3 v3.9.0 // indirect - github.com/evanphx/json-patch v5.6.0+incompatible // indirect - github.com/evanphx/json-patch/v5 v5.6.0 // indirect - github.com/go-errors/errors v1.4.2 // indirect - github.com/go-ini/ini v1.67.0 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/google/gnostic-models v0.6.8 // indirect - github.com/google/go-cmp v0.5.9 // indirect - github.com/google/gofuzz v1.2.0 // indirect - github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/hashicorp/go-uuid v1.0.2 // indirect github.com/hashicorp/golang-lru/v2 v2.0.2 // indirect - github.com/imdario/mergo v0.3.12 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect - github.com/mattn/go-ieproxy v0.0.1 // indirect - github.com/minio/minio-go v6.0.14+incompatible // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mwitkow/go-proto-validators v0.3.2 // indirect - github.com/percona/percona-backup-mongodb v1.8.1 // indirect - github.com/pierrec/lz4 v2.6.1+incompatible // indirect github.com/posener/complete v1.2.3 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/riywo/loginshell v0.0.0-20200815045211-7d26008be1ab // indirect - github.com/sergi/go-diff v1.2.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/xlab/treeprint v1.2.0 // indirect go.opentelemetry.io/otel/metric v1.16.0 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/time v0.3.0 // indirect google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect - gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect - k8s.io/klog/v2 v2.100.1 // indirect - k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect - k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect lukechampine.com/uint128 v1.2.0 // indirect modernc.org/cc/v3 v3.40.0 // indirect modernc.org/ccgo/v3 v3.16.13 // indirect @@ -152,11 +111,6 @@ require ( modernc.org/opt v0.1.3 // indirect modernc.org/strutil v1.1.3 // indirect modernc.org/token v1.0.1 // indirect - sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect - sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect ) require ( diff --git a/go.sum b/go.sum index ede50cba68..8d1c00e35c 100644 --- a/go.sum +++ b/go.sum @@ -31,12 +31,9 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl 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= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/3rf/mongo-lint v0.0.0-20140604191638-3550fdcf1f43/go.mod h1:ggh9ZlgUveoGPv/xlt2+6f/bGVEl/h+WlV4LX/dyxEI= github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE= github.com/AlekSi/pointer v1.2.0 h1:glcy/gc4h8HnG2Z3ZECSzZ1IX1x2JxRVuDzaJwQE0+w= github.com/AlekSi/pointer v1.2.0/go.mod h1:gZGfd3dpW4vEc/UlyfKKi1roIqcCgwOIvb0tSNSBle0= -github.com/Azure/azure-pipeline-go v0.2.3 h1:7U9HBg1JFK3jHl5qmo4CTZKFTVgMwdFHMVtCdfBE21U= -github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0-beta.2 h1:C3zKsGguxcLd8a2uEytB8+TFtBGd75bXRxEs0QBwsv0= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0-beta.2/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 h1:vcYCAze6p19qBW7MhZybIsqD8sMV8js0NyQM8JDnVtg= @@ -45,25 +42,8 @@ github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInm github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph v0.8.0 h1:+fxpya1I3WJEvl+qzET7NO2MkjtYkiZJxIcEN690W64= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph v0.8.0/go.mod h1:1wZ2sD5NUZGEk/RVNxjBFPqVHC39ekUDtmNnWhKhrGY= -github.com/Azure/azure-storage-blob-go v0.13.0/go.mod h1:pA9kNqtjUeQF2zOSu4s//nUdBD+e64lEuc4sVnuOfNs= -github.com/Azure/azure-storage-blob-go v0.14.0 h1:1BCg74AmVdYwO3dlKwtFU1V0wU2PZdREkXvAmZJRUlM= -github.com/Azure/azure-storage-blob-go v0.14.0/go.mod h1:SMqIBi+SuiQH32bvyjngEewEeXoPfKMgWlBDaYf6fck= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.28 h1:ndAExarwr5Y+GaHE6VCaY1kyS/HwwGGyuimVhWsHOEM= -github.com/Azure/go-autorest/autorest/adal v0.9.2/go.mod h1:/3SMAM86bP6wC9Ev35peQDUeqFZBMH07vvUOmg4z/fE= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= -github.com/Azure/go-autorest/autorest/adal v0.9.21 h1:jjQnVFXPfekaqb8vIsv2G1lxshoW+oGv4MDlhRtnYZk= -github.com/Azure/go-autorest/autorest/adal v0.9.21/go.mod h1:zua7mBUaCc5YnSLKYgGJR/w5ePdMDA6H56upLsHzA9U= -github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 h1:OBhqkivkhkMqLPymWEppkm7vgPQY2XsHoEkaMQ0AdZY= github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -81,7 +61,6 @@ github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Percona-Lab/go-grpc-prometheus v0.0.0-20230116133345-3487748d4592 h1:i7HDf+zPQvaPdrbLGS+wz/Ta32SszwYyHfJks1oVFzg= @@ -94,7 +73,6 @@ github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBK github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2ojoH/0= github.com/alecthomas/assert/v2 v2.1.0/go.mod h1:b/+1DI2Q6NckYi+3mXyH3wFb8qG37K/DuK80n7WefXA= -github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE= github.com/alecthomas/kong v0.8.0 h1:ryDCzutfIqJPnNn0omnrgHLbAggDQM2VWHikE1xqK7s= github.com/alecthomas/kong v0.8.0/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U= github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE= @@ -117,10 +95,7 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/aws/aws-sdk-go v1.40.7/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go v1.45.2 h1:hTong9YUklQKqzrGk3WnKABReb5R8GjbG4Y6dEQfjnk= github.com/aws/aws-sdk-go v1.45.2/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= @@ -137,8 +112,6 @@ github.com/bkaradzic/go-lz4 v1.0.0 h1:RXc4wYsyz985CkXXeX04y4VnZFGG8Rd43pRaHsOXAK github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= -github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/brianvoe/gofakeit v3.18.0+incompatible h1:wDOmHc9DLG4nRjUVVaxA+CEglKOW72Y5+4WNxUIkjM8= github.com/brianvoe/gofakeit v3.18.0+incompatible/go.mod h1:kfwdRA90vvNhPutZWfH7WPaDzUjz+CZFqG+rPkOjGOc= github.com/brianvoe/gofakeit/v6 v6.23.0 h1:pgVhyWpYq4e0GEVCh2gdZnS/nBX+8SnyTBliHg5xjks= @@ -171,53 +144,36 @@ github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2 github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/craiggwilson/goke v0.0.0-20200309222237-69a77cdfe646/go.mod h1:IX+FckvUr3c6SNWSzspUD94HqCMFCW+sIK0lJGSkWkg= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dhui/dktest v0.3.16 h1:i6gq2YQEtcrjKbeJpBkWjE8MmLZPYllcjOFbTZuPDnw= github.com/dhui/dktest v0.3.16/go.mod h1:gYaA3LRmM8Z4vJl2MA0THIigJoZrwOansEOsp+kqxp0= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v1.13.1/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v23.0.4+incompatible h1:Kd3Bh9V/rO+XpTP/BLqM+gx8z7+Yb0AA2Ibj+nNo4ek= github.com/docker/docker v23.0.4+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= -github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= -github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= -github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= -github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/frankban/quicktest v1.5.0/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/go-co-op/gocron v1.31.0 h1:8VaWk7ARDpsVYFP8SmjvHrBZQkcPQ7HyAzF7acG57yE= github.com/go-co-op/gocron v1.31.0/go.mod h1:39f6KNSGVOU1LO/ZOoZfcSxwlsJDQOKSu8erN0SH48Y= -github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-faster/city v1.0.1 h1:4WAxSZ3V2Ws4QRDrscLEDcibJY8uf41H6AhXDrNDcGw= github.com/go-faster/city v1.0.1/go.mod h1:jKcUJId49qdW3L1qKHH/3wPeUstCVpVSXTM6vO3VcTw= github.com/go-faster/errors v0.6.1 h1:nNIPOBkprlKzkThvS/0YaX8Zs9KewLCOSFQS5BU06FI= @@ -225,9 +181,6 @@ github.com/go-faster/errors v0.6.1/go.mod h1:5MGV2/2T9yvlrbhe9pD9LO5Z/2zCSq2T8j+ 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-ini/ini v1.51.1/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= -github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= -github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= 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= @@ -238,14 +191,11 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= -github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= github.com/go-openapi/analysis v0.21.4 h1:ZDFLvSNxpDaomuCueM0BlSXxpANBlFYiBvr+GXrvIHc= github.com/go-openapi/analysis v0.21.4/go.mod h1:4zQ35W4neeZTqh3ol0rv/O8JBbka9QyAgQRPp9y3pfo= @@ -284,8 +234,6 @@ github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LB github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gobs/pretty v0.0.0-20180724170744-09732c25a95b h1:/vQ+oYKu+JoyaMPDsv5FzwuL2wwWBgBbtj/YLCi4LuA= github.com/gobs/pretty v0.0.0-20180724170744-09732c25a95b/go.mod h1:Xo4aNUOrJnVruqWQJBtW6+bTBDTniY8yZum5rF3b5jw= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= @@ -333,17 +281,14 @@ github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -362,15 +307,12 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= -github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -384,8 +326,6 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -398,16 +338,11 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grafana/grafana-api-golang-client v0.24.0 h1:9cUvft7xCMnnL/Uscwy7eoldn16Gz5TH4T1MymuVs8E= github.com/grafana/grafana-api-golang-client v0.24.0/go.mod h1:24W29gPe9yl0/3A9X624TPkAOR8DpHno490cPwnkv8E= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= @@ -449,14 +384,10 @@ github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4 github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ= github.com/jackc/pgx v3.6.2+incompatible h1:2zP5OD7kiyR3xzRYMhOcXVvkDZsImVXfj+yIyTQf3/o= github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= @@ -479,7 +410,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= @@ -490,16 +420,12 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:C 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.10.1/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.13.1/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= -github.com/klauspost/pgzip v1.2.3/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= 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= @@ -530,17 +456,11 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ 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= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-ieproxy v0.0.1 h1:qiyop7gCflfhwCzGyeT0gro3sF9AIg9HU98JORTkqfI= -github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= @@ -552,22 +472,16 @@ github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= -github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.50 h1:DQUfb9uc6smULcREF09Uc+/Gd46YWqJd5DbpPE9xkcA= github.com/miekg/dns v1.1.50/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= -github.com/minio/minio-go v6.0.14+incompatible h1:fnV+GD28LeqdN6vT2XdGKW8Qe/IfjJDswNVuni6km9o= -github.com/minio/minio-go v6.0.14+incompatible/go.mod h1:7guKYtitv8dktvNUGrhzmNlA5wrAABTQXCoesZdFQO8= github.com/minio/minio-go/v7 v7.0.55 h1:ZXqUO/8cgfHzI+08h/zGuTTFpISSA32BZmBE3FCLJas= github.com/minio/minio-go/v7 v7.0.55/go.mod h1:NUDy4A4oXPq1l2yK6LTSvCEzAMeIcoz9lcj5dbzSrRE= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= 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= @@ -582,9 +496,6 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mongodb/mongo-tools v0.0.0-20210723181737-9fcadb98cca5/go.mod h1:ABxjl6eSrSq+hBDMGLnrWPO9XqHRVKEaGcRbw9vTLRk= -github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0= -github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/montanaflynn/stats v0.7.0 h1:r3y12KyNxj/Sb/iOE46ws+3mS1+MZca1wlHQFPsY/JU= github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= @@ -598,25 +509,16 @@ github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-proto-validators v0.3.2 h1:qRlmpTzm2pstMKKzTdvwPCF5QfBNURSlAgN/R+qbKos= 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/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nsf/termbox-go v0.0.0-20160718140619-0723e7c3d0a3/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.9.4 h1:xR7vG4IXt5RWx6FfIjyAtsoMAtnc3C/rFXBBd2AjZwE= -github.com/onsi/ginkgo/v2 v2.9.4/go.mod h1:gCQYp2Q+kSoIj7ykSVb9nskRSsR6PUj4AiLywzIhbKM= -github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= -github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 h1:rc3tiVYb5z54aKaDfakKn0dDjIyPpTtszkjuMzyt7ec= @@ -624,10 +526,6 @@ github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799/go.mod github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= 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/operator-framework/api v0.17.6 h1:E6+vlvYUKafvoXYtCuHlDZrXX4vl8AT+r93OxNlzjpU= -github.com/operator-framework/api v0.17.6/go.mod h1:l/cuwtPxkVUY7fzYgdust2m9tlmb8I4pOvbsUufRb24= -github.com/operator-framework/operator-lifecycle-manager v0.24.0 h1:9LOfvyohGEkNHwcOGOgw+w3ZAnGeT6JVh3CvIbWpnus= -github.com/operator-framework/operator-lifecycle-manager v0.24.0/go.mod h1:2zDUxcpW2idTLjRw36WlMetHZ50Nlf1C3JxASPfYS20= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -637,28 +535,20 @@ github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKf github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/percona-lab/crypto v0.0.0-20220811043533-d164de3c7f08 h1:NprWeXddFZJSgtN8hmf/hhIgiZwB3GNaKnI88iAFgEc= github.com/percona-lab/crypto v0.0.0-20220811043533-d164de3c7f08/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -github.com/percona-platform/dbaas-api v0.0.0-20230103182808-d79c449a9f4c h1:1JySfwdjVfc9ahl0466OX7nSQ7Z4SjQkLe3ZdLkMOJI= -github.com/percona-platform/dbaas-api v0.0.0-20230103182808-d79c449a9f4c/go.mod h1:/jgle33awfHq1va/T6NnNS5wWAETSnl6wUZ1bew+CJ0= github.com/percona-platform/saas v0.0.0-20230728161159-ad6bdeb8a3d9 h1:KkOH+Y4sVRP7qvRtTDmfPFNjjQcwU2054/jNl9DZhEo= github.com/percona-platform/saas v0.0.0-20230728161159-ad6bdeb8a3d9/go.mod h1:lZuFcqj0EoQWx28SYkTcdhJOCQEbRcAyahYPfRMY7tc= -github.com/percona/dbaas-operator v0.1.6 h1:NsZXDKcPXk38kET+X6r8Es+3Supyu5XJZMS0gqPejKs= -github.com/percona/dbaas-operator v0.1.6/go.mod h1:52B/kh+Jmtfv0JiZgDcc34qgbwwEi9U4A3311JBxIZg= github.com/percona/exporter_shared v0.7.4 h1:S+xnfK/CySiYqr4XqLiLAfO3rxgEOUFK+m6lCBi3mgc= github.com/percona/exporter_shared v0.7.4/go.mod h1:bweWrCdYX+iAONTNUNIIkXGDjGg8dbFL0VBxuUv0wus= github.com/percona/go-mysql v0.0.0-20210427141028-73d29c6da78c h1:1SZ7nS+kSaO63IpaKspf/gf8602QcgP2eXNPMNOIc0M= github.com/percona/go-mysql v0.0.0-20210427141028-73d29c6da78c/go.mod h1:/SGLf9OMxlnK6jq4mkFiImBcJXXk5jwD+lDrwDaGXcw= -github.com/percona/percona-backup-mongodb v1.8.1 h1:Fc2DzIh2N+ioNgBlNg0wAJw8yRt3IoXOKQcQAFbPt6g= -github.com/percona/percona-backup-mongodb v1.8.1/go.mod h1:KcY2y93p+gcYF1iMJgcxbsWEpZdUJWsDA59aAL3zqPY= github.com/percona/percona-toolkit v3.2.1+incompatible h1:5jLvtZKcu9fDmaLRB8qA4bLR727t5iYyguHJJQTk9w0= github.com/percona/percona-toolkit v3.2.1+incompatible/go.mod h1:netQWdWMaF1cnmwiIS+i5uyaqNXz46yNeM6HKkR6yeI= github.com/percona/promconfig v0.2.5 h1:f/HN/CbECQs7d9RIB6MKVkuXstsrsqEDxRvf6yigquc= github.com/percona/promconfig v0.2.5/go.mod h1:Y2uXi5QNk71+ceJHuI9poank+0S1kjxd3K105fXKVkg= github.com/pganalyze/pg_query_go/v2 v2.2.0 h1:OW+reH+ZY7jdEuPyuLGlf1m7dLbE+fDudKXhLs0Ttpk= github.com/pganalyze/pg_query_go/v2 v2.2.0/go.mod h1:XAxmVqz1tEGqizcQ3YSdN90vCOHBWjJi8URL1er5+cA= +github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.3.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= -github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4/v4 v4.1.17 h1:kV4Ip+/hUBC+8T6+2EgburRtkE9ef4nbY3f4dFhGjMc= github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= @@ -733,8 +623,6 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUt github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= -github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= -github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= @@ -749,12 +637,8 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -783,8 +667,6 @@ github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6 github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= -github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= -github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk= github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4= @@ -794,8 +676,6 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.mongodb.org/mongo-driver v1.6.0/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= -go.mongodb.org/mongo-driver v1.7.0/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= @@ -823,11 +703,7 @@ go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -841,8 +717,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0 h1:pVgRXcIictcr+lBQIFeiwuwtDIs4eL21OuM9nyAADmo= +golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -883,7 +759,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL 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-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191112182307-2180aed22343/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= @@ -902,7 +777,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -947,15 +821,12 @@ golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/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-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/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= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -970,7 +841,6 @@ 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-20200828194041-157a740278f4/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-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1014,9 +884,8 @@ golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1026,7 +895,6 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -1078,8 +946,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= -gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.8.2 h1:CCXrcPKiGGotvnN6jfUsKk4rRqm7q09/YbKb5xCEvtM= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= @@ -1181,14 +1047,10 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/reform.v1 v1.5.1 h1:7vhDFW1n1xAPC6oDSvIvVvpRkaRpXlxgJ4QB4s3aDdo= gopkg.in/reform.v1 v1.5.1/go.mod h1:AIv0CbDRJ0ljQwptGeaIXfpDRo02uJwTq92aMFELEeU= -gopkg.in/tomb.v2 v2.0.0-20140626144623-14b3d72120e8/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1212,24 +1074,6 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.28.0 h1:3j3VPWmN9tTDI68NETBWlDiA9qOiGJ7sdKeufehBYsM= -k8s.io/api v0.28.0/go.mod h1:0l8NZJzB0i/etuWnIXcwfIv+xnDOhL3lLW919AWYDuY= -k8s.io/apiextensions-apiserver v0.26.2 h1:/yTG2B9jGY2Q70iGskMf41qTLhL9XeNN2KhI0uDgwko= -k8s.io/apiextensions-apiserver v0.26.2/go.mod h1:Y7UPgch8nph8mGCuVk0SK83LnS8Esf3n6fUBgew8SH8= -k8s.io/apimachinery v0.28.0 h1:ScHS2AG16UlYWk63r46oU3D5y54T53cVI5mMJwwqFNA= -k8s.io/apimachinery v0.28.0/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw= -k8s.io/cli-runtime v0.28.0 h1:Tcz1nnccXZDNIzoH6EwjCs+7ezkUGhorzCweEvlVOFg= -k8s.io/cli-runtime v0.28.0/go.mod h1:U+ySmOKBm/JUCmebhmecXeTwNN1RzI7DW4+OM8Oryas= -k8s.io/client-go v0.28.0 h1:ebcPRDZsCjpj62+cMk1eGNX1QkMdRmQ6lmz5BLoFWeM= -k8s.io/client-go v0.28.0/go.mod h1:0Asy9Xt3U98RypWJmU1ZrRAGKhP6NqDPmptlAzK2kMc= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= -k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= -k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= -k8s.io/kubectl v0.28.0 h1:qhfju0OaU+JGeBlToPeeIg2UJUWP++QwTkpio6nlPKg= -k8s.io/kubectl v0.28.0/go.mod h1:1We+E5nSX3/TVoSQ6y5Bzld5OhTBHZHlKEYl7g/NaTk= -k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk= -k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= @@ -1262,15 +1106,3 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/controller-runtime v0.14.6 h1:oxstGVvXGNnMvY7TAESYk+lzr6S3V5VFxQ6d92KcwQA= -sigs.k8s.io/controller-runtime v0.14.6/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 h1:XX3Ajgzov2RKUdc5jW3t5jwY7Bo7dcRm+tFxT+NfgY0= -sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3/go.mod h1:9n16EZKMhXBNSiUC5kSdFQJkdH3zbxS/JoO619G1VAY= -sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 h1:W6cLQc5pnqM7vh3b7HvGNfXrJ/xL6BDMS0v1V/HHg5U= -sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3/go.mod h1:JWP1Fj0VWGHyw3YUPjXSQnRnrwezrZSrApfX5S0nIag= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/managed/CONTRIBUTING.md b/managed/CONTRIBUTING.md index 710d9dca10..9db7826daa 100644 --- a/managed/CONTRIBUTING.md +++ b/managed/CONTRIBUTING.md @@ -70,7 +70,6 @@ go test -timeout=30s -p 1 ./... | PERCONA_TEST_TELEMETRY_FILE | Sets path for telemetry config file | | | PERCONA_TEST_TELEMETRY_DISABLE_START_DELAY | Disable the default telemetry execution start delay, so that telemetry gathering is run immediately upon system | false | | PERCONA_TEST_TELEMETRY_RETRY_BACKOFF | Sets telemetry reporting retry backoff time | 1h | -| PERCONA_TEST_DBAAS_KUBECONFIG | ## TODO | | | PERCONA_TEST_PLATFORM_ADDRESS | Sets Percona Platform address | https://check.percona.com | | PERCONA_TEST_PLATFORM_INSECURE | Allows insecure TLS connections to Percona Platform | false | | PERCONA_TEST_PLATFORM_PUBLIC_KEY | Sets Percona Platform public key (Minisign) | set of keys embedded into managed binary | diff --git a/managed/Makefile b/managed/Makefile index 5c3722002d..7126d1fc35 100644 --- a/managed/Makefile +++ b/managed/Makefile @@ -5,9 +5,6 @@ help: ## Display this help message @grep -h '^[a-zA-Z]' $(MAKEFILE_LIST) | \ awk -F ':.*?## ' 'NF==2 {printf " %-26s%s\n", $$1, $$2}' @echo - @echo "To test DBaaS components with minikube:" - @echo "Start minikube: minikube start --cpus=2 --nodes=3 --kubernetes-version=v1.20.0" - @echo "ENABLE_DBAAS=1 NETWORK=minikube make env-up" # `cut` is used to remove first `v` from `git describe` output PMM_RELEASE_PATH ?= ../bin diff --git a/managed/cmd/pmm-managed/main.go b/managed/cmd/pmm-managed/main.go index ab347034f8..80e8cd1d4e 100644 --- a/managed/cmd/pmm-managed/main.go +++ b/managed/cmd/pmm-managed/main.go @@ -66,7 +66,6 @@ import ( alertingpb "github.com/percona/pmm/api/managementpb/alerting" azurev1beta1 "github.com/percona/pmm/api/managementpb/azure" backuppb "github.com/percona/pmm/api/managementpb/backup" - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" iav1beta1 "github.com/percona/pmm/api/managementpb/ia" nodev1beta1 "github.com/percona/pmm/api/managementpb/node" rolev1beta1 "github.com/percona/pmm/api/managementpb/role" @@ -82,7 +81,6 @@ import ( "github.com/percona/pmm/managed/services/backup" "github.com/percona/pmm/managed/services/checks" "github.com/percona/pmm/managed/services/config" - "github.com/percona/pmm/managed/services/dbaas" "github.com/percona/pmm/managed/services/grafana" "github.com/percona/pmm/managed/services/inventory" inventorygrpc "github.com/percona/pmm/managed/services/inventory/grpc" @@ -90,7 +88,6 @@ import ( "github.com/percona/pmm/managed/services/management/alerting" managementbackup "github.com/percona/pmm/managed/services/management/backup" "github.com/percona/pmm/managed/services/management/common" - managementdbaas "github.com/percona/pmm/managed/services/management/dbaas" managementgrpc "github.com/percona/pmm/managed/services/management/grpc" "github.com/percona/pmm/managed/services/management/ia" "github.com/percona/pmm/managed/services/minio" @@ -195,7 +192,6 @@ type gRPCServerDeps struct { connectionCheck *agents.ConnectionChecker grafanaClient *grafana.Client checksService *checks.Service - dbaasClient *dbaas.Client alertmanager *alertmanager.Service vmalert *vmalert.Service settings *models.Settings @@ -203,7 +199,6 @@ type gRPCServerDeps struct { templatesService *alerting.Service rulesService *ia.RulesService jobsService *agents.JobsService - versionServiceClient *managementdbaas.VersionServiceClient schedulerService *scheduler.Service backupService *backup.Service compatibilityService *backup.CompatibilityService @@ -213,10 +208,7 @@ type gRPCServerDeps struct { versionCache *versioncache.Service supervisord *supervisord.Service config *config.Config - componentsService *managementdbaas.ComponentsService - dbaasInitializer *managementdbaas.Initializer agentService *agents.AgentService - kubeStorage *managementdbaas.KubeStorage uieventsService *uievents.Service vmClient *metrics.Client } @@ -307,16 +299,6 @@ func runGRPCServer(ctx context.Context, deps *gRPCServerDeps) { backuppb.RegisterArtifactsServer(gRPCServer, mgmtArtifactsService) backuppb.RegisterRestoreHistoryServer(gRPCServer, mgmtRestoreHistoryService) - k8sServer := managementdbaas.NewKubernetesServer(deps.db, deps.dbaasClient, deps.versionServiceClient, deps.grafanaClient) - deps.dbaasInitializer.RegisterKubernetesServer(k8sServer) - dbaasv1beta1.RegisterKubernetesServer(gRPCServer, k8sServer) - dbaasv1beta1.RegisterDBClustersServer(gRPCServer, managementdbaas.NewDBClusterService(deps.db, deps.grafanaClient, deps.versionServiceClient)) - dbaasv1beta1.RegisterPXCClustersServer(gRPCServer, managementdbaas.NewPXCClusterService(deps.db, deps.grafanaClient, deps.componentsService, deps.versionServiceClient.GetVersionServiceURL())) - dbaasv1beta1.RegisterPSMDBClustersServer(gRPCServer, managementdbaas.NewPSMDBClusterService(deps.db, deps.grafanaClient, deps.componentsService, deps.versionServiceClient.GetVersionServiceURL())) - dbaasv1beta1.RegisterLogsAPIServer(gRPCServer, managementdbaas.NewLogsService(deps.db)) - dbaasv1beta1.RegisterComponentsServer(gRPCServer, managementdbaas.NewComponentsService(deps.db, deps.dbaasClient, deps.versionServiceClient, deps.kubeStorage)) - dbaasv1beta1.RegisterTemplatesServer(gRPCServer, managementdbaas.NewTemplateService(deps.db)) - userpb.RegisterUserServer(gRPCServer, user.NewUserService(deps.db, deps.grafanaClient)) platformService := platform.New(deps.platformClient, deps.db, deps.supervisord, deps.checksService, deps.grafanaClient) @@ -428,14 +410,6 @@ func runHTTP1Server(ctx context.Context, deps *http1ServerDeps) { backuppb.RegisterArtifactsHandlerFromEndpoint, backuppb.RegisterRestoreHistoryHandlerFromEndpoint, - dbaasv1beta1.RegisterKubernetesHandlerFromEndpoint, - dbaasv1beta1.RegisterDBClustersHandlerFromEndpoint, - dbaasv1beta1.RegisterPXCClustersHandlerFromEndpoint, - dbaasv1beta1.RegisterPSMDBClustersHandlerFromEndpoint, - dbaasv1beta1.RegisterLogsAPIHandlerFromEndpoint, - dbaasv1beta1.RegisterComponentsHandlerFromEndpoint, - dbaasv1beta1.RegisterTemplatesHandlerFromEndpoint, - platformpb.RegisterPlatformHandlerFromEndpoint, uieventspb.RegisterUIEventsHandlerFromEndpoint, @@ -689,10 +663,6 @@ func main() { //nolint:cyclop,maintidx grafanaAddrF := kingpin.Flag("grafana-addr", "Grafana HTTP API address").Default("127.0.0.1:3000").String() qanAPIAddrF := kingpin.Flag("qan-api-addr", "QAN API gRPC API address").Default("127.0.0.1:9911").String() - dbaasControllerAPIAddrF := kingpin.Flag("dbaas-controller-api-addr", "DBaaS Controller gRPC API address").Default("127.0.0.1:20201").String() - - versionServiceAPIURLF := kingpin.Flag("version-service-api-url", "Version Service API URL"). - Default("https://check.percona.com/versions/v1").Envar("PERCONA_TEST_VERSION_SERVICE_URL").String() postgresAddrF := kingpin.Flag("postgres-addr", "PostgreSQL address"). Default(models.DefaultPostgreSQLAddr). @@ -931,10 +901,8 @@ func main() { //nolint:cyclop,maintidx alertsService := ia.NewAlertsService(db, alertManager, templatesService) agentService := agents.NewAgentService(agentsRegistry) - versionService := managementdbaas.NewVersionServiceClient(*versionServiceAPIURLF) versioner := agents.NewVersionerService(agentsRegistry) - dbaasClient := dbaas.NewClient(*dbaasControllerAPIAddrF) compatibilityService := backup.NewCompatibilityService(db, versioner) backupService := backup.NewService(db, jobsService, agentService, compatibilityService, pbmPITRService) backupMetricsCollector := backup.NewMetricsCollector(db) @@ -944,12 +912,6 @@ func main() { //nolint:cyclop,maintidx versionCache := versioncache.New(db, versioner) emailer := alertmanager.NewEmailer(logrus.WithField("component", "alertmanager-emailer").Logger) - kubeStorage := managementdbaas.NewKubeStorage(db) - - componentsService := managementdbaas.NewComponentsService(db, dbaasClient, versionService, kubeStorage) - - dbaasInitializer := managementdbaas.NewInitializer(db, dbaasClient) - serverParams := &server.Params{ DB: db, VMDB: vmdb, @@ -964,7 +926,6 @@ func main() { //nolint:cyclop,maintidx GrafanaClient: grafanaClient, VMAlertExternalRules: externalRules, RulesService: rulesService, - DBaaSInitializer: dbaasInitializer, Emailer: emailer, } @@ -1114,7 +1075,6 @@ func main() { //nolint:cyclop,maintidx connectionCheck: connectionCheck, grafanaClient: grafanaClient, checksService: checksService, - dbaasClient: dbaasClient, alertmanager: alertManager, vmalert: vmalert, settings: settings, @@ -1122,7 +1082,6 @@ func main() { //nolint:cyclop,maintidx templatesService: templatesService, rulesService: rulesService, jobsService: jobsService, - versionServiceClient: versionService, schedulerService: schedulerService, backupService: backupService, compatibilityService: compatibilityService, @@ -1132,10 +1091,7 @@ func main() { //nolint:cyclop,maintidx versionCache: versionCache, supervisord: supervisord, config: &cfg.Config, - componentsService: componentsService, - dbaasInitializer: dbaasInitializer, agentService: agentService, - kubeStorage: kubeStorage, uieventsService: uieventsService, vmClient: &vmClient, }) @@ -1161,24 +1117,6 @@ func main() { //nolint:cyclop,maintidx defer wg.Done() cleaner.Run(ctx, cleanInterval, cleanOlderThan) }() - if settings.DBaaS.Enabled { - err = supervisord.RestartSupervisedService("dbaas-controller") - if err != nil { - l.Errorf("Failed to restart dbaas-controller on startup: %v", err) - } else { - l.Debug("DBaaS is enabled - creating a DBaaS client.") - err := dbaasInitializer.Enable(ctx) - if err != nil { - l.Fatalf("Failed initializing dbaas-controller %s: %v", *dbaasControllerAPIAddrF, err) - } - defer func() { - err := dbaasInitializer.Disable(context.Background()) - if err != nil { - l.Fatalf("Failed disabling dbaas-controller API: %v", err) - } - }() - } - } wg.Wait() } diff --git a/managed/data/crds/olm/crds.yaml b/managed/data/crds/olm/crds.yaml deleted file mode 100644 index 7dd05d7bf8..0000000000 --- a/managed/data/crds/olm/crds.yaml +++ /dev/null @@ -1,8322 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.8.0 - creationTimestamp: null - name: catalogsources.operators.coreos.com -spec: - group: operators.coreos.com - names: - categories: - - olm - kind: CatalogSource - listKind: CatalogSourceList - plural: catalogsources - shortNames: - - catsrc - singular: catalogsource - scope: Namespaced - versions: - - additionalPrinterColumns: - - description: The pretty name of the catalog - jsonPath: .spec.displayName - name: Display - type: string - - description: The type of the catalog - jsonPath: .spec.sourceType - name: Type - type: string - - description: The publisher of the catalog - jsonPath: .spec.publisher - name: Publisher - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: CatalogSource is a repository of CSVs, CRDs, and operator packages. - type: object - required: - - metadata - - spec - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - type: object - required: - - sourceType - properties: - address: - description: 'Address is a host that OLM can use to connect to a pre-existing registry. Format: : Only used when SourceType = SourceTypeGrpc. Ignored when the Image field is set.' - type: string - configMap: - description: ConfigMap is the name of the ConfigMap to be used to back a configmap-server registry. Only used when SourceType = SourceTypeConfigmap or SourceTypeInternal. - type: string - description: - type: string - displayName: - description: Metadata - type: string - grpcPodConfig: - description: GrpcPodConfig exposes different overrides for the pod spec of the CatalogSource Pod. Only used when SourceType = SourceTypeGrpc and Image is set. - type: object - properties: - nodeSelector: - description: NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. - type: object - additionalProperties: - type: string - priorityClassName: - description: If specified, indicates the pod's priority. If not specified, the pod priority will be default or zero if there is no default. - type: string - tolerations: - description: Tolerations are the catalog source's pod's tolerations. - type: array - items: - description: The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . - type: object - properties: - effect: - description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. - type: string - operator: - description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. - type: string - tolerationSeconds: - description: TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. - type: integer - format: int64 - value: - description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. - type: string - icon: - type: object - required: - - base64data - - mediatype - properties: - base64data: - type: string - mediatype: - type: string - image: - description: Image is an operator-registry container image to instantiate a registry-server with. Only used when SourceType = SourceTypeGrpc. If present, the address field is ignored. - type: string - priority: - description: 'Priority field assigns a weight to the catalog source to prioritize them so that it can be consumed by the dependency resolver. Usage: Higher weight indicates that this catalog source is preferred over lower weighted catalog sources during dependency resolution. The range of the priority value can go from positive to negative in the range of int32. The default value to a catalog source with unassigned priority would be 0. The catalog source with the same priority values will be ranked lexicographically based on its name.' - type: integer - publisher: - type: string - secrets: - description: Secrets represent set of secrets that can be used to access the contents of the catalog. It is best to keep this list small, since each will need to be tried for every catalog entry. - type: array - items: - type: string - sourceType: - description: SourceType is the type of source - type: string - updateStrategy: - description: UpdateStrategy defines how updated catalog source images can be discovered Consists of an interval that defines polling duration and an embedded strategy type - type: object - properties: - registryPoll: - type: object - properties: - interval: - description: Interval is used to determine the time interval between checks of the latest catalog source version. The catalog operator polls to see if a new version of the catalog source is available. If available, the latest image is pulled and gRPC traffic is directed to the latest catalog source. - type: string - status: - type: object - properties: - conditions: - description: Represents the state of a CatalogSource. Note that Message and Reason represent the original status information, which may be migrated to be conditions based in the future. Any new features introduced will use conditions. - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - x-kubernetes-list-map-keys: - - type - x-kubernetes-list-type: map - configMapReference: - type: object - required: - - name - - namespace - properties: - lastUpdateTime: - type: string - format: date-time - name: - type: string - namespace: - type: string - resourceVersion: - type: string - uid: - description: UID is a type that holds unique ID values, including UUIDs. Because we don't ONLY use UUIDs, this is an alias to string. Being a type captures intent and helps make sure that UIDs and names do not get conflated. - type: string - connectionState: - type: object - required: - - lastObservedState - properties: - address: - type: string - lastConnect: - type: string - format: date-time - lastObservedState: - type: string - latestImageRegistryPoll: - description: The last time the CatalogSource image registry has been polled to ensure the image is up-to-date - type: string - format: date-time - message: - description: A human readable message indicating details about why the CatalogSource is in this condition. - type: string - reason: - description: Reason is the reason the CatalogSource was transitioned to its current state. - type: string - registryService: - type: object - properties: - createdAt: - type: string - format: date-time - port: - type: string - protocol: - type: string - serviceName: - type: string - serviceNamespace: - type: string - served: true - storage: true - subresources: - status: {} - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.8.0 - creationTimestamp: null - name: clusterserviceversions.operators.coreos.com -spec: - group: operators.coreos.com - names: - categories: - - olm - kind: ClusterServiceVersion - listKind: ClusterServiceVersionList - plural: clusterserviceversions - shortNames: - - csv - - csvs - singular: clusterserviceversion - scope: Namespaced - versions: - - additionalPrinterColumns: - - description: The name of the CSV - jsonPath: .spec.displayName - name: Display - type: string - - description: The version of the CSV - jsonPath: .spec.version - name: Version - type: string - - description: The name of a CSV that this one replaces - jsonPath: .spec.replaces - name: Replaces - type: string - - jsonPath: .status.phase - name: Phase - type: string - name: v1alpha1 - schema: - openAPIV3Schema: - description: ClusterServiceVersion is a Custom Resource of type `ClusterServiceVersionSpec`. - type: object - required: - - metadata - - spec - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: ClusterServiceVersionSpec declarations tell OLM how to install an operator that can manage apps for a given version. - type: object - required: - - displayName - - install - properties: - annotations: - description: Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. - type: object - additionalProperties: - type: string - apiservicedefinitions: - description: APIServiceDefinitions declares all of the extension apis managed or required by an operator being ran by ClusterServiceVersion. - type: object - properties: - owned: - type: array - items: - description: APIServiceDescription provides details to OLM about apis provided via aggregation - type: object - required: - - group - - kind - - name - - version - properties: - actionDescriptors: - type: array - items: - description: ActionDescriptor describes a declarative action that can be performed on a custom resource instance - type: object - required: - - path - properties: - description: - type: string - displayName: - type: string - path: - type: string - value: - description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. - type: string - format: byte - x-descriptors: - type: array - items: - type: string - containerPort: - type: integer - format: int32 - deploymentName: - type: string - description: - type: string - displayName: - type: string - group: - type: string - kind: - type: string - name: - type: string - resources: - type: array - items: - description: APIResourceReference is a Kubernetes resource type used by a custom resource - type: object - required: - - kind - - name - - version - properties: - kind: - type: string - name: - type: string - version: - type: string - specDescriptors: - type: array - items: - description: SpecDescriptor describes a field in a spec block of a CRD so that OLM can consume it - type: object - required: - - path - properties: - description: - type: string - displayName: - type: string - path: - type: string - value: - description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. - type: string - format: byte - x-descriptors: - type: array - items: - type: string - statusDescriptors: - type: array - items: - description: StatusDescriptor describes a field in a status block of a CRD so that OLM can consume it - type: object - required: - - path - properties: - description: - type: string - displayName: - type: string - path: - type: string - value: - description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. - type: string - format: byte - x-descriptors: - type: array - items: - type: string - version: - type: string - required: - type: array - items: - description: APIServiceDescription provides details to OLM about apis provided via aggregation - type: object - required: - - group - - kind - - name - - version - properties: - actionDescriptors: - type: array - items: - description: ActionDescriptor describes a declarative action that can be performed on a custom resource instance - type: object - required: - - path - properties: - description: - type: string - displayName: - type: string - path: - type: string - value: - description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. - type: string - format: byte - x-descriptors: - type: array - items: - type: string - containerPort: - type: integer - format: int32 - deploymentName: - type: string - description: - type: string - displayName: - type: string - group: - type: string - kind: - type: string - name: - type: string - resources: - type: array - items: - description: APIResourceReference is a Kubernetes resource type used by a custom resource - type: object - required: - - kind - - name - - version - properties: - kind: - type: string - name: - type: string - version: - type: string - specDescriptors: - type: array - items: - description: SpecDescriptor describes a field in a spec block of a CRD so that OLM can consume it - type: object - required: - - path - properties: - description: - type: string - displayName: - type: string - path: - type: string - value: - description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. - type: string - format: byte - x-descriptors: - type: array - items: - type: string - statusDescriptors: - type: array - items: - description: StatusDescriptor describes a field in a status block of a CRD so that OLM can consume it - type: object - required: - - path - properties: - description: - type: string - displayName: - type: string - path: - type: string - value: - description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. - type: string - format: byte - x-descriptors: - type: array - items: - type: string - version: - type: string - cleanup: - description: Cleanup specifies the cleanup behaviour when the CSV gets deleted - type: object - required: - - enabled - properties: - enabled: - type: boolean - customresourcedefinitions: - description: "CustomResourceDefinitions declares all of the CRDs managed or required by an operator being ran by ClusterServiceVersion. \n If the CRD is present in the Owned list, it is implicitly required." - type: object - properties: - owned: - type: array - items: - description: CRDDescription provides details to OLM about the CRDs - type: object - required: - - kind - - name - - version - properties: - actionDescriptors: - type: array - items: - description: ActionDescriptor describes a declarative action that can be performed on a custom resource instance - type: object - required: - - path - properties: - description: - type: string - displayName: - type: string - path: - type: string - value: - description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. - type: string - format: byte - x-descriptors: - type: array - items: - type: string - description: - type: string - displayName: - type: string - kind: - type: string - name: - type: string - resources: - type: array - items: - description: APIResourceReference is a Kubernetes resource type used by a custom resource - type: object - required: - - kind - - name - - version - properties: - kind: - type: string - name: - type: string - version: - type: string - specDescriptors: - type: array - items: - description: SpecDescriptor describes a field in a spec block of a CRD so that OLM can consume it - type: object - required: - - path - properties: - description: - type: string - displayName: - type: string - path: - type: string - value: - description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. - type: string - format: byte - x-descriptors: - type: array - items: - type: string - statusDescriptors: - type: array - items: - description: StatusDescriptor describes a field in a status block of a CRD so that OLM can consume it - type: object - required: - - path - properties: - description: - type: string - displayName: - type: string - path: - type: string - value: - description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. - type: string - format: byte - x-descriptors: - type: array - items: - type: string - version: - type: string - required: - type: array - items: - description: CRDDescription provides details to OLM about the CRDs - type: object - required: - - kind - - name - - version - properties: - actionDescriptors: - type: array - items: - description: ActionDescriptor describes a declarative action that can be performed on a custom resource instance - type: object - required: - - path - properties: - description: - type: string - displayName: - type: string - path: - type: string - value: - description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. - type: string - format: byte - x-descriptors: - type: array - items: - type: string - description: - type: string - displayName: - type: string - kind: - type: string - name: - type: string - resources: - type: array - items: - description: APIResourceReference is a Kubernetes resource type used by a custom resource - type: object - required: - - kind - - name - - version - properties: - kind: - type: string - name: - type: string - version: - type: string - specDescriptors: - type: array - items: - description: SpecDescriptor describes a field in a spec block of a CRD so that OLM can consume it - type: object - required: - - path - properties: - description: - type: string - displayName: - type: string - path: - type: string - value: - description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. - type: string - format: byte - x-descriptors: - type: array - items: - type: string - statusDescriptors: - type: array - items: - description: StatusDescriptor describes a field in a status block of a CRD so that OLM can consume it - type: object - required: - - path - properties: - description: - type: string - displayName: - type: string - path: - type: string - value: - description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. - type: string - format: byte - x-descriptors: - type: array - items: - type: string - version: - type: string - description: - type: string - displayName: - type: string - icon: - type: array - items: - type: object - required: - - base64data - - mediatype - properties: - base64data: - type: string - mediatype: - type: string - install: - description: NamedInstallStrategy represents the block of an ClusterServiceVersion resource where the install strategy is specified. - type: object - required: - - strategy - properties: - spec: - description: StrategyDetailsDeployment represents the parsed details of a Deployment InstallStrategy. - type: object - required: - - deployments - properties: - clusterPermissions: - type: array - items: - description: StrategyDeploymentPermissions describe the rbac rules and service account needed by the install strategy - type: object - required: - - rules - - serviceAccountName - properties: - rules: - type: array - items: - description: PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to. - type: object - required: - - verbs - properties: - apiGroups: - description: APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. - type: array - items: - type: string - nonResourceURLs: - description: NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. - type: array - items: - type: string - resourceNames: - description: ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. - type: array - items: - type: string - resources: - description: Resources is a list of resources this rule applies to. '*' represents all resources. - type: array - items: - type: string - verbs: - description: Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. - type: array - items: - type: string - serviceAccountName: - type: string - deployments: - type: array - items: - description: StrategyDeploymentSpec contains the name, spec and labels for the deployment ALM should create - type: object - required: - - name - - spec - properties: - label: - description: Set is a map of label:value. It implements Labels. - type: object - additionalProperties: - type: string - name: - type: string - spec: - description: DeploymentSpec is the specification of the desired behavior of the Deployment. - type: object - required: - - selector - - template - properties: - minReadySeconds: - description: Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready) - type: integer - format: int32 - paused: - description: Indicates that the deployment is paused. - type: boolean - progressDeadlineSeconds: - description: The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s. - type: integer - format: int32 - replicas: - description: Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. - type: integer - format: int32 - revisionHistoryLimit: - description: The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. - type: integer - format: int32 - selector: - description: Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. It must match the pod template's labels. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - strategy: - description: The deployment strategy to use to replace existing pods with new ones. - type: object - properties: - rollingUpdate: - description: 'Rolling update config params. Present only if DeploymentStrategyType = RollingUpdate. --- TODO: Update this to follow our convention for oneOf, whatever we decide it to be.' - type: object - properties: - maxSurge: - description: 'The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. Defaults to 25%. Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new ReplicaSet can be scaled up further, ensuring that total number of pods running at any time during the update is at most 130% of desired pods.' - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - maxUnavailable: - description: 'The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. Defaults to 25%. Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old ReplicaSet can be scaled down further, followed by scaling up the new ReplicaSet, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods.' - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - type: - description: Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. - type: string - template: - description: Template describes the pods that will be created. - type: object - properties: - metadata: - description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' - type: object - x-kubernetes-preserve-unknown-fields: true - spec: - description: 'Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status' - type: object - required: - - containers - properties: - activeDeadlineSeconds: - description: Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer. - type: integer - format: int64 - affinity: - description: If specified, the pod's scheduling constraints - type: object - properties: - nodeAffinity: - description: Describes node affinity scheduling rules for the pod. - type: object - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred. - type: array - items: - description: An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). - type: object - required: - - preference - - weight - properties: - preference: - description: A node selector term, associated with the corresponding weight. - type: object - properties: - matchExpressions: - description: A list of node selector requirements by node's labels. - type: array - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchFields: - description: A list of node selector requirements by node's fields. - type: array - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - type: array - items: - type: string - weight: - description: Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. - type: integer - format: int32 - requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node. - type: object - required: - - nodeSelectorTerms - properties: - nodeSelectorTerms: - description: Required. A list of node selector terms. The terms are ORed. - type: array - items: - description: A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. - type: object - properties: - matchExpressions: - description: A list of node selector requirements by node's labels. - type: array - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchFields: - description: A list of node selector requirements by node's fields. - type: array - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - type: array - items: - type: string - podAffinity: - description: Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)). - type: object - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. - type: array - items: - description: The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) - type: object - required: - - podAffinityTerm - - weight - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated with the corresponding weight. - type: object - required: - - topologyKey - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". - type: array - items: - type: string - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - weight: - description: weight associated with matching the corresponding podAffinityTerm, in the range 1-100. - type: integer - format: int32 - requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. - type: array - items: - description: Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running - type: object - required: - - topologyKey - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". - type: array - items: - type: string - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - podAntiAffinity: - description: Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)). - type: object - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. - type: array - items: - description: The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) - type: object - required: - - podAffinityTerm - - weight - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated with the corresponding weight. - type: object - required: - - topologyKey - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". - type: array - items: - type: string - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - weight: - description: weight associated with matching the corresponding podAffinityTerm, in the range 1-100. - type: integer - format: int32 - requiredDuringSchedulingIgnoredDuringExecution: - description: If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. - type: array - items: - description: Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running - type: object - required: - - topologyKey - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". - type: array - items: - type: string - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - automountServiceAccountToken: - description: AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. - type: boolean - containers: - description: List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated. - type: array - items: - description: A single application container that you want to run within a pod. - type: object - required: - - name - properties: - args: - description: 'Arguments to the entrypoint. The container image''s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - type: array - items: - type: string - command: - description: 'Entrypoint array. Not executed within a shell. The container image''s ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - type: array - items: - type: string - env: - description: List of environment variables to set in the container. Cannot be updated. - type: array - items: - description: EnvVar represents an environment variable present in a Container. - type: object - required: - - name - properties: - name: - description: Name of the environment variable. Must be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. Cannot be used if value is not empty. - type: object - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - type: object - required: - - key - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or its key must be defined - type: boolean - fieldRef: - description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' - type: object - required: - - fieldPath - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.' - type: object - required: - - resource - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - secretKeyRef: - description: Selects a key of a secret in the pod's namespace - type: object - required: - - key - properties: - key: - description: The key of the secret to select from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret or its key must be defined - type: boolean - envFrom: - description: List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. - type: array - items: - description: EnvFromSource represents the source of a set of ConfigMaps - type: object - properties: - configMapRef: - description: The ConfigMap to select from - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap must be defined - type: boolean - prefix: - description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. - type: string - secretRef: - description: The Secret to select from - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret must be defined - type: boolean - image: - description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.' - type: string - imagePullPolicy: - description: 'Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' - type: string - lifecycle: - description: Actions that the management system should take in response to container lifecycle events. Cannot be updated. - type: object - properties: - postStart: - description: 'PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - type: object - properties: - exec: - description: Exec specifies the action to take. - type: object - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - type: array - items: - type: string - httpGet: - description: HTTPGet specifies the http request to perform. - type: object - required: - - port - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - type: array - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - type: object - required: - - name - - value - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - tcpSocket: - description: Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified. - type: object - required: - - port - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - preStop: - description: 'PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod''s termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod''s termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - type: object - properties: - exec: - description: Exec specifies the action to take. - type: object - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - type: array - items: - type: string - httpGet: - description: HTTPGet specifies the http request to perform. - type: object - required: - - port - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - type: array - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - type: object - required: - - name - - value - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - tcpSocket: - description: Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified. - type: object - required: - - port - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - livenessProbe: - description: 'Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: object - properties: - exec: - description: Exec specifies the action to take. - type: object - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - type: array - items: - type: string - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - type: integer - format: int32 - grpc: - description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. - type: object - required: - - port - properties: - port: - description: Port number of the gRPC service. Number must be in the range 1 to 65535. - type: integer - format: int32 - service: - description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." - type: string - httpGet: - description: HTTPGet specifies the http request to perform. - type: object - required: - - port - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - type: array - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - type: object - required: - - name - - value - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - type: integer - format: int32 - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - type: integer - format: int32 - tcpSocket: - description: TCPSocket specifies an action involving a TCP port. - type: object - required: - - port - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - type: integer - format: int64 - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - name: - description: Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. - type: string - ports: - description: List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default "0.0.0.0" address inside a container will be accessible from the network. Cannot be updated. - type: array - items: - description: ContainerPort represents a network port in a single container. - type: object - required: - - containerPort - properties: - containerPort: - description: Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. - type: integer - format: int32 - hostIP: - description: What host IP to bind the external port to. - type: string - hostPort: - description: Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. - type: integer - format: int32 - name: - description: If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. - type: string - protocol: - description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". - type: string - default: TCP - x-kubernetes-list-map-keys: - - containerPort - - protocol - x-kubernetes-list-type: map - readinessProbe: - description: 'Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: object - properties: - exec: - description: Exec specifies the action to take. - type: object - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - type: array - items: - type: string - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - type: integer - format: int32 - grpc: - description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. - type: object - required: - - port - properties: - port: - description: Port number of the gRPC service. Number must be in the range 1 to 65535. - type: integer - format: int32 - service: - description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." - type: string - httpGet: - description: HTTPGet specifies the http request to perform. - type: object - required: - - port - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - type: array - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - type: object - required: - - name - - value - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - type: integer - format: int32 - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - type: integer - format: int32 - tcpSocket: - description: TCPSocket specifies an action involving a TCP port. - type: object - required: - - port - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - type: integer - format: int64 - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - resources: - description: 'Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - properties: - limits: - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - additionalProperties: - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - requests: - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - additionalProperties: - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - securityContext: - description: 'SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' - type: object - properties: - allowPrivilegeEscalation: - description: 'AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.' - type: boolean - capabilities: - description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. Note that this field cannot be set when spec.os.name is windows. - type: object - properties: - add: - description: Added capabilities - type: array - items: - description: Capability represent POSIX capabilities type - type: string - drop: - description: Removed capabilities - type: array - items: - description: Capability represent POSIX capabilities type - type: string - privileged: - description: Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows. - type: boolean - procMount: - description: procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. - type: string - readOnlyRootFilesystem: - description: Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows. - type: boolean - runAsGroup: - description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. - type: integer - format: int64 - runAsNonRoot: - description: Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. - type: integer - format: int64 - seLinuxOptions: - description: The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. - type: object - properties: - level: - description: Level is SELinux level label that applies to the container. - type: string - role: - description: Role is a SELinux role label that applies to the container. - type: string - type: - description: Type is a SELinux type label that applies to the container. - type: string - user: - description: User is a SELinux user label that applies to the container. - type: string - seccompProfile: - description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows. - type: object - required: - - type - properties: - localhostProfile: - description: localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". - type: string - type: - description: "type indicates which kind of seccomp profile will be applied. Valid options are: \n Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied." - type: string - windowsOptions: - description: The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux. - type: object - properties: - gmsaCredentialSpec: - description: GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the GMSA credential spec to use. - type: string - hostProcess: - description: HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: string - startupProbe: - description: 'StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod''s lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: object - properties: - exec: - description: Exec specifies the action to take. - type: object - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - type: array - items: - type: string - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - type: integer - format: int32 - grpc: - description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. - type: object - required: - - port - properties: - port: - description: Port number of the gRPC service. Number must be in the range 1 to 65535. - type: integer - format: int32 - service: - description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." - type: string - httpGet: - description: HTTPGet specifies the http request to perform. - type: object - required: - - port - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - type: array - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - type: object - required: - - name - - value - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - type: integer - format: int32 - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - type: integer - format: int32 - tcpSocket: - description: TCPSocket specifies an action involving a TCP port. - type: object - required: - - port - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - type: integer - format: int64 - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - stdin: - description: Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false. - type: boolean - stdinOnce: - description: Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false - type: boolean - terminationMessagePath: - description: 'Optional: Path at which the file to which the container''s termination message will be written is mounted into the container''s filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.' - type: string - terminationMessagePolicy: - description: Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. - type: string - tty: - description: Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false. - type: boolean - volumeDevices: - description: volumeDevices is the list of block devices to be used by the container. - type: array - items: - description: volumeDevice describes a mapping of a raw block device within a container. - type: object - required: - - devicePath - - name - properties: - devicePath: - description: devicePath is the path inside of the container that the device will be mapped to. - type: string - name: - description: name must match the name of a persistentVolumeClaim in the pod - type: string - volumeMounts: - description: Pod volumes to mount into the container's filesystem. Cannot be updated. - type: array - items: - description: VolumeMount describes a mounting of a Volume within a container. - type: object - required: - - mountPath - - name - properties: - mountPath: - description: Path within the container at which the volume should be mounted. Must not contain ':'. - type: string - mountPropagation: - description: mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. - type: string - name: - description: This must match the Name of a Volume. - type: string - readOnly: - description: Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. - type: boolean - subPath: - description: Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). - type: string - subPathExpr: - description: Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to "" (volume's root). SubPathExpr and SubPath are mutually exclusive. - type: string - workingDir: - description: Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated. - type: string - dnsConfig: - description: Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. - type: object - properties: - nameservers: - description: A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. - type: array - items: - type: string - options: - description: A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy. - type: array - items: - description: PodDNSConfigOption defines DNS resolver options of a pod. - type: object - properties: - name: - description: Required. - type: string - value: - type: string - searches: - description: A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed. - type: array - items: - type: string - dnsPolicy: - description: Set DNS policy for the pod. Defaults to "ClusterFirst". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'. - type: string - enableServiceLinks: - description: 'EnableServiceLinks indicates whether information about services should be injected into pod''s environment variables, matching the syntax of Docker links. Optional: Defaults to true.' - type: boolean - ephemeralContainers: - description: List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource. This field is beta-level and available on clusters that haven't disabled the EphemeralContainers feature gate. - type: array - items: - description: "An EphemeralContainer is a temporary container that you may add to an existing Pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a Pod is removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the Pod to exceed its resource allocation. \n To add an ephemeral container, use the ephemeralcontainers subresource of an existing Pod. Ephemeral containers may not be removed or restarted. \n This is a beta feature available on clusters that haven't disabled the EphemeralContainers feature gate." - type: object - required: - - name - properties: - args: - description: 'Arguments to the entrypoint. The image''s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - type: array - items: - type: string - command: - description: 'Entrypoint array. Not executed within a shell. The image''s ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - type: array - items: - type: string - env: - description: List of environment variables to set in the container. Cannot be updated. - type: array - items: - description: EnvVar represents an environment variable present in a Container. - type: object - required: - - name - properties: - name: - description: Name of the environment variable. Must be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. Cannot be used if value is not empty. - type: object - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - type: object - required: - - key - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or its key must be defined - type: boolean - fieldRef: - description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' - type: object - required: - - fieldPath - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.' - type: object - required: - - resource - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - secretKeyRef: - description: Selects a key of a secret in the pod's namespace - type: object - required: - - key - properties: - key: - description: The key of the secret to select from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret or its key must be defined - type: boolean - envFrom: - description: List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. - type: array - items: - description: EnvFromSource represents the source of a set of ConfigMaps - type: object - properties: - configMapRef: - description: The ConfigMap to select from - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap must be defined - type: boolean - prefix: - description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. - type: string - secretRef: - description: The Secret to select from - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret must be defined - type: boolean - image: - description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images' - type: string - imagePullPolicy: - description: 'Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' - type: string - lifecycle: - description: Lifecycle is not allowed for ephemeral containers. - type: object - properties: - postStart: - description: 'PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - type: object - properties: - exec: - description: Exec specifies the action to take. - type: object - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - type: array - items: - type: string - httpGet: - description: HTTPGet specifies the http request to perform. - type: object - required: - - port - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - type: array - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - type: object - required: - - name - - value - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - tcpSocket: - description: Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified. - type: object - required: - - port - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - preStop: - description: 'PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod''s termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod''s termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - type: object - properties: - exec: - description: Exec specifies the action to take. - type: object - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - type: array - items: - type: string - httpGet: - description: HTTPGet specifies the http request to perform. - type: object - required: - - port - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - type: array - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - type: object - required: - - name - - value - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - tcpSocket: - description: Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified. - type: object - required: - - port - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - livenessProbe: - description: Probes are not allowed for ephemeral containers. - type: object - properties: - exec: - description: Exec specifies the action to take. - type: object - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - type: array - items: - type: string - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - type: integer - format: int32 - grpc: - description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. - type: object - required: - - port - properties: - port: - description: Port number of the gRPC service. Number must be in the range 1 to 65535. - type: integer - format: int32 - service: - description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." - type: string - httpGet: - description: HTTPGet specifies the http request to perform. - type: object - required: - - port - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - type: array - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - type: object - required: - - name - - value - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - type: integer - format: int32 - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - type: integer - format: int32 - tcpSocket: - description: TCPSocket specifies an action involving a TCP port. - type: object - required: - - port - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - type: integer - format: int64 - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - name: - description: Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers. - type: string - ports: - description: Ports are not allowed for ephemeral containers. - type: array - items: - description: ContainerPort represents a network port in a single container. - type: object - required: - - containerPort - properties: - containerPort: - description: Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. - type: integer - format: int32 - hostIP: - description: What host IP to bind the external port to. - type: string - hostPort: - description: Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. - type: integer - format: int32 - name: - description: If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. - type: string - protocol: - description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". - type: string - default: TCP - x-kubernetes-list-map-keys: - - containerPort - - protocol - x-kubernetes-list-type: map - readinessProbe: - description: Probes are not allowed for ephemeral containers. - type: object - properties: - exec: - description: Exec specifies the action to take. - type: object - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - type: array - items: - type: string - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - type: integer - format: int32 - grpc: - description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. - type: object - required: - - port - properties: - port: - description: Port number of the gRPC service. Number must be in the range 1 to 65535. - type: integer - format: int32 - service: - description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." - type: string - httpGet: - description: HTTPGet specifies the http request to perform. - type: object - required: - - port - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - type: array - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - type: object - required: - - name - - value - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - type: integer - format: int32 - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - type: integer - format: int32 - tcpSocket: - description: TCPSocket specifies an action involving a TCP port. - type: object - required: - - port - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - type: integer - format: int64 - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - resources: - description: Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod. - type: object - properties: - limits: - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - additionalProperties: - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - requests: - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - additionalProperties: - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - securityContext: - description: 'Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.' - type: object - properties: - allowPrivilegeEscalation: - description: 'AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.' - type: boolean - capabilities: - description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. Note that this field cannot be set when spec.os.name is windows. - type: object - properties: - add: - description: Added capabilities - type: array - items: - description: Capability represent POSIX capabilities type - type: string - drop: - description: Removed capabilities - type: array - items: - description: Capability represent POSIX capabilities type - type: string - privileged: - description: Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows. - type: boolean - procMount: - description: procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. - type: string - readOnlyRootFilesystem: - description: Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows. - type: boolean - runAsGroup: - description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. - type: integer - format: int64 - runAsNonRoot: - description: Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. - type: integer - format: int64 - seLinuxOptions: - description: The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. - type: object - properties: - level: - description: Level is SELinux level label that applies to the container. - type: string - role: - description: Role is a SELinux role label that applies to the container. - type: string - type: - description: Type is a SELinux type label that applies to the container. - type: string - user: - description: User is a SELinux user label that applies to the container. - type: string - seccompProfile: - description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows. - type: object - required: - - type - properties: - localhostProfile: - description: localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". - type: string - type: - description: "type indicates which kind of seccomp profile will be applied. Valid options are: \n Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied." - type: string - windowsOptions: - description: The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux. - type: object - properties: - gmsaCredentialSpec: - description: GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the GMSA credential spec to use. - type: string - hostProcess: - description: HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: string - startupProbe: - description: Probes are not allowed for ephemeral containers. - type: object - properties: - exec: - description: Exec specifies the action to take. - type: object - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - type: array - items: - type: string - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - type: integer - format: int32 - grpc: - description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. - type: object - required: - - port - properties: - port: - description: Port number of the gRPC service. Number must be in the range 1 to 65535. - type: integer - format: int32 - service: - description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." - type: string - httpGet: - description: HTTPGet specifies the http request to perform. - type: object - required: - - port - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - type: array - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - type: object - required: - - name - - value - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - type: integer - format: int32 - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - type: integer - format: int32 - tcpSocket: - description: TCPSocket specifies an action involving a TCP port. - type: object - required: - - port - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - type: integer - format: int64 - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - stdin: - description: Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false. - type: boolean - stdinOnce: - description: Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false - type: boolean - targetContainerName: - description: "If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container uses the namespaces configured in the Pod spec. \n The container runtime must implement support for this feature. If the runtime does not support namespace targeting then the result of setting this field is undefined." - type: string - terminationMessagePath: - description: 'Optional: Path at which the file to which the container''s termination message will be written is mounted into the container''s filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.' - type: string - terminationMessagePolicy: - description: Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. - type: string - tty: - description: Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false. - type: boolean - volumeDevices: - description: volumeDevices is the list of block devices to be used by the container. - type: array - items: - description: volumeDevice describes a mapping of a raw block device within a container. - type: object - required: - - devicePath - - name - properties: - devicePath: - description: devicePath is the path inside of the container that the device will be mapped to. - type: string - name: - description: name must match the name of a persistentVolumeClaim in the pod - type: string - volumeMounts: - description: Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers. Cannot be updated. - type: array - items: - description: VolumeMount describes a mounting of a Volume within a container. - type: object - required: - - mountPath - - name - properties: - mountPath: - description: Path within the container at which the volume should be mounted. Must not contain ':'. - type: string - mountPropagation: - description: mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. - type: string - name: - description: This must match the Name of a Volume. - type: string - readOnly: - description: Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. - type: boolean - subPath: - description: Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). - type: string - subPathExpr: - description: Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to "" (volume's root). SubPathExpr and SubPath are mutually exclusive. - type: string - workingDir: - description: Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated. - type: string - hostAliases: - description: HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods. - type: array - items: - description: HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file. - type: object - properties: - hostnames: - description: Hostnames for the above IP address. - type: array - items: - type: string - ip: - description: IP address of the host file entry. - type: string - hostIPC: - description: 'Use the host''s ipc namespace. Optional: Default to false.' - type: boolean - hostNetwork: - description: Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false. - type: boolean - hostPID: - description: 'Use the host''s pid namespace. Optional: Default to false.' - type: boolean - hostname: - description: Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. - type: string - imagePullSecrets: - description: 'ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' - type: array - items: - description: LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - initContainers: - description: 'List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/' - type: array - items: - description: A single application container that you want to run within a pod. - type: object - required: - - name - properties: - args: - description: 'Arguments to the entrypoint. The container image''s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - type: array - items: - type: string - command: - description: 'Entrypoint array. Not executed within a shell. The container image''s ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' - type: array - items: - type: string - env: - description: List of environment variables to set in the container. Cannot be updated. - type: array - items: - description: EnvVar represents an environment variable present in a Container. - type: object - required: - - name - properties: - name: - description: Name of the environment variable. Must be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. Cannot be used if value is not empty. - type: object - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - type: object - required: - - key - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or its key must be defined - type: boolean - fieldRef: - description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' - type: object - required: - - fieldPath - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.' - type: object - required: - - resource - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - secretKeyRef: - description: Selects a key of a secret in the pod's namespace - type: object - required: - - key - properties: - key: - description: The key of the secret to select from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret or its key must be defined - type: boolean - envFrom: - description: List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. - type: array - items: - description: EnvFromSource represents the source of a set of ConfigMaps - type: object - properties: - configMapRef: - description: The ConfigMap to select from - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap must be defined - type: boolean - prefix: - description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. - type: string - secretRef: - description: The Secret to select from - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret must be defined - type: boolean - image: - description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.' - type: string - imagePullPolicy: - description: 'Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' - type: string - lifecycle: - description: Actions that the management system should take in response to container lifecycle events. Cannot be updated. - type: object - properties: - postStart: - description: 'PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - type: object - properties: - exec: - description: Exec specifies the action to take. - type: object - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - type: array - items: - type: string - httpGet: - description: HTTPGet specifies the http request to perform. - type: object - required: - - port - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - type: array - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - type: object - required: - - name - - value - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - tcpSocket: - description: Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified. - type: object - required: - - port - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - preStop: - description: 'PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod''s termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod''s termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' - type: object - properties: - exec: - description: Exec specifies the action to take. - type: object - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - type: array - items: - type: string - httpGet: - description: HTTPGet specifies the http request to perform. - type: object - required: - - port - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - type: array - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - type: object - required: - - name - - value - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - tcpSocket: - description: Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified. - type: object - required: - - port - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - livenessProbe: - description: 'Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: object - properties: - exec: - description: Exec specifies the action to take. - type: object - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - type: array - items: - type: string - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - type: integer - format: int32 - grpc: - description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. - type: object - required: - - port - properties: - port: - description: Port number of the gRPC service. Number must be in the range 1 to 65535. - type: integer - format: int32 - service: - description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." - type: string - httpGet: - description: HTTPGet specifies the http request to perform. - type: object - required: - - port - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - type: array - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - type: object - required: - - name - - value - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - type: integer - format: int32 - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - type: integer - format: int32 - tcpSocket: - description: TCPSocket specifies an action involving a TCP port. - type: object - required: - - port - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - type: integer - format: int64 - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - name: - description: Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. - type: string - ports: - description: List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default "0.0.0.0" address inside a container will be accessible from the network. Cannot be updated. - type: array - items: - description: ContainerPort represents a network port in a single container. - type: object - required: - - containerPort - properties: - containerPort: - description: Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. - type: integer - format: int32 - hostIP: - description: What host IP to bind the external port to. - type: string - hostPort: - description: Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. - type: integer - format: int32 - name: - description: If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. - type: string - protocol: - description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". - type: string - default: TCP - x-kubernetes-list-map-keys: - - containerPort - - protocol - x-kubernetes-list-type: map - readinessProbe: - description: 'Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: object - properties: - exec: - description: Exec specifies the action to take. - type: object - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - type: array - items: - type: string - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - type: integer - format: int32 - grpc: - description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. - type: object - required: - - port - properties: - port: - description: Port number of the gRPC service. Number must be in the range 1 to 65535. - type: integer - format: int32 - service: - description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." - type: string - httpGet: - description: HTTPGet specifies the http request to perform. - type: object - required: - - port - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - type: array - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - type: object - required: - - name - - value - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - type: integer - format: int32 - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - type: integer - format: int32 - tcpSocket: - description: TCPSocket specifies an action involving a TCP port. - type: object - required: - - port - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - type: integer - format: int64 - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - resources: - description: 'Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - properties: - limits: - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - additionalProperties: - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - requests: - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - additionalProperties: - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - securityContext: - description: 'SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' - type: object - properties: - allowPrivilegeEscalation: - description: 'AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.' - type: boolean - capabilities: - description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. Note that this field cannot be set when spec.os.name is windows. - type: object - properties: - add: - description: Added capabilities - type: array - items: - description: Capability represent POSIX capabilities type - type: string - drop: - description: Removed capabilities - type: array - items: - description: Capability represent POSIX capabilities type - type: string - privileged: - description: Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows. - type: boolean - procMount: - description: procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. - type: string - readOnlyRootFilesystem: - description: Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows. - type: boolean - runAsGroup: - description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. - type: integer - format: int64 - runAsNonRoot: - description: Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. - type: integer - format: int64 - seLinuxOptions: - description: The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. - type: object - properties: - level: - description: Level is SELinux level label that applies to the container. - type: string - role: - description: Role is a SELinux role label that applies to the container. - type: string - type: - description: Type is a SELinux type label that applies to the container. - type: string - user: - description: User is a SELinux user label that applies to the container. - type: string - seccompProfile: - description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows. - type: object - required: - - type - properties: - localhostProfile: - description: localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". - type: string - type: - description: "type indicates which kind of seccomp profile will be applied. Valid options are: \n Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied." - type: string - windowsOptions: - description: The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux. - type: object - properties: - gmsaCredentialSpec: - description: GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the GMSA credential spec to use. - type: string - hostProcess: - description: HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: string - startupProbe: - description: 'StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod''s lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: object - properties: - exec: - description: Exec specifies the action to take. - type: object - properties: - command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. - type: array - items: - type: string - failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. - type: integer - format: int32 - grpc: - description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. - type: object - required: - - port - properties: - port: - description: Port number of the gRPC service. Number must be in the range 1 to 65535. - type: integer - format: int32 - service: - description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." - type: string - httpGet: - description: HTTPGet specifies the http request to perform. - type: object - required: - - port - properties: - host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. - type: array - items: - description: HTTPHeader describes a custom header to be used in HTTP probes - type: object - required: - - name - - value - properties: - name: - description: The header field name - type: string - value: - description: The header field value - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. - type: string - initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. - type: integer - format: int32 - successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. - type: integer - format: int32 - tcpSocket: - description: TCPSocket specifies an action involving a TCP port. - type: object - required: - - port - properties: - host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' - type: string - port: - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - type: integer - format: int64 - timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' - type: integer - format: int32 - stdin: - description: Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false. - type: boolean - stdinOnce: - description: Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false - type: boolean - terminationMessagePath: - description: 'Optional: Path at which the file to which the container''s termination message will be written is mounted into the container''s filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.' - type: string - terminationMessagePolicy: - description: Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. - type: string - tty: - description: Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false. - type: boolean - volumeDevices: - description: volumeDevices is the list of block devices to be used by the container. - type: array - items: - description: volumeDevice describes a mapping of a raw block device within a container. - type: object - required: - - devicePath - - name - properties: - devicePath: - description: devicePath is the path inside of the container that the device will be mapped to. - type: string - name: - description: name must match the name of a persistentVolumeClaim in the pod - type: string - volumeMounts: - description: Pod volumes to mount into the container's filesystem. Cannot be updated. - type: array - items: - description: VolumeMount describes a mounting of a Volume within a container. - type: object - required: - - mountPath - - name - properties: - mountPath: - description: Path within the container at which the volume should be mounted. Must not contain ':'. - type: string - mountPropagation: - description: mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. - type: string - name: - description: This must match the Name of a Volume. - type: string - readOnly: - description: Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. - type: boolean - subPath: - description: Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). - type: string - subPathExpr: - description: Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to "" (volume's root). SubPathExpr and SubPath are mutually exclusive. - type: string - workingDir: - description: Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated. - type: string - nodeName: - description: NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements. - type: string - nodeSelector: - description: 'NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node''s labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' - type: object - additionalProperties: - type: string - x-kubernetes-map-type: atomic - os: - description: "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set. \n If the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions \n If the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup This is a beta field and requires the IdentifyPodOS feature" - type: object - required: - - name - properties: - name: - description: 'Name is the name of the operating system. The currently supported values are linux and windows. Additional value may be defined in future and can be one of: https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration Clients should expect to handle additional values and treat unrecognized values in this field as os: null' - type: string - overhead: - description: 'Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md' - type: object - additionalProperties: - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - preemptionPolicy: - description: PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. - type: string - priority: - description: The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. - type: integer - format: int32 - priorityClassName: - description: If specified, indicates the pod's priority. "system-node-critical" and "system-cluster-critical" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default. - type: string - readinessGates: - description: 'If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to "True" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates' - type: array - items: - description: PodReadinessGate contains the reference to a pod condition - type: object - required: - - conditionType - properties: - conditionType: - description: ConditionType refers to a condition in the pod's condition list with matching type. - type: string - restartPolicy: - description: 'Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy' - type: string - runtimeClassName: - description: 'RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class' - type: string - schedulerName: - description: If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. - type: string - securityContext: - description: 'SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.' - type: object - properties: - fsGroup: - description: "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod: \n 1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw---- \n If unset, the Kubelet will not modify the ownership and permissions of any volume. Note that this field cannot be set when spec.os.name is windows." - type: integer - format: int64 - fsGroupChangePolicy: - description: 'fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are "OnRootMismatch" and "Always". If not specified, "Always" is used. Note that this field cannot be set when spec.os.name is windows.' - type: string - runAsGroup: - description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows. - type: integer - format: int64 - runAsNonRoot: - description: Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows. - type: integer - format: int64 - seLinuxOptions: - description: The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows. - type: object - properties: - level: - description: Level is SELinux level label that applies to the container. - type: string - role: - description: Role is a SELinux role label that applies to the container. - type: string - type: - description: Type is a SELinux type label that applies to the container. - type: string - user: - description: User is a SELinux user label that applies to the container. - type: string - seccompProfile: - description: The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. - type: object - required: - - type - properties: - localhostProfile: - description: localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". - type: string - type: - description: "type indicates which kind of seccomp profile will be applied. Valid options are: \n Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied." - type: string - supplementalGroups: - description: A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container. Note that this field cannot be set when spec.os.name is windows. - type: array - items: - type: integer - format: int64 - sysctls: - description: Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows. - type: array - items: - description: Sysctl defines a kernel parameter to be set - type: object - required: - - name - - value - properties: - name: - description: Name of a property to set - type: string - value: - description: Value of a property to set - type: string - windowsOptions: - description: The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux. - type: object - properties: - gmsaCredentialSpec: - description: GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the GMSA credential spec to use. - type: string - hostProcess: - description: HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - type: string - serviceAccount: - description: 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.' - type: string - serviceAccountName: - description: 'ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/' - type: string - setHostnameAsFQDN: - description: If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false. - type: boolean - shareProcessNamespace: - description: 'Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.' - type: boolean - subdomain: - description: If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all. - type: string - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds. - type: integer - format: int64 - tolerations: - description: If specified, the pod's tolerations. - type: array - items: - description: The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . - type: object - properties: - effect: - description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. - type: string - operator: - description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. - type: string - tolerationSeconds: - description: TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. - type: integer - format: int64 - value: - description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. - type: string - topologySpreadConstraints: - description: TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed. - type: array - items: - description: TopologySpreadConstraint specifies how to spread matching pods among the given topology. - type: object - required: - - maxSkew - - topologyKey - - whenUnsatisfiable - properties: - labelSelector: - description: LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - maxSkew: - description: 'MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. The global minimum is the minimum number of matching pods in an eligible domain or zero if the number of eligible domains is less than MinDomains. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 2/2/1: In this case, the global minimum is 1. | zone1 | zone2 | zone3 | | P P | P P | P | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It''s a required field. Default value is 1 and 0 is not allowed.' - type: integer - format: int32 - minDomains: - description: "MinDomains indicates a minimum number of eligible domains. When the number of eligible domains with matching topology keys is less than minDomains, Pod Topology Spread treats \"global minimum\" as 0, and then the calculation of Skew is performed. And when the number of eligible domains with matching topology keys equals or greater than minDomains, this value has no effect on scheduling. As a result, when the number of eligible domains is less than minDomains, scheduler won't schedule more than maxSkew Pods to those domains. If value is nil, the constraint behaves as if MinDomains is equal to 1. Valid values are integers greater than 0. When value is not nil, WhenUnsatisfiable must be DoNotSchedule. \n For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same labelSelector spread as 2/2/2: | zone1 | zone2 | zone3 | | P P | P P | P P | The number of domains is less than 5(MinDomains), so \"global minimum\" is treated as 0. In this situation, new pod with the same labelSelector cannot be scheduled, because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, it will violate MaxSkew. \n This is an alpha field and requires enabling MinDomainsInPodTopologySpread feature gate." - type: integer - format: int32 - topologyKey: - description: TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each as a "bucket", and try to put balanced number of pods into each bucket. We define a domain as a particular instance of a topology. Also, we define an eligible domain as a domain whose nodes match the node selector. e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology. And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology. It's a required field. - type: string - whenUnsatisfiable: - description: 'WhenUnsatisfiable indicates how to deal with a pod if it doesn''t satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location, but giving higher precedence to topologies that would help reduce the skew. A constraint is considered "Unsatisfiable" for an incoming pod if and only if every possible node assignment for that pod would violate "MaxSkew" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won''t make it *more* imbalanced. It''s a required field.' - type: string - x-kubernetes-list-map-keys: - - topologyKey - - whenUnsatisfiable - x-kubernetes-list-type: map - volumes: - description: 'List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes' - type: array - items: - description: Volume represents a named volume in a pod that may be accessed by any container in the pod. - type: object - required: - - name - properties: - awsElasticBlockStore: - description: 'awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' - type: object - required: - - volumeID - properties: - fsType: - description: 'fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - partition: - description: 'partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).' - type: integer - format: int32 - readOnly: - description: 'readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' - type: boolean - volumeID: - description: 'volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' - type: string - azureDisk: - description: azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. - type: object - required: - - diskName - - diskURI - properties: - cachingMode: - description: 'cachingMode is the Host Caching mode: None, Read Only, Read Write.' - type: string - diskName: - description: diskName is the Name of the data disk in the blob storage - type: string - diskURI: - description: diskURI is the URI of data disk in the blob storage - type: string - fsType: - description: fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - type: string - kind: - description: 'kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared' - type: string - readOnly: - description: readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - azureFile: - description: azureFile represents an Azure File Service mount on the host and bind mount to the pod. - type: object - required: - - secretName - - shareName - properties: - readOnly: - description: readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - secretName: - description: secretName is the name of secret that contains Azure Storage Account Name and Key - type: string - shareName: - description: shareName is the azure share Name - type: string - cephfs: - description: cephFS represents a Ceph FS mount on the host that shares a pod's lifetime - type: object - required: - - monitors - properties: - monitors: - description: 'monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - type: array - items: - type: string - path: - description: 'path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /' - type: string - readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - type: boolean - secretFile: - description: 'secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - type: string - secretRef: - description: 'secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - user: - description: 'user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - type: string - cinder: - description: 'cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' - type: object - required: - - volumeID - properties: - fsType: - description: 'fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' - type: string - readOnly: - description: 'readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' - type: boolean - secretRef: - description: 'secretRef is optional: points to a secret object containing parameters used to connect to OpenStack.' - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - volumeID: - description: 'volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' - type: string - configMap: - description: configMap represents a configMap that should populate this volume - type: object - properties: - defaultMode: - description: 'defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - items: - description: items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - type: array - items: - description: Maps a string key to a path within a volume. - type: object - required: - - key - - path - properties: - key: - description: key is the key to project. - type: string - mode: - description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - path: - description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: optional specify whether the ConfigMap or its keys must be defined - type: boolean - csi: - description: csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). - type: object - required: - - driver - properties: - driver: - description: driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster. - type: string - fsType: - description: fsType to mount. Ex. "ext4", "xfs", "ntfs". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply. - type: string - nodePublishSecretRef: - description: nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed. - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - readOnly: - description: readOnly specifies a read-only configuration for the volume. Defaults to false (read/write). - type: boolean - volumeAttributes: - description: volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values. - type: object - additionalProperties: - type: string - downwardAPI: - description: downwardAPI represents downward API about the pod that should populate this volume - type: object - properties: - defaultMode: - description: 'Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - items: - description: Items is a list of downward API volume file - type: array - items: - description: DownwardAPIVolumeFile represents information to create the file containing the pod field - type: object - required: - - path - properties: - fieldRef: - description: 'Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.' - type: object - required: - - fieldPath - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - mode: - description: 'Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - path: - description: 'Required: Path is the relative path name of the file to be created. Must not be absolute or contain the ''..'' path. Must be utf-8 encoded. The first item of the relative path must not start with ''..''' - type: string - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.' - type: object - required: - - resource - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - emptyDir: - description: 'emptyDir represents a temporary directory that shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' - type: object - properties: - medium: - description: 'medium represents what type of storage medium should back this directory. The default is "" which means to use the node''s default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' - type: string - sizeLimit: - description: 'sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - ephemeral: - description: "ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed. \n Use this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity tracking are needed, c) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through a PersistentVolumeClaim (see EphemeralVolumeSource for more information on the connection between this volume type and PersistentVolumeClaim). \n Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod. \n Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information. \n A pod can use both types of ephemeral volumes and persistent volumes at the same time." - type: object - properties: - volumeClaimTemplate: - description: "Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long). \n An existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster. \n This field is read-only and no changes will be made by Kubernetes to the PVC after it has been created. \n Required, must not be nil." - type: object - required: - - spec - properties: - metadata: - description: May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation. - type: object - spec: - description: The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here. - type: object - properties: - accessModes: - description: 'accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' - type: array - items: - type: string - dataSource: - description: 'dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field.' - type: object - required: - - kind - - name - properties: - apiGroup: - description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - dataSourceRef: - description: 'dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While DataSource ignores disallowed values (dropping them), DataSourceRef preserves all values, and generates an error if a disallowed value is specified. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled.' - type: object - required: - - kind - - name - properties: - apiGroup: - description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - resources: - description: 'resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' - type: object - properties: - limits: - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - additionalProperties: - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - requests: - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - additionalProperties: - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - selector: - description: selector is a label query over volumes to consider for binding. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - storageClassName: - description: 'storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' - type: string - volumeMode: - description: volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. - type: string - volumeName: - description: volumeName is the binding reference to the PersistentVolume backing this claim. - type: string - fc: - description: fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. - type: object - properties: - fsType: - description: 'fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - lun: - description: 'lun is Optional: FC target lun number' - type: integer - format: int32 - readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.' - type: boolean - targetWWNs: - description: 'targetWWNs is Optional: FC target worldwide names (WWNs)' - type: array - items: - type: string - wwids: - description: 'wwids Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.' - type: array - items: - type: string - flexVolume: - description: flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. - type: object - required: - - driver - properties: - driver: - description: driver is the name of the driver to use for this volume. - type: string - fsType: - description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. - type: string - options: - description: 'options is Optional: this field holds extra command options if any.' - type: object - additionalProperties: - type: string - readOnly: - description: 'readOnly is Optional: defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.' - type: boolean - secretRef: - description: 'secretRef is Optional: secretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.' - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - flocker: - description: flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running - type: object - properties: - datasetName: - description: datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated - type: string - datasetUUID: - description: datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset - type: string - gcePersistentDisk: - description: 'gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' - type: object - required: - - pdName - properties: - fsType: - description: 'fsType is filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - partition: - description: 'partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' - type: integer - format: int32 - pdName: - description: 'pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' - type: string - readOnly: - description: 'readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' - type: boolean - gitRepo: - description: 'gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod''s container.' - type: object - required: - - repository - properties: - directory: - description: directory is the target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. - type: string - repository: - description: repository is the URL - type: string - revision: - description: revision is the commit hash for the specified revision. - type: string - glusterfs: - description: 'glusterfs represents a Glusterfs mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' - type: object - required: - - endpoints - - path - properties: - endpoints: - description: 'endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' - type: string - path: - description: 'path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' - type: string - readOnly: - description: 'readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' - type: boolean - hostPath: - description: 'hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath --- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not mount host directories as read/write.' - type: object - required: - - path - properties: - path: - description: 'path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' - type: string - type: - description: 'type for HostPath Volume Defaults to "" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' - type: string - iscsi: - description: 'iscsi represents an ISCSI Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' - type: object - required: - - iqn - - lun - - targetPortal - properties: - chapAuthDiscovery: - description: chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication - type: boolean - chapAuthSession: - description: chapAuthSession defines whether support iSCSI Session CHAP authentication - type: boolean - fsType: - description: 'fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - initiatorName: - description: initiatorName is the custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface : will be created for the connection. - type: string - iqn: - description: iqn is the target iSCSI Qualified Name. - type: string - iscsiInterface: - description: iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). - type: string - lun: - description: lun represents iSCSI Target Lun number. - type: integer - format: int32 - portals: - description: portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260). - type: array - items: - type: string - readOnly: - description: readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. - type: boolean - secretRef: - description: secretRef is the CHAP Secret for iSCSI target and initiator authentication - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - targetPortal: - description: targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260). - type: string - name: - description: 'name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - nfs: - description: 'nfs represents an NFS mount on the host that shares a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' - type: object - required: - - path - - server - properties: - path: - description: 'path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' - type: string - readOnly: - description: 'readOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' - type: boolean - server: - description: 'server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' - type: string - persistentVolumeClaim: - description: 'persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' - type: object - required: - - claimName - properties: - claimName: - description: 'claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' - type: string - readOnly: - description: readOnly Will force the ReadOnly setting in VolumeMounts. Default false. - type: boolean - photonPersistentDisk: - description: photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine - type: object - required: - - pdID - properties: - fsType: - description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - type: string - pdID: - description: pdID is the ID that identifies Photon Controller persistent disk - type: string - portworxVolume: - description: portworxVolume represents a portworx volume attached and mounted on kubelets host machine - type: object - required: - - volumeID - properties: - fsType: - description: fSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. - type: string - readOnly: - description: readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - volumeID: - description: volumeID uniquely identifies a Portworx volume - type: string - projected: - description: projected items for all in one resources secrets, configmaps, and downward API - type: object - properties: - defaultMode: - description: defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. - type: integer - format: int32 - sources: - description: sources is the list of volume projections - type: array - items: - description: Projection that may be projected along with other supported volume types - type: object - properties: - configMap: - description: configMap information about the configMap data to project - type: object - properties: - items: - description: items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - type: array - items: - description: Maps a string key to a path within a volume. - type: object - required: - - key - - path - properties: - key: - description: key is the key to project. - type: string - mode: - description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - path: - description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: optional specify whether the ConfigMap or its keys must be defined - type: boolean - downwardAPI: - description: downwardAPI information about the downwardAPI data to project - type: object - properties: - items: - description: Items is a list of DownwardAPIVolume file - type: array - items: - description: DownwardAPIVolumeFile represents information to create the file containing the pod field - type: object - required: - - path - properties: - fieldRef: - description: 'Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.' - type: object - required: - - fieldPath - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - mode: - description: 'Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - path: - description: 'Required: Path is the relative path name of the file to be created. Must not be absolute or contain the ''..'' path. Must be utf-8 encoded. The first item of the relative path must not start with ''..''' - type: string - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.' - type: object - required: - - resource - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - secret: - description: secret information about the secret data to project - type: object - properties: - items: - description: items if unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - type: array - items: - description: Maps a string key to a path within a volume. - type: object - required: - - key - - path - properties: - key: - description: key is the key to project. - type: string - mode: - description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - path: - description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: optional field specify whether the Secret or its key must be defined - type: boolean - serviceAccountToken: - description: serviceAccountToken is information about the serviceAccountToken data to project - type: object - required: - - path - properties: - audience: - description: audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver. - type: string - expirationSeconds: - description: expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes. - type: integer - format: int64 - path: - description: path is the path relative to the mount point of the file to project the token into. - type: string - quobyte: - description: quobyte represents a Quobyte mount on the host that shares a pod's lifetime - type: object - required: - - registry - - volume - properties: - group: - description: group to map volume access to Default is no group - type: string - readOnly: - description: readOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false. - type: boolean - registry: - description: registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes - type: string - tenant: - description: tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin - type: string - user: - description: user to map volume access to Defaults to serivceaccount user - type: string - volume: - description: volume is a string that references an already created Quobyte volume by name. - type: string - rbd: - description: 'rbd represents a Rados Block Device mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' - type: object - required: - - image - - monitors - properties: - fsType: - description: 'fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - image: - description: 'image is the rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: string - keyring: - description: 'keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: string - monitors: - description: 'monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: array - items: - type: string - pool: - description: 'pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: string - readOnly: - description: 'readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: boolean - secretRef: - description: 'secretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - user: - description: 'user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: string - scaleIO: - description: scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. - type: object - required: - - gateway - - secretRef - - system - properties: - fsType: - description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Default is "xfs". - type: string - gateway: - description: gateway is the host address of the ScaleIO API Gateway. - type: string - protectionDomain: - description: protectionDomain is the name of the ScaleIO Protection Domain for the configured storage. - type: string - readOnly: - description: readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - secretRef: - description: secretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail. - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - sslEnabled: - description: sslEnabled Flag enable/disable SSL communication with Gateway, default false - type: boolean - storageMode: - description: storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. - type: string - storagePool: - description: storagePool is the ScaleIO Storage Pool associated with the protection domain. - type: string - system: - description: system is the name of the storage system as configured in ScaleIO. - type: string - volumeName: - description: volumeName is the name of a volume already created in the ScaleIO system that is associated with this volume source. - type: string - secret: - description: 'secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' - type: object - properties: - defaultMode: - description: 'defaultMode is Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - items: - description: items If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - type: array - items: - description: Maps a string key to a path within a volume. - type: object - required: - - key - - path - properties: - key: - description: key is the key to project. - type: string - mode: - description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - path: - description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. - type: string - optional: - description: optional field specify whether the Secret or its keys must be defined - type: boolean - secretName: - description: 'secretName is the name of the secret in the pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' - type: string - storageos: - description: storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. - type: object - properties: - fsType: - description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - type: string - readOnly: - description: readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - secretRef: - description: secretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted. - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - volumeName: - description: volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace. - type: string - volumeNamespace: - description: volumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to "default" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created. - type: string - vsphereVolume: - description: vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine - type: object - required: - - volumePath - properties: - fsType: - description: fsType is filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - type: string - storagePolicyID: - description: storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName. - type: string - storagePolicyName: - description: storagePolicyName is the storage Policy Based Management (SPBM) profile name. - type: string - volumePath: - description: volumePath is the path that identifies vSphere volume vmdk - type: string - permissions: - type: array - items: - description: StrategyDeploymentPermissions describe the rbac rules and service account needed by the install strategy - type: object - required: - - rules - - serviceAccountName - properties: - rules: - type: array - items: - description: PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to. - type: object - required: - - verbs - properties: - apiGroups: - description: APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. - type: array - items: - type: string - nonResourceURLs: - description: NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. - type: array - items: - type: string - resourceNames: - description: ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. - type: array - items: - type: string - resources: - description: Resources is a list of resources this rule applies to. '*' represents all resources. - type: array - items: - type: string - verbs: - description: Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. - type: array - items: - type: string - serviceAccountName: - type: string - strategy: - type: string - installModes: - description: InstallModes specify supported installation types - type: array - items: - description: InstallMode associates an InstallModeType with a flag representing if the CSV supports it - type: object - required: - - supported - - type - properties: - supported: - type: boolean - type: - description: InstallModeType is a supported type of install mode for CSV installation - type: string - keywords: - type: array - items: - type: string - labels: - description: Map of string keys and values that can be used to organize and categorize (scope and select) objects. - type: object - additionalProperties: - type: string - links: - type: array - items: - type: object - properties: - name: - type: string - url: - type: string - maintainers: - type: array - items: - type: object - properties: - email: - type: string - name: - type: string - maturity: - type: string - minKubeVersion: - type: string - nativeAPIs: - type: array - items: - description: GroupVersionKind unambiguously identifies a kind. It doesn't anonymously include GroupVersion to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling - type: object - required: - - group - - kind - - version - properties: - group: - type: string - kind: - type: string - version: - type: string - provider: - type: object - properties: - name: - type: string - url: - type: string - relatedImages: - description: List any related images, or other container images that your Operator might require to perform their functions. This list should also include operand images as well. All image references should be specified by digest (SHA) and not by tag. This field is only used during catalog creation and plays no part in cluster runtime. - type: array - items: - type: object - required: - - image - - name - properties: - image: - type: string - name: - type: string - replaces: - description: The name of a CSV this one replaces. Should match the `metadata.Name` field of the old CSV. - type: string - selector: - description: Label selector for related resources. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - skips: - description: The name(s) of one or more CSV(s) that should be skipped in the upgrade graph. Should match the `metadata.Name` field of the CSV that should be skipped. This field is only used during catalog creation and plays no part in cluster runtime. - type: array - items: - type: string - version: - type: string - webhookdefinitions: - type: array - items: - description: WebhookDescription provides details to OLM about required webhooks - type: object - required: - - admissionReviewVersions - - generateName - - sideEffects - - type - properties: - admissionReviewVersions: - type: array - items: - type: string - containerPort: - type: integer - format: int32 - default: 443 - maximum: 65535 - minimum: 1 - conversionCRDs: - type: array - items: - type: string - deploymentName: - type: string - failurePolicy: - description: FailurePolicyType specifies a failure policy that defines how unrecognized errors from the admission endpoint are handled. - type: string - generateName: - type: string - matchPolicy: - description: MatchPolicyType specifies the type of match policy. - type: string - objectSelector: - description: A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - reinvocationPolicy: - description: ReinvocationPolicyType specifies what type of policy the admission hook uses. - type: string - rules: - type: array - items: - description: RuleWithOperations is a tuple of Operations and Resources. It is recommended to make sure that all the tuple expansions are valid. - type: object - properties: - apiGroups: - description: APIGroups is the API groups the resources belong to. '*' is all groups. If '*' is present, the length of the slice must be one. Required. - type: array - items: - type: string - apiVersions: - description: APIVersions is the API versions the resources belong to. '*' is all versions. If '*' is present, the length of the slice must be one. Required. - type: array - items: - type: string - operations: - description: Operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or * for all of those operations and any future admission operations that are added. If '*' is present, the length of the slice must be one. Required. - type: array - items: - description: OperationType specifies an operation for a request. - type: string - resources: - description: "Resources is a list of resources this rule applies to. \n For example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources. \n If wildcard is present, the validation rule will ensure resources do not overlap with each other. \n Depending on the enclosing object, subresources might not be allowed. Required." - type: array - items: - type: string - scope: - description: scope specifies the scope of this rule. Valid values are "Cluster", "Namespaced", and "*" "Cluster" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. "Namespaced" means that only namespaced resources will match this rule. "*" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is "*". - type: string - sideEffects: - description: SideEffectClass specifies the types of side effects a webhook may have. - type: string - targetPort: - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - timeoutSeconds: - type: integer - format: int32 - type: - description: WebhookAdmissionType is the type of admission webhooks supported by OLM - type: string - enum: - - ValidatingAdmissionWebhook - - MutatingAdmissionWebhook - - ConversionWebhook - webhookPath: - type: string - status: - description: ClusterServiceVersionStatus represents information about the status of a CSV. Status may trail the actual state of a system. - type: object - properties: - certsLastUpdated: - description: Last time the owned APIService certs were updated - type: string - format: date-time - certsRotateAt: - description: Time the owned APIService certs will rotate next - type: string - format: date-time - cleanup: - description: CleanupStatus represents information about the status of cleanup while a CSV is pending deletion - type: object - properties: - pendingDeletion: - description: PendingDeletion is the list of custom resource objects that are pending deletion and blocked on finalizers. This indicates the progress of cleanup that is blocking CSV deletion or operator uninstall. - type: array - items: - description: ResourceList represents a list of resources which are of the same Group/Kind - type: object - required: - - group - - instances - - kind - properties: - group: - type: string - instances: - type: array - items: - type: object - required: - - name - properties: - name: - type: string - namespace: - description: Namespace can be empty for cluster-scoped resources - type: string - kind: - type: string - conditions: - description: List of conditions, a history of state transitions - type: array - items: - description: Conditions appear in the status as a record of state transitions on the ClusterServiceVersion - type: object - properties: - lastTransitionTime: - description: Last time the status transitioned from one status to another. - type: string - format: date-time - lastUpdateTime: - description: Last time we updated the status - type: string - format: date-time - message: - description: A human readable message indicating details about why the ClusterServiceVersion is in this condition. - type: string - phase: - description: Condition of the ClusterServiceVersion - type: string - reason: - description: A brief CamelCase message indicating details about why the ClusterServiceVersion is in this state. e.g. 'RequirementsNotMet' - type: string - lastTransitionTime: - description: Last time the status transitioned from one status to another. - type: string - format: date-time - lastUpdateTime: - description: Last time we updated the status - type: string - format: date-time - message: - description: A human readable message indicating details about why the ClusterServiceVersion is in this condition. - type: string - phase: - description: Current condition of the ClusterServiceVersion - type: string - reason: - description: A brief CamelCase message indicating details about why the ClusterServiceVersion is in this state. e.g. 'RequirementsNotMet' - type: string - requirementStatus: - description: The status of each requirement for this CSV - type: array - items: - type: object - required: - - group - - kind - - message - - name - - status - - version - properties: - dependents: - type: array - items: - description: DependentStatus is the status for a dependent requirement (to prevent infinite nesting) - type: object - required: - - group - - kind - - status - - version - properties: - group: - type: string - kind: - type: string - message: - type: string - status: - description: StatusReason is a camelcased reason for the status of a RequirementStatus or DependentStatus - type: string - uuid: - type: string - version: - type: string - group: - type: string - kind: - type: string - message: - type: string - name: - type: string - status: - description: StatusReason is a camelcased reason for the status of a RequirementStatus or DependentStatus - type: string - uuid: - type: string - version: - type: string - served: true - storage: true - subresources: - status: {} - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.8.0 - creationTimestamp: null - name: installplans.operators.coreos.com -spec: - group: operators.coreos.com - names: - categories: - - olm - kind: InstallPlan - listKind: InstallPlanList - plural: installplans - shortNames: - - ip - singular: installplan - scope: Namespaced - versions: - - additionalPrinterColumns: - - description: The first CSV in the list of clusterServiceVersionNames - jsonPath: .spec.clusterServiceVersionNames[0] - name: CSV - type: string - - description: The approval mode - jsonPath: .spec.approval - name: Approval - type: string - - jsonPath: .spec.approved - name: Approved - type: boolean - name: v1alpha1 - schema: - openAPIV3Schema: - description: InstallPlan defines the installation of a set of operators. - type: object - required: - - metadata - - spec - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: InstallPlanSpec defines a set of Application resources to be installed - type: object - required: - - approval - - approved - - clusterServiceVersionNames - properties: - approval: - description: Approval is the user approval policy for an InstallPlan. It must be one of "Automatic" or "Manual". - type: string - approved: - type: boolean - clusterServiceVersionNames: - type: array - items: - type: string - generation: - type: integer - source: - type: string - sourceNamespace: - type: string - status: - description: "InstallPlanStatus represents the information about the status of steps required to complete installation. \n Status may trail the actual state of a system." - type: object - required: - - catalogSources - - phase - properties: - attenuatedServiceAccountRef: - description: AttenuatedServiceAccountRef references the service account that is used to do scoped operator install. - type: object - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' - type: string - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' - type: string - resourceVersion: - description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' - type: string - uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' - type: string - bundleLookups: - description: BundleLookups is the set of in-progress requests to pull and unpackage bundle content to the cluster. - type: array - items: - description: BundleLookup is a request to pull and unpackage the content of a bundle to the cluster. - type: object - required: - - catalogSourceRef - - identifier - - path - - replaces - properties: - catalogSourceRef: - description: CatalogSourceRef is a reference to the CatalogSource the bundle path was resolved from. - type: object - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' - type: string - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' - type: string - resourceVersion: - description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' - type: string - uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' - type: string - conditions: - description: Conditions represents the overall state of a BundleLookup. - type: array - items: - type: object - required: - - status - - type - properties: - lastTransitionTime: - description: Last time the condition transitioned from one status to another. - type: string - format: date-time - lastUpdateTime: - description: Last time the condition was probed. - type: string - format: date-time - message: - description: A human readable message indicating details about the transition. - type: string - reason: - description: The reason for the condition's last transition. - type: string - status: - description: Status of the condition, one of True, False, Unknown. - type: string - type: - description: Type of condition. - type: string - identifier: - description: Identifier is the catalog-unique name of the operator (the name of the CSV for bundles that contain CSVs) - type: string - path: - description: Path refers to the location of a bundle to pull. It's typically an image reference. - type: string - properties: - description: The effective properties of the unpacked bundle. - type: string - replaces: - description: Replaces is the name of the bundle to replace with the one found at Path. - type: string - catalogSources: - type: array - items: - type: string - conditions: - type: array - items: - description: InstallPlanCondition represents the overall status of the execution of an InstallPlan. - type: object - properties: - lastTransitionTime: - type: string - format: date-time - lastUpdateTime: - type: string - format: date-time - message: - type: string - reason: - description: ConditionReason is a camelcased reason for the state transition. - type: string - status: - type: string - type: - description: InstallPlanConditionType describes the state of an InstallPlan at a certain point as a whole. - type: string - message: - description: Message is a human-readable message containing detailed information that may be important to understanding why the plan has its current status. - type: string - phase: - description: InstallPlanPhase is the current status of a InstallPlan as a whole. - type: string - plan: - type: array - items: - description: Step represents the status of an individual step in an InstallPlan. - type: object - required: - - resolving - - resource - - status - properties: - optional: - type: boolean - resolving: - type: string - resource: - description: StepResource represents the status of a resource to be tracked by an InstallPlan. - type: object - required: - - group - - kind - - name - - sourceName - - sourceNamespace - - version - properties: - group: - type: string - kind: - type: string - manifest: - type: string - name: - type: string - sourceName: - type: string - sourceNamespace: - type: string - version: - type: string - status: - description: StepStatus is the current status of a particular resource an in InstallPlan - type: string - startTime: - description: StartTime is the time when the controller began applying the resources listed in the plan to the cluster. - type: string - format: date-time - served: true - storage: true - subresources: - status: {} - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.8.0 - creationTimestamp: null - name: olmconfigs.operators.coreos.com -spec: - group: operators.coreos.com - names: - categories: - - olm - kind: OLMConfig - listKind: OLMConfigList - plural: olmconfigs - singular: olmconfig - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - description: OLMConfig is a resource responsible for configuring OLM. - type: object - required: - - metadata - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: OLMConfigSpec is the spec for an OLMConfig resource. - type: object - properties: - features: - description: Features contains the list of configurable OLM features. - type: object - properties: - disableCopiedCSVs: - description: DisableCopiedCSVs is used to disable OLM's "Copied CSV" feature for operators installed at the cluster scope, where a cluster scoped operator is one that has been installed in an OperatorGroup that targets all namespaces. When reenabled, OLM will recreate the "Copied CSVs" for each cluster scoped operator. - type: boolean - status: - description: OLMConfigStatus is the status for an OLMConfig resource. - type: object - properties: - conditions: - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - served: true - storage: true - subresources: - status: {} - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.8.0 - creationTimestamp: null - name: operatorconditions.operators.coreos.com -spec: - group: operators.coreos.com - names: - categories: - - olm - kind: OperatorCondition - listKind: OperatorConditionList - plural: operatorconditions - shortNames: - - condition - singular: operatorcondition - scope: Namespaced - versions: - - name: v1 - schema: - openAPIV3Schema: - description: OperatorCondition is a Custom Resource of type `OperatorCondition` which is used to convey information to OLM about the state of an operator. - type: object - required: - - metadata - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: OperatorConditionSpec allows a cluster admin to convey information about the state of an operator to OLM, potentially overriding state reported by the operator. - type: object - properties: - deployments: - type: array - items: - type: string - overrides: - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - serviceAccounts: - type: array - items: - type: string - status: - description: OperatorConditionStatus allows an operator to convey information its state to OLM. The status may trail the actual state of a system. - type: object - properties: - conditions: - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - served: true - storage: false - subresources: - status: {} - - name: v2 - schema: - openAPIV3Schema: - description: OperatorCondition is a Custom Resource of type `OperatorCondition` which is used to convey information to OLM about the state of an operator. - type: object - required: - - metadata - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: OperatorConditionSpec allows an operator to report state to OLM and provides cluster admin with the ability to manually override state reported by the operator. - type: object - properties: - conditions: - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - deployments: - type: array - items: - type: string - overrides: - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - serviceAccounts: - type: array - items: - type: string - status: - description: OperatorConditionStatus allows OLM to convey which conditions have been observed. - type: object - properties: - conditions: - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - served: true - storage: true - subresources: - status: {} - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.8.0 - creationTimestamp: null - name: operatorgroups.operators.coreos.com -spec: - group: operators.coreos.com - names: - categories: - - olm - kind: OperatorGroup - listKind: OperatorGroupList - plural: operatorgroups - shortNames: - - og - singular: operatorgroup - scope: Namespaced - versions: - - name: v1 - schema: - openAPIV3Schema: - description: OperatorGroup is the unit of multitenancy for OLM managed operators. It constrains the installation of operators in its namespace to a specified set of target namespaces. - type: object - required: - - metadata - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: OperatorGroupSpec is the spec for an OperatorGroup resource. - type: object - default: - upgradeStrategy: Default - properties: - selector: - description: Selector selects the OperatorGroup's target namespaces. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - serviceAccountName: - description: ServiceAccountName is the admin specified service account which will be used to deploy operator(s) in this operator group. - type: string - staticProvidedAPIs: - description: Static tells OLM not to update the OperatorGroup's providedAPIs annotation - type: boolean - targetNamespaces: - description: TargetNamespaces is an explicit set of namespaces to target. If it is set, Selector is ignored. - type: array - items: - type: string - x-kubernetes-list-type: set - upgradeStrategy: - description: "UpgradeStrategy defines the upgrade strategy for operators in the namespace. There are currently two supported upgrade strategies: \n Default: OLM will only allow clusterServiceVersions to move to the replacing phase from the succeeded phase. This effectively means that OLM will not allow operators to move to the next version if an installation or upgrade has failed. \n TechPreviewUnsafeFailForward: OLM will allow clusterServiceVersions to move to the replacing phase from the succeeded phase or from the failed phase. Additionally, OLM will generate new installPlans when a subscription references a failed installPlan and the catalog has been updated with a new upgrade for the existing set of operators. \n WARNING: The TechPreviewUnsafeFailForward upgrade strategy is unsafe and may result in unexpected behavior or unrecoverable data loss unless you have deep understanding of the set of operators being managed in the namespace." - type: string - default: Default - enum: - - Default - - TechPreviewUnsafeFailForward - status: - description: OperatorGroupStatus is the status for an OperatorGroupResource. - type: object - required: - - lastUpdated - properties: - conditions: - description: Conditions is an array of the OperatorGroup's conditions. - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - lastUpdated: - description: LastUpdated is a timestamp of the last time the OperatorGroup's status was Updated. - type: string - format: date-time - namespaces: - description: Namespaces is the set of target namespaces for the OperatorGroup. - type: array - items: - type: string - x-kubernetes-list-type: set - serviceAccountRef: - description: ServiceAccountRef references the service account object specified. - type: object - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' - type: string - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' - type: string - resourceVersion: - description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' - type: string - uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' - type: string - served: true - storage: true - subresources: - status: {} - - name: v1alpha2 - schema: - openAPIV3Schema: - description: OperatorGroup is the unit of multitenancy for OLM managed operators. It constrains the installation of operators in its namespace to a specified set of target namespaces. - type: object - required: - - metadata - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: OperatorGroupSpec is the spec for an OperatorGroup resource. - type: object - properties: - selector: - description: Selector selects the OperatorGroup's target namespaces. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - serviceAccountName: - description: ServiceAccountName is the admin specified service account which will be used to deploy operator(s) in this operator group. - type: string - staticProvidedAPIs: - description: Static tells OLM not to update the OperatorGroup's providedAPIs annotation - type: boolean - targetNamespaces: - description: TargetNamespaces is an explicit set of namespaces to target. If it is set, Selector is ignored. - type: array - items: - type: string - status: - description: OperatorGroupStatus is the status for an OperatorGroupResource. - type: object - required: - - lastUpdated - properties: - lastUpdated: - description: LastUpdated is a timestamp of the last time the OperatorGroup's status was Updated. - type: string - format: date-time - namespaces: - description: Namespaces is the set of target namespaces for the OperatorGroup. - type: array - items: - type: string - serviceAccountRef: - description: ServiceAccountRef references the service account object specified. - type: object - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' - type: string - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' - type: string - resourceVersion: - description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' - type: string - uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' - type: string - served: true - storage: false - subresources: - status: {} - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.8.0 - creationTimestamp: null - name: operators.operators.coreos.com -spec: - group: operators.coreos.com - names: - categories: - - olm - kind: Operator - listKind: OperatorList - plural: operators - singular: operator - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - description: Operator represents a cluster operator. - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: OperatorSpec defines the desired state of Operator - type: object - status: - description: OperatorStatus defines the observed state of an Operator and its components - type: object - properties: - components: - description: Components describes resources that compose the operator. - type: object - required: - - labelSelector - properties: - labelSelector: - description: LabelSelector is a label query over a set of resources used to select the operator's components - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - refs: - description: Refs are a set of references to the operator's component resources, selected with LabelSelector. - type: array - items: - description: RichReference is a reference to a resource, enriched with its status conditions. - type: object - properties: - apiVersion: - description: API version of the referent. - type: string - conditions: - description: Conditions represents the latest state of the component. - type: array - items: - description: Condition represent the latest available observations of an component's state. - type: object - required: - - status - - type - properties: - lastTransitionTime: - description: Last time the condition transitioned from one status to another. - type: string - format: date-time - lastUpdateTime: - description: Last time the condition was probed - type: string - format: date-time - message: - description: A human readable message indicating details about the transition. - type: string - reason: - description: The reason for the condition's last transition. - type: string - status: - description: Status of the condition, one of True, False, Unknown. - type: string - type: - description: Type of condition. - type: string - fieldPath: - description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' - type: string - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' - type: string - resourceVersion: - description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' - type: string - uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' - type: string - served: true - storage: true - subresources: - status: {} - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.8.0 - creationTimestamp: null - name: subscriptions.operators.coreos.com -spec: - group: operators.coreos.com - names: - categories: - - olm - kind: Subscription - listKind: SubscriptionList - plural: subscriptions - shortNames: - - sub - - subs - singular: subscription - scope: Namespaced - versions: - - additionalPrinterColumns: - - description: The package subscribed to - jsonPath: .spec.name - name: Package - type: string - - description: The catalog source for the specified package - jsonPath: .spec.source - name: Source - type: string - - description: The channel of updates to subscribe to - jsonPath: .spec.channel - name: Channel - type: string - name: v1alpha1 - schema: - openAPIV3Schema: - description: Subscription keeps operators up to date by tracking changes to Catalogs. - type: object - required: - - metadata - - spec - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: SubscriptionSpec defines an Application that can be installed - type: object - required: - - name - - source - - sourceNamespace - properties: - channel: - type: string - config: - description: SubscriptionConfig contains configuration specified for a subscription. - type: object - properties: - affinity: - description: If specified, overrides the pod's scheduling constraints. nil sub-attributes will *not* override the original values in the pod.spec for those sub-attributes. Use empty object ({}) to erase original sub-attribute values. - type: object - properties: - nodeAffinity: - description: Describes node affinity scheduling rules for the pod. - type: object - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred. - type: array - items: - description: An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). - type: object - required: - - preference - - weight - properties: - preference: - description: A node selector term, associated with the corresponding weight. - type: object - properties: - matchExpressions: - description: A list of node selector requirements by node's labels. - type: array - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchFields: - description: A list of node selector requirements by node's fields. - type: array - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - type: array - items: - type: string - weight: - description: Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. - type: integer - format: int32 - requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node. - type: object - required: - - nodeSelectorTerms - properties: - nodeSelectorTerms: - description: Required. A list of node selector terms. The terms are ORed. - type: array - items: - description: A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. - type: object - properties: - matchExpressions: - description: A list of node selector requirements by node's labels. - type: array - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchFields: - description: A list of node selector requirements by node's fields. - type: array - items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: The label key that the selector applies to. - type: string - operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. - type: array - items: - type: string - podAffinity: - description: Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)). - type: object - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. - type: array - items: - description: The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) - type: object - required: - - podAffinityTerm - - weight - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated with the corresponding weight. - type: object - required: - - topologyKey - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". - type: array - items: - type: string - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - weight: - description: weight associated with matching the corresponding podAffinityTerm, in the range 1-100. - type: integer - format: int32 - requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. - type: array - items: - description: Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running - type: object - required: - - topologyKey - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". - type: array - items: - type: string - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - podAntiAffinity: - description: Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)). - type: object - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. - type: array - items: - description: The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) - type: object - required: - - podAffinityTerm - - weight - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated with the corresponding weight. - type: object - required: - - topologyKey - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". - type: array - items: - type: string - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - weight: - description: weight associated with matching the corresponding podAffinityTerm, in the range 1-100. - type: integer - format: int32 - requiredDuringSchedulingIgnoredDuringExecution: - description: If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. - type: array - items: - description: Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running - type: object - required: - - topologyKey - properties: - labelSelector: - description: A label query over a set of resources, in this case pods. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". - type: array - items: - type: string - topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. - type: string - env: - description: Env is a list of environment variables to set in the container. Cannot be updated. - type: array - items: - description: EnvVar represents an environment variable present in a Container. - type: object - required: - - name - properties: - name: - description: Name of the environment variable. Must be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. Cannot be used if value is not empty. - type: object - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - type: object - required: - - key - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or its key must be defined - type: boolean - fieldRef: - description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' - type: object - required: - - fieldPath - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.' - type: object - required: - - resource - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - secretKeyRef: - description: Selects a key of a secret in the pod's namespace - type: object - required: - - key - properties: - key: - description: The key of the secret to select from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret or its key must be defined - type: boolean - envFrom: - description: EnvFrom is a list of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Immutable. - type: array - items: - description: EnvFromSource represents the source of a set of ConfigMaps - type: object - properties: - configMapRef: - description: The ConfigMap to select from - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap must be defined - type: boolean - prefix: - description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. - type: string - secretRef: - description: The Secret to select from - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret must be defined - type: boolean - nodeSelector: - description: 'NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node''s labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' - type: object - additionalProperties: - type: string - resources: - description: 'Resources represents compute resources required by this container. Immutable. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - properties: - limits: - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - additionalProperties: - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - requests: - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - additionalProperties: - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - selector: - description: Selector is the label selector for pods to be configured. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. It must match the pod template's labels. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - tolerations: - description: Tolerations are the pod's tolerations. - type: array - items: - description: The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . - type: object - properties: - effect: - description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. - type: string - operator: - description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. - type: string - tolerationSeconds: - description: TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. - type: integer - format: int64 - value: - description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. - type: string - volumeMounts: - description: List of VolumeMounts to set in the container. - type: array - items: - description: VolumeMount describes a mounting of a Volume within a container. - type: object - required: - - mountPath - - name - properties: - mountPath: - description: Path within the container at which the volume should be mounted. Must not contain ':'. - type: string - mountPropagation: - description: mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. - type: string - name: - description: This must match the Name of a Volume. - type: string - readOnly: - description: Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. - type: boolean - subPath: - description: Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). - type: string - subPathExpr: - description: Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to "" (volume's root). SubPathExpr and SubPath are mutually exclusive. - type: string - volumes: - description: List of Volumes to set in the podSpec. - type: array - items: - description: Volume represents a named volume in a pod that may be accessed by any container in the pod. - type: object - required: - - name - properties: - awsElasticBlockStore: - description: 'awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' - type: object - required: - - volumeID - properties: - fsType: - description: 'fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - partition: - description: 'partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).' - type: integer - format: int32 - readOnly: - description: 'readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' - type: boolean - volumeID: - description: 'volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' - type: string - azureDisk: - description: azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. - type: object - required: - - diskName - - diskURI - properties: - cachingMode: - description: 'cachingMode is the Host Caching mode: None, Read Only, Read Write.' - type: string - diskName: - description: diskName is the Name of the data disk in the blob storage - type: string - diskURI: - description: diskURI is the URI of data disk in the blob storage - type: string - fsType: - description: fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - type: string - kind: - description: 'kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared' - type: string - readOnly: - description: readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - azureFile: - description: azureFile represents an Azure File Service mount on the host and bind mount to the pod. - type: object - required: - - secretName - - shareName - properties: - readOnly: - description: readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - secretName: - description: secretName is the name of secret that contains Azure Storage Account Name and Key - type: string - shareName: - description: shareName is the azure share Name - type: string - cephfs: - description: cephFS represents a Ceph FS mount on the host that shares a pod's lifetime - type: object - required: - - monitors - properties: - monitors: - description: 'monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - type: array - items: - type: string - path: - description: 'path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /' - type: string - readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - type: boolean - secretFile: - description: 'secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - type: string - secretRef: - description: 'secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - user: - description: 'user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' - type: string - cinder: - description: 'cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' - type: object - required: - - volumeID - properties: - fsType: - description: 'fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' - type: string - readOnly: - description: 'readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' - type: boolean - secretRef: - description: 'secretRef is optional: points to a secret object containing parameters used to connect to OpenStack.' - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - volumeID: - description: 'volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' - type: string - configMap: - description: configMap represents a configMap that should populate this volume - type: object - properties: - defaultMode: - description: 'defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - items: - description: items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - type: array - items: - description: Maps a string key to a path within a volume. - type: object - required: - - key - - path - properties: - key: - description: key is the key to project. - type: string - mode: - description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - path: - description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: optional specify whether the ConfigMap or its keys must be defined - type: boolean - csi: - description: csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). - type: object - required: - - driver - properties: - driver: - description: driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster. - type: string - fsType: - description: fsType to mount. Ex. "ext4", "xfs", "ntfs". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply. - type: string - nodePublishSecretRef: - description: nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed. - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - readOnly: - description: readOnly specifies a read-only configuration for the volume. Defaults to false (read/write). - type: boolean - volumeAttributes: - description: volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values. - type: object - additionalProperties: - type: string - downwardAPI: - description: downwardAPI represents downward API about the pod that should populate this volume - type: object - properties: - defaultMode: - description: 'Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - items: - description: Items is a list of downward API volume file - type: array - items: - description: DownwardAPIVolumeFile represents information to create the file containing the pod field - type: object - required: - - path - properties: - fieldRef: - description: 'Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.' - type: object - required: - - fieldPath - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - mode: - description: 'Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - path: - description: 'Required: Path is the relative path name of the file to be created. Must not be absolute or contain the ''..'' path. Must be utf-8 encoded. The first item of the relative path must not start with ''..''' - type: string - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.' - type: object - required: - - resource - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - emptyDir: - description: 'emptyDir represents a temporary directory that shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' - type: object - properties: - medium: - description: 'medium represents what type of storage medium should back this directory. The default is "" which means to use the node''s default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' - type: string - sizeLimit: - description: 'sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - ephemeral: - description: "ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed. \n Use this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity tracking are needed, c) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through a PersistentVolumeClaim (see EphemeralVolumeSource for more information on the connection between this volume type and PersistentVolumeClaim). \n Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod. \n Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information. \n A pod can use both types of ephemeral volumes and persistent volumes at the same time." - type: object - properties: - volumeClaimTemplate: - description: "Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long). \n An existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster. \n This field is read-only and no changes will be made by Kubernetes to the PVC after it has been created. \n Required, must not be nil." - type: object - required: - - spec - properties: - metadata: - description: May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation. - type: object - spec: - description: The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here. - type: object - properties: - accessModes: - description: 'accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' - type: array - items: - type: string - dataSource: - description: 'dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field.' - type: object - required: - - kind - - name - properties: - apiGroup: - description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - dataSourceRef: - description: 'dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While DataSource ignores disallowed values (dropping them), DataSourceRef preserves all values, and generates an error if a disallowed value is specified. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled.' - type: object - required: - - kind - - name - properties: - apiGroup: - description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - resources: - description: 'resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' - type: object - properties: - limits: - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - additionalProperties: - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - requests: - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - additionalProperties: - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - selector: - description: selector is a label query over volumes to consider for binding. - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - storageClassName: - description: 'storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' - type: string - volumeMode: - description: volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. - type: string - volumeName: - description: volumeName is the binding reference to the PersistentVolume backing this claim. - type: string - fc: - description: fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. - type: object - properties: - fsType: - description: 'fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - lun: - description: 'lun is Optional: FC target lun number' - type: integer - format: int32 - readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.' - type: boolean - targetWWNs: - description: 'targetWWNs is Optional: FC target worldwide names (WWNs)' - type: array - items: - type: string - wwids: - description: 'wwids Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.' - type: array - items: - type: string - flexVolume: - description: flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. - type: object - required: - - driver - properties: - driver: - description: driver is the name of the driver to use for this volume. - type: string - fsType: - description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. - type: string - options: - description: 'options is Optional: this field holds extra command options if any.' - type: object - additionalProperties: - type: string - readOnly: - description: 'readOnly is Optional: defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.' - type: boolean - secretRef: - description: 'secretRef is Optional: secretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.' - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - flocker: - description: flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running - type: object - properties: - datasetName: - description: datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated - type: string - datasetUUID: - description: datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset - type: string - gcePersistentDisk: - description: 'gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' - type: object - required: - - pdName - properties: - fsType: - description: 'fsType is filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - partition: - description: 'partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' - type: integer - format: int32 - pdName: - description: 'pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' - type: string - readOnly: - description: 'readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' - type: boolean - gitRepo: - description: 'gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod''s container.' - type: object - required: - - repository - properties: - directory: - description: directory is the target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. - type: string - repository: - description: repository is the URL - type: string - revision: - description: revision is the commit hash for the specified revision. - type: string - glusterfs: - description: 'glusterfs represents a Glusterfs mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' - type: object - required: - - endpoints - - path - properties: - endpoints: - description: 'endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' - type: string - path: - description: 'path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' - type: string - readOnly: - description: 'readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' - type: boolean - hostPath: - description: 'hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath --- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not mount host directories as read/write.' - type: object - required: - - path - properties: - path: - description: 'path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' - type: string - type: - description: 'type for HostPath Volume Defaults to "" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' - type: string - iscsi: - description: 'iscsi represents an ISCSI Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' - type: object - required: - - iqn - - lun - - targetPortal - properties: - chapAuthDiscovery: - description: chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication - type: boolean - chapAuthSession: - description: chapAuthSession defines whether support iSCSI Session CHAP authentication - type: boolean - fsType: - description: 'fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - initiatorName: - description: initiatorName is the custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface : will be created for the connection. - type: string - iqn: - description: iqn is the target iSCSI Qualified Name. - type: string - iscsiInterface: - description: iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). - type: string - lun: - description: lun represents iSCSI Target Lun number. - type: integer - format: int32 - portals: - description: portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260). - type: array - items: - type: string - readOnly: - description: readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. - type: boolean - secretRef: - description: secretRef is the CHAP Secret for iSCSI target and initiator authentication - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - targetPortal: - description: targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260). - type: string - name: - description: 'name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - nfs: - description: 'nfs represents an NFS mount on the host that shares a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' - type: object - required: - - path - - server - properties: - path: - description: 'path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' - type: string - readOnly: - description: 'readOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' - type: boolean - server: - description: 'server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' - type: string - persistentVolumeClaim: - description: 'persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' - type: object - required: - - claimName - properties: - claimName: - description: 'claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' - type: string - readOnly: - description: readOnly Will force the ReadOnly setting in VolumeMounts. Default false. - type: boolean - photonPersistentDisk: - description: photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine - type: object - required: - - pdID - properties: - fsType: - description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - type: string - pdID: - description: pdID is the ID that identifies Photon Controller persistent disk - type: string - portworxVolume: - description: portworxVolume represents a portworx volume attached and mounted on kubelets host machine - type: object - required: - - volumeID - properties: - fsType: - description: fSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. - type: string - readOnly: - description: readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - volumeID: - description: volumeID uniquely identifies a Portworx volume - type: string - projected: - description: projected items for all in one resources secrets, configmaps, and downward API - type: object - properties: - defaultMode: - description: defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. - type: integer - format: int32 - sources: - description: sources is the list of volume projections - type: array - items: - description: Projection that may be projected along with other supported volume types - type: object - properties: - configMap: - description: configMap information about the configMap data to project - type: object - properties: - items: - description: items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - type: array - items: - description: Maps a string key to a path within a volume. - type: object - required: - - key - - path - properties: - key: - description: key is the key to project. - type: string - mode: - description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - path: - description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: optional specify whether the ConfigMap or its keys must be defined - type: boolean - downwardAPI: - description: downwardAPI information about the downwardAPI data to project - type: object - properties: - items: - description: Items is a list of DownwardAPIVolume file - type: array - items: - description: DownwardAPIVolumeFile represents information to create the file containing the pod field - type: object - required: - - path - properties: - fieldRef: - description: 'Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.' - type: object - required: - - fieldPath - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - mode: - description: 'Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - path: - description: 'Required: Path is the relative path name of the file to be created. Must not be absolute or contain the ''..'' path. Must be utf-8 encoded. The first item of the relative path must not start with ''..''' - type: string - resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.' - type: object - required: - - resource - properties: - containerName: - description: 'Container name: required for volumes, optional for env vars' - type: string - divisor: - description: Specifies the output format of the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - secret: - description: secret information about the secret data to project - type: object - properties: - items: - description: items if unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - type: array - items: - description: Maps a string key to a path within a volume. - type: object - required: - - key - - path - properties: - key: - description: key is the key to project. - type: string - mode: - description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - path: - description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: optional field specify whether the Secret or its key must be defined - type: boolean - serviceAccountToken: - description: serviceAccountToken is information about the serviceAccountToken data to project - type: object - required: - - path - properties: - audience: - description: audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver. - type: string - expirationSeconds: - description: expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes. - type: integer - format: int64 - path: - description: path is the path relative to the mount point of the file to project the token into. - type: string - quobyte: - description: quobyte represents a Quobyte mount on the host that shares a pod's lifetime - type: object - required: - - registry - - volume - properties: - group: - description: group to map volume access to Default is no group - type: string - readOnly: - description: readOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false. - type: boolean - registry: - description: registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes - type: string - tenant: - description: tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin - type: string - user: - description: user to map volume access to Defaults to serivceaccount user - type: string - volume: - description: volume is a string that references an already created Quobyte volume by name. - type: string - rbd: - description: 'rbd represents a Rados Block Device mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' - type: object - required: - - image - - monitors - properties: - fsType: - description: 'fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd TODO: how do we prevent errors in the filesystem from compromising the machine' - type: string - image: - description: 'image is the rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: string - keyring: - description: 'keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: string - monitors: - description: 'monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: array - items: - type: string - pool: - description: 'pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: string - readOnly: - description: 'readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: boolean - secretRef: - description: 'secretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - user: - description: 'user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' - type: string - scaleIO: - description: scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. - type: object - required: - - gateway - - secretRef - - system - properties: - fsType: - description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Default is "xfs". - type: string - gateway: - description: gateway is the host address of the ScaleIO API Gateway. - type: string - protectionDomain: - description: protectionDomain is the name of the ScaleIO Protection Domain for the configured storage. - type: string - readOnly: - description: readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - secretRef: - description: secretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail. - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - sslEnabled: - description: sslEnabled Flag enable/disable SSL communication with Gateway, default false - type: boolean - storageMode: - description: storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. - type: string - storagePool: - description: storagePool is the ScaleIO Storage Pool associated with the protection domain. - type: string - system: - description: system is the name of the storage system as configured in ScaleIO. - type: string - volumeName: - description: volumeName is the name of a volume already created in the ScaleIO system that is associated with this volume source. - type: string - secret: - description: 'secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' - type: object - properties: - defaultMode: - description: 'defaultMode is Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - items: - description: items If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. - type: array - items: - description: Maps a string key to a path within a volume. - type: object - required: - - key - - path - properties: - key: - description: key is the key to project. - type: string - mode: - description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' - type: integer - format: int32 - path: - description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. - type: string - optional: - description: optional field specify whether the Secret or its keys must be defined - type: boolean - secretName: - description: 'secretName is the name of the secret in the pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' - type: string - storageos: - description: storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. - type: object - properties: - fsType: - description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - type: string - readOnly: - description: readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. - type: boolean - secretRef: - description: secretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted. - type: object - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - volumeName: - description: volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace. - type: string - volumeNamespace: - description: volumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to "default" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created. - type: string - vsphereVolume: - description: vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine - type: object - required: - - volumePath - properties: - fsType: - description: fsType is filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - type: string - storagePolicyID: - description: storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName. - type: string - storagePolicyName: - description: storagePolicyName is the storage Policy Based Management (SPBM) profile name. - type: string - volumePath: - description: volumePath is the path that identifies vSphere volume vmdk - type: string - installPlanApproval: - description: Approval is the user approval policy for an InstallPlan. It must be one of "Automatic" or "Manual". - type: string - name: - type: string - source: - type: string - sourceNamespace: - type: string - startingCSV: - type: string - status: - type: object - required: - - lastUpdated - properties: - catalogHealth: - description: CatalogHealth contains the Subscription's view of its relevant CatalogSources' status. It is used to determine SubscriptionStatusConditions related to CatalogSources. - type: array - items: - description: SubscriptionCatalogHealth describes the health of a CatalogSource the Subscription knows about. - type: object - required: - - catalogSourceRef - - healthy - - lastUpdated - properties: - catalogSourceRef: - description: CatalogSourceRef is a reference to a CatalogSource. - type: object - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' - type: string - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' - type: string - resourceVersion: - description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' - type: string - uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' - type: string - healthy: - description: Healthy is true if the CatalogSource is healthy; false otherwise. - type: boolean - lastUpdated: - description: LastUpdated represents the last time that the CatalogSourceHealth changed - type: string - format: date-time - conditions: - description: Conditions is a list of the latest available observations about a Subscription's current state. - type: array - items: - description: SubscriptionCondition represents the latest available observations of a Subscription's state. - type: object - required: - - status - - type - properties: - lastHeartbeatTime: - description: LastHeartbeatTime is the last time we got an update on a given condition - type: string - format: date-time - lastTransitionTime: - description: LastTransitionTime is the last time the condition transit from one status to another - type: string - format: date-time - message: - description: Message is a human-readable message indicating details about last transition. - type: string - reason: - description: Reason is a one-word CamelCase reason for the condition's last transition. - type: string - status: - description: Status is the status of the condition, one of True, False, Unknown. - type: string - type: - description: Type is the type of Subscription condition. - type: string - currentCSV: - description: CurrentCSV is the CSV the Subscription is progressing to. - type: string - installPlanGeneration: - description: InstallPlanGeneration is the current generation of the installplan - type: integer - installPlanRef: - description: InstallPlanRef is a reference to the latest InstallPlan that contains the Subscription's current CSV. - type: object - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' - type: string - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' - type: string - resourceVersion: - description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' - type: string - uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' - type: string - installedCSV: - description: InstalledCSV is the CSV currently installed by the Subscription. - type: string - installplan: - description: 'Install is a reference to the latest InstallPlan generated for the Subscription. DEPRECATED: InstallPlanRef' - type: object - required: - - apiVersion - - kind - - name - - uuid - properties: - apiVersion: - type: string - kind: - type: string - name: - type: string - uuid: - description: UID is a type that holds unique ID values, including UUIDs. Because we don't ONLY use UUIDs, this is an alias to string. Being a type captures intent and helps make sure that UIDs and names do not get conflated. - type: string - lastUpdated: - description: LastUpdated represents the last time that the Subscription status was updated. - type: string - format: date-time - reason: - description: Reason is the reason the Subscription was transitioned to its current state. - type: string - state: - description: State represents the current state of the Subscription - type: string - served: true - storage: true - subresources: - status: {} - diff --git a/managed/data/crds/olm/olm.yaml b/managed/data/crds/olm/olm.yaml deleted file mode 100644 index 4d53754d45..0000000000 --- a/managed/data/crds/olm/olm.yaml +++ /dev/null @@ -1,380 +0,0 @@ ---- -apiVersion: v1 -kind: Namespace -metadata: - name: olm - labels: - pod-security.kubernetes.io/enforce: restricted - pod-security.kubernetes.io/enforce-version: latest ---- -apiVersion: v1 -kind: Namespace -metadata: - name: operators - labels: - pod-security.kubernetes.io/enforce: baseline - pod-security.kubernetes.io/enforce-version: latest ---- -kind: ServiceAccount -apiVersion: v1 -metadata: - name: olm-operator-serviceaccount - namespace: olm ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: system:controller:operator-lifecycle-manager -rules: -- apiGroups: ["*"] - resources: ["*"] - verbs: ["*"] -- nonResourceURLs: ["*"] - verbs: ["*"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: olm-operator-binding-olm -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: system:controller:operator-lifecycle-manager -subjects: -- kind: ServiceAccount - name: olm-operator-serviceaccount - namespace: olm ---- -apiVersion: operators.coreos.com/v1 -kind: OLMConfig -metadata: - name: cluster ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: olm-operator - namespace: olm - labels: - app: olm-operator -spec: - strategy: - type: RollingUpdate - replicas: 1 - selector: - matchLabels: - app: olm-operator - template: - metadata: - labels: - app: olm-operator - spec: - securityContext: - runAsNonRoot: true - seccompProfile: - type: RuntimeDefault - serviceAccountName: olm-operator-serviceaccount - containers: - - name: olm-operator - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: [ "ALL" ] - command: - - /bin/olm - args: - - --namespace - - $(OPERATOR_NAMESPACE) - - --writeStatusName - - "" - image: quay.io/operator-framework/olm@sha256:2b4fee73c05069d9d2c537c7d3072241097914748abfb938b5b08c969b2f544b - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 - name: metrics - livenessProbe: - httpGet: - path: /healthz - port: 8080 - scheme: HTTP - readinessProbe: - httpGet: - path: /healthz - port: 8080 - scheme: HTTP - terminationMessagePolicy: FallbackToLogsOnError - env: - - name: OPERATOR_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: OPERATOR_NAME - value: olm-operator - resources: - requests: - cpu: 10m - memory: 160Mi - nodeSelector: - kubernetes.io/os: linux ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: catalog-operator - namespace: olm - labels: - app: catalog-operator -spec: - strategy: - type: RollingUpdate - replicas: 1 - selector: - matchLabels: - app: catalog-operator - template: - metadata: - labels: - app: catalog-operator - spec: - securityContext: - runAsNonRoot: true - seccompProfile: - type: RuntimeDefault - serviceAccountName: olm-operator-serviceaccount - containers: - - name: catalog-operator - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: [ "ALL" ] - command: - - /bin/catalog - args: - - '--namespace' - - olm - - --configmapServerImage=quay.io/operator-framework/configmap-operator-registry:latest - - --util-image - - quay.io/operator-framework/olm@sha256:2b4fee73c05069d9d2c537c7d3072241097914748abfb938b5b08c969b2f544b - - --set-workload-user-id=true - image: quay.io/operator-framework/olm@sha256:2b4fee73c05069d9d2c537c7d3072241097914748abfb938b5b08c969b2f544b - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 - name: metrics - livenessProbe: - httpGet: - path: /healthz - port: 8080 - scheme: HTTP - readinessProbe: - httpGet: - path: /healthz - port: 8080 - scheme: HTTP - terminationMessagePolicy: FallbackToLogsOnError - resources: - requests: - cpu: 10m - memory: 80Mi - nodeSelector: - kubernetes.io/os: linux ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: aggregate-olm-edit - labels: - rbac.authorization.k8s.io/aggregate-to-admin: "true" - rbac.authorization.k8s.io/aggregate-to-edit: "true" -rules: -- apiGroups: ["operators.coreos.com"] - resources: ["subscriptions"] - verbs: ["create", "update", "patch", "delete"] -- apiGroups: ["operators.coreos.com"] - resources: ["clusterserviceversions", "catalogsources", "installplans", "subscriptions"] - verbs: ["delete"] ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: aggregate-olm-view - labels: - rbac.authorization.k8s.io/aggregate-to-admin: "true" - rbac.authorization.k8s.io/aggregate-to-edit: "true" - rbac.authorization.k8s.io/aggregate-to-view: "true" -rules: -- apiGroups: ["operators.coreos.com"] - resources: ["clusterserviceversions", "catalogsources", "installplans", "subscriptions", "operatorgroups"] - verbs: ["get", "list", "watch"] -- apiGroups: ["packages.operators.coreos.com"] - resources: ["packagemanifests", "packagemanifests/icon"] - verbs: ["get", "list", "watch"] ---- -apiVersion: operators.coreos.com/v1 -kind: OperatorGroup -metadata: - name: global-operators - namespace: operators ---- -apiVersion: operators.coreos.com/v1 -kind: OperatorGroup -metadata: - name: olm-operators - namespace: olm -spec: - targetNamespaces: - - olm ---- -apiVersion: operators.coreos.com/v1alpha1 -kind: ClusterServiceVersion -metadata: - name: packageserver - namespace: olm - labels: - olm.version: v0.22.0 -spec: - displayName: Package Server - description: Represents an Operator package that is available from a given CatalogSource which will resolve to a ClusterServiceVersion. - minKubeVersion: 1.11.0 - keywords: ['packagemanifests', 'olm', 'packages'] - maintainers: - - name: Red Hat - email: openshift-operators@redhat.com - provider: - name: Red Hat - links: - - name: Package Server - url: https://github.com/operator-framework/operator-lifecycle-manager/tree/master/pkg/package-server - installModes: - - type: OwnNamespace - supported: true - - type: SingleNamespace - supported: true - - type: MultiNamespace - supported: true - - type: AllNamespaces - supported: true - install: - strategy: deployment - spec: - clusterPermissions: - - serviceAccountName: olm-operator-serviceaccount - rules: - - apiGroups: - - authorization.k8s.io - resources: - - subjectaccessreviews - verbs: - - create - - get - - apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - - apiGroups: - - "operators.coreos.com" - resources: - - catalogsources - verbs: - - get - - list - - watch - - apiGroups: - - "packages.operators.coreos.com" - resources: - - packagemanifests - verbs: - - get - - list - deployments: - - name: packageserver - spec: - strategy: - type: RollingUpdate - rollingUpdate: - maxUnavailable: 1 - maxSurge: 1 - replicas: 2 - selector: - matchLabels: - app: packageserver - template: - metadata: - labels: - app: packageserver - spec: - securityContext: - runAsNonRoot: true - seccompProfile: - type: RuntimeDefault - serviceAccountName: olm-operator-serviceaccount - nodeSelector: - kubernetes.io/os: linux - containers: - - name: packageserver - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: [ "ALL" ] - command: - - /bin/package-server - - -v=4 - - --secure-port - - "5443" - - --global-namespace - - olm - image: quay.io/operator-framework/olm@sha256:2b4fee73c05069d9d2c537c7d3072241097914748abfb938b5b08c969b2f544b - imagePullPolicy: Always - ports: - - containerPort: 5443 - livenessProbe: - httpGet: - scheme: HTTPS - path: /healthz - port: 5443 - readinessProbe: - httpGet: - scheme: HTTPS - path: /healthz - port: 5443 - terminationMessagePolicy: FallbackToLogsOnError - resources: - requests: - cpu: 10m - memory: 50Mi - volumeMounts: - - name: tmpfs - mountPath: /tmp - volumes: - - name: tmpfs - emptyDir: {} - maturity: alpha - version: v0.22.0 - apiservicedefinitions: - owned: - - group: packages.operators.coreos.com - version: v1 - kind: PackageManifest - name: packagemanifests - displayName: PackageManifest - description: A PackageManifest is a resource generated from existing CatalogSources and their ConfigMaps - deploymentName: packageserver - containerPort: 5443 ---- -apiVersion: operators.coreos.com/v1alpha1 -kind: CatalogSource -metadata: - name: operatorhubio-catalog - namespace: olm -spec: - sourceType: grpc - image: quay.io/operatorhubio/catalog:latest - displayName: Community Operators - publisher: OperatorHub.io - updateStrategy: - registryPoll: - interval: 60m diff --git a/managed/data/crds/olm/percona-dbaas-catalog.yaml b/managed/data/crds/olm/percona-dbaas-catalog.yaml deleted file mode 100644 index cf00d4e57f..0000000000 --- a/managed/data/crds/olm/percona-dbaas-catalog.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: operators.coreos.com/v1alpha1 -kind: CatalogSource -metadata: - name: percona-dbaas-catalog - namespace: olm -spec: - displayName: Percona DBaaS Catalog - publisher: Percona - sourceType: grpc - image: docker.io/percona/dbaas-catalog:latest - updateStrategy: - registryPoll: - interval: 45m diff --git a/managed/data/crds/victoriametrics/crs/vmagent_rbac.yaml b/managed/data/crds/victoriametrics/crs/vmagent_rbac.yaml deleted file mode 100644 index 153f1442d3..0000000000 --- a/managed/data/crds/victoriametrics/crs/vmagent_rbac.yaml +++ /dev/null @@ -1,51 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: vmagent - namespace: monitoring-system ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: vmagent -rules: - - apiGroups: ["","networking.k8s.io","extensions"] - resources: - - nodes - - nodes/metrics - - services - - endpoints - - endpointslices - - pods - - app - - ingresses - verbs: ["get", "list", "watch"] - - apiGroups: [""] - resources: - - namespaces - - configmaps - verbs: ["get"] - - nonResourceURLs: ["/metrics","/metrics/resources"] - verbs: ["get"] - - apiGroups: - - route.openshift.io - - image.openshift.io - resources: - - routers/metrics - - registry/metrics - verbs: - - get ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: vmagent -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: vmagent -subjects: - - kind: ServiceAccount - name: vmagent - namespace: monitoring-system ---- diff --git a/managed/data/crds/victoriametrics/crs/vmnodescrape.yaml b/managed/data/crds/victoriametrics/crs/vmnodescrape.yaml deleted file mode 100644 index 44b35909f2..0000000000 --- a/managed/data/crds/victoriametrics/crs/vmnodescrape.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: operator.victoriametrics.com/v1beta1 -kind: VMNodeScrape -metadata: - name: pmm-vm-cadvisor-metrics -spec: - scheme: "https" - interval: "10s" - honorLabels: true - scrapeTimeout: "2s" - selector: {} - tlsConfig: - insecureSkipVerify: true - caFile: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" - bearerTokenFile: "/var/run/secrets/kubernetes.io/serviceaccount/token" - relabelConfigs: - - action: labelmap - regex: __meta_kubernetes_node_label_(.+) - - targetLabel: __address__ - replacement: kubernetes.default.svc:443 - - sourceLabels: [__meta_kubernetes_node_name] - regex: (.+) - targetLabel: __metrics_path__ - replacement: /api/v1/nodes/$1/proxy/metrics/cadvisor - metricRelabelConfigs: - - source_labels: - - namespace - - pod - target_label: node_name - regex: (.+);(.+) - replacement: $1-$2 diff --git a/managed/data/crds/victoriametrics/crs/vmpodscrape.yaml b/managed/data/crds/victoriametrics/crs/vmpodscrape.yaml deleted file mode 100644 index 64b0799495..0000000000 --- a/managed/data/crds/victoriametrics/crs/vmpodscrape.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: operator.victoriametrics.com/v1beta1 -kind: VMPodScrape -metadata: - name: pmm-vm-pod-scrape -spec: - podMetricsEndpoints: - - port: metrics - scheme: http - selector: - matchLabels: - monitored-by: vm-operator diff --git a/managed/data/crds/victoriametrics/kube-state-metrics/cluster-role-binding.yaml b/managed/data/crds/victoriametrics/kube-state-metrics/cluster-role-binding.yaml deleted file mode 100644 index d0ca0ba5eb..0000000000 --- a/managed/data/crds/victoriametrics/kube-state-metrics/cluster-role-binding.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - labels: - app.kubernetes.io/component: exporter - app.kubernetes.io/name: kube-state-metrics - app.kubernetes.io/version: 2.5.0 - name: kube-state-metrics -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: kube-state-metrics -subjects: -- kind: ServiceAccount - name: kube-state-metrics - namespace: default diff --git a/managed/data/crds/victoriametrics/kube-state-metrics/cluster-role.yaml b/managed/data/crds/victoriametrics/kube-state-metrics/cluster-role.yaml deleted file mode 100644 index 7992529ac7..0000000000 --- a/managed/data/crds/victoriametrics/kube-state-metrics/cluster-role.yaml +++ /dev/null @@ -1,109 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - labels: - app.kubernetes.io/component: exporter - app.kubernetes.io/name: kube-state-metrics - app.kubernetes.io/version: 2.5.0 - name: kube-state-metrics -rules: -- apiGroups: - - "" - resources: - - configmaps - - secrets - - nodes - - pods - - services - - resourcequotas - - replicationcontrollers - - limitranges - - persistentvolumeclaims - - persistentvolumes - - namespaces - - endpoints - verbs: - - list - - watch -- apiGroups: - - apps - resources: - - statefulsets - - daemonsets - - deployments - - replicasets - verbs: - - list - - watch -- apiGroups: - - batch - resources: - - cronjobs - - jobs - verbs: - - list - - watch -- apiGroups: - - autoscaling - resources: - - horizontalpodautoscalers - verbs: - - list - - watch -- apiGroups: - - authentication.k8s.io - resources: - - tokenreviews - verbs: - - create -- apiGroups: - - authorization.k8s.io - resources: - - subjectaccessreviews - verbs: - - create -- apiGroups: - - policy - resources: - - poddisruptionbudgets - verbs: - - list - - watch -- apiGroups: - - certificates.k8s.io - resources: - - certificatesigningrequests - verbs: - - list - - watch -- apiGroups: - - storage.k8s.io - resources: - - storageclasses - - volumeattachments - verbs: - - list - - watch -- apiGroups: - - admissionregistration.k8s.io - resources: - - mutatingwebhookconfigurations - - validatingwebhookconfigurations - verbs: - - list - - watch -- apiGroups: - - networking.k8s.io - resources: - - networkpolicies - - ingresses - verbs: - - list - - watch -- apiGroups: - - coordination.k8s.io - resources: - - leases - verbs: - - list - - watch diff --git a/managed/data/crds/victoriametrics/kube-state-metrics/deployment.yaml b/managed/data/crds/victoriametrics/kube-state-metrics/deployment.yaml deleted file mode 100644 index 6baaf7afeb..0000000000 --- a/managed/data/crds/victoriametrics/kube-state-metrics/deployment.yaml +++ /dev/null @@ -1,52 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app.kubernetes.io/component: exporter - app.kubernetes.io/name: kube-state-metrics - app.kubernetes.io/version: 2.5.0 - name: kube-state-metrics - namespace: default -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: kube-state-metrics - template: - metadata: - labels: - app.kubernetes.io/component: exporter - app.kubernetes.io/name: kube-state-metrics - app.kubernetes.io/version: 2.5.0 - spec: - automountServiceAccountToken: true - containers: - - image: k8s.gcr.io/kube-state-metrics/kube-state-metrics:v2.5.0 - livenessProbe: - httpGet: - path: /healthz - port: 8080 - initialDelaySeconds: 5 - timeoutSeconds: 5 - name: kube-state-metrics - ports: - - containerPort: 8080 - name: http-metrics - - containerPort: 8081 - name: telemetry - readinessProbe: - httpGet: - path: / - port: 8081 - initialDelaySeconds: 5 - timeoutSeconds: 5 - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - readOnlyRootFilesystem: true - runAsUser: 65534 - nodeSelector: - kubernetes.io/os: linux - serviceAccountName: kube-state-metrics diff --git a/managed/data/crds/victoriametrics/kube-state-metrics/service-account.yaml b/managed/data/crds/victoriametrics/kube-state-metrics/service-account.yaml deleted file mode 100644 index b384429a16..0000000000 --- a/managed/data/crds/victoriametrics/kube-state-metrics/service-account.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v1 -automountServiceAccountToken: false -kind: ServiceAccount -metadata: - labels: - app.kubernetes.io/component: exporter - app.kubernetes.io/name: kube-state-metrics - app.kubernetes.io/version: 2.5.0 - name: kube-state-metrics - namespace: default diff --git a/managed/data/crds/victoriametrics/kube-state-metrics/service.yaml b/managed/data/crds/victoriametrics/kube-state-metrics/service.yaml deleted file mode 100644 index ea3deef654..0000000000 --- a/managed/data/crds/victoriametrics/kube-state-metrics/service.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - app.kubernetes.io/component: exporter - app.kubernetes.io/name: kube-state-metrics - app.kubernetes.io/version: 2.5.0 - name: kube-state-metrics - namespace: default -spec: - clusterIP: None - ports: - - name: http-metrics - port: 8080 - targetPort: http-metrics - - name: telemetry - port: 8081 - targetPort: telemetry - selector: - app.kubernetes.io/name: kube-state-metrics diff --git a/managed/data/gen.go b/managed/data/gen.go index 13a2804e8d..f47aa93ff7 100644 --- a/managed/data/gen.go +++ b/managed/data/gen.go @@ -22,6 +22,3 @@ import "embed" // //go:embed iatemplates/* var IATemplates embed.FS - -//go:embed crds/* -var OLMCRDs embed.FS diff --git a/managed/models/database.go b/managed/models/database.go index 189037f922..75dae25e5d 100644 --- a/managed/models/database.go +++ b/managed/models/database.go @@ -862,7 +862,7 @@ var databaseSchema = [][]string{ `CREATE TABLE onboarding_system_tips ( id INTEGER PRIMARY KEY, is_completed BOOLEAN NOT NULL, - + created_at TIMESTAMP NOT NULL, updated_at TIMESTAMP NOT NULL ); @@ -873,13 +873,13 @@ var databaseSchema = [][]string{ (1, false, current_timestamp, current_timestamp), (2, false, current_timestamp, current_timestamp), (3, false, current_timestamp, current_timestamp); - + CREATE TABLE onboarding_user_tips ( id SERIAL PRIMARY KEY, tip_id INTEGER NOT NULL, user_id INTEGER NOT NULL, is_completed BOOLEAN NOT NULL, - + created_at TIMESTAMP NOT NULL, updated_at TIMESTAMP NOT NULL, UNIQUE (user_id, tip_id) @@ -900,7 +900,7 @@ var databaseSchema = [][]string{ ADD COLUMN folder VARCHAR NOT NULL DEFAULT '', ADD COLUMN metadata_list JSONB; - UPDATE scheduled_tasks + UPDATE scheduled_tasks SET data = jsonb_set(data, '{mongodb_backup, folder}', data->'mongodb_backup'->'name') WHERE type = 'mongodb_backup';`, }, @@ -909,7 +909,7 @@ var databaseSchema = [][]string{ `DROP TABLE IF EXISTS onboarding_user_tips`, }, 84: { - `ALTER TABLE agents + `ALTER TABLE agents ADD COLUMN comments_parsing_disabled BOOLEAN NOT NULL DEFAULT TRUE`, `ALTER TABLE agents @@ -918,6 +918,9 @@ var databaseSchema = [][]string{ 85: { `UPDATE services SET cluster = service_name WHERE cluster = ''`, }, + 86: { + `DROP TABLE kubernetes_clusters`, + }, } // ^^^ Avoid default values in schema definition. ^^^ diff --git a/managed/models/kubernetes_helpers.go b/managed/models/kubernetes_helpers.go deleted file mode 100644 index 8128803ddd..0000000000 --- a/managed/models/kubernetes_helpers.go +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package models - -import ( - "github.com/google/uuid" - "github.com/pkg/errors" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "gopkg.in/reform.v1" -) - -func checkUniqueKubernetesClusterID(q *reform.Querier, id string) error { - if id == "" { - return status.Error(codes.InvalidArgument, "empty Kubernetes Cluster ID") - } - - cluster := &KubernetesCluster{ID: id} - err := q.Reload(cluster) - if err != nil { - if errors.Is(err, reform.ErrNoRows) { - return nil - } - return errors.WithStack(err) - } - - return status.Errorf(codes.AlreadyExists, "Kubernetes Cluster with ID %q already exists.", id) -} - -func checkUniqueKubernetesClusterName(q *reform.Querier, name string) error { - if name == "" { - return status.Error(codes.InvalidArgument, "empty Kubernetes Cluster Name.") - } - - _, err := q.FindOneFrom(KubernetesClusterTable, "kubernetes_cluster_name", name) - if err != nil { - if errors.Is(err, reform.ErrNoRows) { - return nil - } - return errors.WithStack(err) - } - - return status.Errorf(codes.AlreadyExists, "Kubernetes Cluster with Name %q already exists.", name) -} - -// FindAllKubernetesClusters returns all Kubernetes clusters. -func FindAllKubernetesClusters(q *reform.Querier) ([]*KubernetesCluster, error) { - structs, err := q.SelectAllFrom(KubernetesClusterTable, "ORDER BY id") - if err != nil { - return nil, errors.WithStack(err) - } - - clusters := make([]*KubernetesCluster, len(structs)) - for i, s := range structs { - clusters[i] = s.(*KubernetesCluster) //nolint:forcetypeassert - } - - return clusters, nil -} - -// FindKubernetesClusterByName finds a Kubernetes cluster with provided name. -func FindKubernetesClusterByName(q *reform.Querier, name string) (*KubernetesCluster, error) { - if name == "" { - return nil, status.Error(codes.InvalidArgument, "Empty Kubernetes Cluster Name.") - } - - cluster, err := q.FindOneFrom(KubernetesClusterTable, "kubernetes_cluster_name", name) - if err != nil { - if errors.Is(err, reform.ErrNoRows) { - return nil, status.Errorf(codes.NotFound, "Kubernetes Cluster with name %q not found.", name) - } - return nil, errors.WithStack(err) - } - - return cluster.(*KubernetesCluster), nil //nolint:forcetypeassert -} - -// CreateKubernetesClusterParams contains all params required to create Kubernetes cluster. -type CreateKubernetesClusterParams struct { - KubernetesClusterName string - KubeConfig string -} - -// CreateKubernetesCluster creates Kubernetes cluster with provided params. -func CreateKubernetesCluster(q *reform.Querier, params *CreateKubernetesClusterParams) (*KubernetesCluster, error) { - id := "/kubernetes_cluster_id/" + uuid.New().String() - if err := checkUniqueKubernetesClusterID(q, id); err != nil { - return nil, err - } - if err := checkUniqueKubernetesClusterName(q, params.KubernetesClusterName); err != nil { - return nil, err - } - - row := &KubernetesCluster{ - ID: id, - KubernetesClusterName: params.KubernetesClusterName, - KubeConfig: params.KubeConfig, - IsReady: false, - } - if err := q.Insert(row); err != nil { - return nil, errors.WithStack(err) - } - - return row, nil -} - -// ChangeKubernetesClusterToReady changes k8s cluster to ready state once provisioning is finished. -func ChangeKubernetesClusterToReady(q *reform.Querier, name string) error { - c, err := FindKubernetesClusterByName(q, name) - if err != nil { - return err - } - c.IsReady = true - if err = q.Update(c); err != nil { - return errors.WithStack(err) - } - return nil -} - -// RemoveKubernetesCluster removes Kubernetes cluster with provided name. -func RemoveKubernetesCluster(q *reform.Querier, name string) error { - c, err := FindKubernetesClusterByName(q, name) - if err != nil { - return err - } - - return errors.Wrap(q.Delete(c), "failed to delete Kubernetes Cluster") -} diff --git a/managed/models/kubernetes_helpers_test.go b/managed/models/kubernetes_helpers_test.go deleted file mode 100644 index 6b602ba728..0000000000 --- a/managed/models/kubernetes_helpers_test.go +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package models_test - -import ( - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "gopkg.in/reform.v1" - "gopkg.in/reform.v1/dialects/postgresql" - - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/testdb" - "github.com/percona/pmm/managed/utils/tests" -) - -func TestKubernetesHelpers(t *testing.T) { - now, origNowF := models.Now(), models.Now - models.Now = func() time.Time { - return now - } - sqlDB := testdb.Open(t, models.SetupFixtures, nil) - defer func() { - models.Now = origNowF - }() - t.Cleanup(func() { - require.NoError(t, sqlDB.Close()) - }) - - setup := func(t *testing.T) (q *reform.Querier, teardown func(t *testing.T)) { - t.Helper() - db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) - tx, err := db.Begin() - require.NoError(t, err) - q = tx.Querier - - for _, str := range []reform.Struct{ - &models.KubernetesCluster{ - ID: "KC1", - KubernetesClusterName: "Kubernetes Cluster 1", - KubeConfig: `{"kind": "Config", "apiVersion": "v1"}`, - PXC: &models.Component{ - DisabledVersions: []string{"8.0.0"}, - DefaultVersion: "8.0.1-20", - }, - ProxySQL: &models.Component{ - DisabledVersions: []string{"8.0.0"}, - DefaultVersion: "8.0.1-19", - }, - HAProxy: &models.Component{ - DisabledVersions: []string{"2.0.0"}, - DefaultVersion: "2.1.7", - }, - Mongod: &models.Component{ - DisabledVersions: []string{"3.4.0", "3.6.0"}, - DefaultVersion: "4.4.3-8", - }, - }, - &models.KubernetesCluster{ - ID: "KC2", - KubernetesClusterName: "Kubernetes Cluster 2", - KubeConfig: `{}`, - }, - } { - require.NoError(t, q.Insert(str), "failed to INSERT %+v", str) - } - - teardown = func(t *testing.T) { - t.Helper() - require.NoError(t, tx.Rollback()) - } - return - } - - t.Run("FindAllKubernetesClusters", func(t *testing.T) { - q, teardown := setup(t) - defer teardown(t) - - expected := []*models.KubernetesCluster{ - { - ID: "KC1", - KubernetesClusterName: "Kubernetes Cluster 1", - KubeConfig: `{"kind": "Config", "apiVersion": "v1"}`, - PXC: &models.Component{ - DisabledVersions: []string{"8.0.0"}, - DefaultVersion: "8.0.1-20", - }, - ProxySQL: &models.Component{ - DisabledVersions: []string{"8.0.0"}, - DefaultVersion: "8.0.1-19", - }, - HAProxy: &models.Component{ - DisabledVersions: []string{"2.0.0"}, - DefaultVersion: "2.1.7", - }, - Mongod: &models.Component{ - DisabledVersions: []string{"3.4.0", "3.6.0"}, - DefaultVersion: "4.4.3-8", - }, - CreatedAt: now, - UpdatedAt: now, - }, - { - ID: "KC2", - KubernetesClusterName: "Kubernetes Cluster 2", - KubeConfig: `{}`, - CreatedAt: now, - UpdatedAt: now, - }, - } - - clusters, err := models.FindAllKubernetesClusters(q) - require.NoError(t, err) - require.Equal(t, expected, clusters) - }) - - t.Run("CreateKubernetesCluster", func(t *testing.T) { - t.Run("Basic", func(t *testing.T) { - q, teardown := setup(t) - defer teardown(t) - cluster, err := models.CreateKubernetesCluster(q, &models.CreateKubernetesClusterParams{ - KubernetesClusterName: "Kubernetes Cluster 3", - KubeConfig: "{}", - }) - require.NoError(t, err) - expected := &models.KubernetesCluster{ - ID: cluster.ID, - KubernetesClusterName: "Kubernetes Cluster 3", - KubeConfig: "{}", - CreatedAt: now, - UpdatedAt: now, - } - require.Equal(t, expected, cluster) - }) - - t.Run("EmptyKubernetesClusterName", func(t *testing.T) { - q, teardown := setup(t) - defer teardown(t) - cluster, err := models.CreateKubernetesCluster(q, &models.CreateKubernetesClusterParams{ - KubernetesClusterName: "", - KubeConfig: "{}", - }) - tests.AssertGRPCError(t, status.New(codes.InvalidArgument, "empty Kubernetes Cluster Name."), err) - require.Nil(t, cluster) - }) - - t.Run("EmptyKubeConfig", func(t *testing.T) { - q, teardown := setup(t) - defer teardown(t) - cluster, err := models.CreateKubernetesCluster(q, &models.CreateKubernetesClusterParams{ - KubernetesClusterName: "Kubernetes Cluster without config", - KubeConfig: "", - }) - require.EqualError(t, err, `pq: new row for relation "kubernetes_clusters" violates check constraint "kubernetes_clusters_kube_config_check"`) - require.Nil(t, cluster) - }) - - t.Run("AlreadyExist", func(t *testing.T) { - q, teardown := setup(t) - defer teardown(t) - cluster, err := models.CreateKubernetesCluster(q, &models.CreateKubernetesClusterParams{ - KubernetesClusterName: "Kubernetes Cluster 1", - KubeConfig: `{}`, - }) - - tests.AssertGRPCError(t, status.New(codes.AlreadyExists, "Kubernetes Cluster with Name \"Kubernetes Cluster 1\" already exists."), err) - require.Nil(t, cluster) - }) - }) - - t.Run("RemoveKubernetesCluster", func(t *testing.T) { - t.Run("Basic", func(t *testing.T) { - q, teardown := setup(t) - defer teardown(t) - err := models.RemoveKubernetesCluster(q, "Kubernetes Cluster 1") - assert.NoError(t, err) - }) - t.Run("NonExistCluster", func(t *testing.T) { - q, teardown := setup(t) - defer teardown(t) - err := models.RemoveKubernetesCluster(q, "test-cluster") - tests.AssertGRPCError(t, status.New(codes.NotFound, `Kubernetes Cluster with name "test-cluster" not found.`), err) - }) - }) -} diff --git a/managed/models/kubernetes_models.go b/managed/models/kubernetes_models.go deleted file mode 100644 index aef490cd3e..0000000000 --- a/managed/models/kubernetes_models.go +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package models - -import ( - "database/sql/driver" - "time" - - "gopkg.in/reform.v1" -) - -//go:generate ../../bin/reform - -// Component stores info about DBaaS Component. -type Component struct { - DisabledVersions []string - DefaultVersion string -} - -// Value implements database/sql/driver.Valuer interface. Should be defined on the value. -func (c Component) Value() (driver.Value, error) { return jsonValue(c) } - -// Scan implements database/sql.Scanner interface. Should be defined on the pointer. -func (c *Component) Scan(src interface{}) error { return jsonScan(c, src) } - -// KubernetesCluster represents a Kubernetes cluster as stored in database. -// -//reform:kubernetes_clusters -type KubernetesCluster struct { - ID string `reform:"id,pk"` - KubernetesClusterName string `reform:"kubernetes_cluster_name"` - KubeConfig string `reform:"kube_config"` - IsReady bool `reform:"ready"` - PXC *Component `reform:"pxc"` - ProxySQL *Component `reform:"proxysql"` - HAProxy *Component `reform:"haproxy"` - Mongod *Component `reform:"mongod"` - CreatedAt time.Time `reform:"created_at"` - UpdatedAt time.Time `reform:"updated_at"` -} - -// BeforeInsert implements reform.BeforeInserter interface. -func (s *KubernetesCluster) BeforeInsert() error { - now := Now() - s.CreatedAt = now - s.UpdatedAt = now - - return nil -} - -// BeforeUpdate implements reform.BeforeUpdater interface. -func (s *KubernetesCluster) BeforeUpdate() error { - s.UpdatedAt = Now() - - return nil -} - -// AfterFind implements reform.AfterFinder interface. -func (s *KubernetesCluster) AfterFind() error { - s.CreatedAt = s.CreatedAt.UTC() - s.UpdatedAt = s.UpdatedAt.UTC() - - return nil -} - -// check interfaces. -var ( - _ reform.BeforeInserter = (*KubernetesCluster)(nil) - _ reform.BeforeUpdater = (*KubernetesCluster)(nil) - _ reform.AfterFinder = (*KubernetesCluster)(nil) -) diff --git a/managed/models/kubernetes_models_reform.go b/managed/models/kubernetes_models_reform.go deleted file mode 100644 index 1bd2337d39..0000000000 --- a/managed/models/kubernetes_models_reform.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by gopkg.in/reform.v1. DO NOT EDIT. - -package models - -import ( - "fmt" - "strings" - - "gopkg.in/reform.v1" - "gopkg.in/reform.v1/parse" -) - -type kubernetesClusterTableType struct { - s parse.StructInfo - z []interface{} -} - -// Schema returns a schema name in SQL database (""). -func (v *kubernetesClusterTableType) Schema() string { - return v.s.SQLSchema -} - -// Name returns a view or table name in SQL database ("kubernetes_clusters"). -func (v *kubernetesClusterTableType) Name() string { - return v.s.SQLName -} - -// Columns returns a new slice of column names for that view or table in SQL database. -func (v *kubernetesClusterTableType) Columns() []string { - return []string{ - "id", - "kubernetes_cluster_name", - "kube_config", - "ready", - "pxc", - "proxysql", - "haproxy", - "mongod", - "created_at", - "updated_at", - } -} - -// NewStruct makes a new struct for that view or table. -func (v *kubernetesClusterTableType) NewStruct() reform.Struct { - return new(KubernetesCluster) -} - -// NewRecord makes a new record for that table. -func (v *kubernetesClusterTableType) NewRecord() reform.Record { - return new(KubernetesCluster) -} - -// PKColumnIndex returns an index of primary key column for that table in SQL database. -func (v *kubernetesClusterTableType) PKColumnIndex() uint { - return uint(v.s.PKFieldIndex) -} - -// KubernetesClusterTable represents kubernetes_clusters view or table in SQL database. -var KubernetesClusterTable = &kubernetesClusterTableType{ - s: parse.StructInfo{ - Type: "KubernetesCluster", - SQLName: "kubernetes_clusters", - Fields: []parse.FieldInfo{ - {Name: "ID", Type: "string", Column: "id"}, - {Name: "KubernetesClusterName", Type: "string", Column: "kubernetes_cluster_name"}, - {Name: "KubeConfig", Type: "string", Column: "kube_config"}, - {Name: "IsReady", Type: "bool", Column: "ready"}, - {Name: "PXC", Type: "*Component", Column: "pxc"}, - {Name: "ProxySQL", Type: "*Component", Column: "proxysql"}, - {Name: "HAProxy", Type: "*Component", Column: "haproxy"}, - {Name: "Mongod", Type: "*Component", Column: "mongod"}, - {Name: "CreatedAt", Type: "time.Time", Column: "created_at"}, - {Name: "UpdatedAt", Type: "time.Time", Column: "updated_at"}, - }, - PKFieldIndex: 0, - }, - z: new(KubernetesCluster).Values(), -} - -// String returns a string representation of this struct or record. -func (s KubernetesCluster) String() string { - res := make([]string, 10) - res[0] = "ID: " + reform.Inspect(s.ID, true) - res[1] = "KubernetesClusterName: " + reform.Inspect(s.KubernetesClusterName, true) - res[2] = "KubeConfig: " + reform.Inspect(s.KubeConfig, true) - res[3] = "IsReady: " + reform.Inspect(s.IsReady, true) - res[4] = "PXC: " + reform.Inspect(s.PXC, true) - res[5] = "ProxySQL: " + reform.Inspect(s.ProxySQL, true) - res[6] = "HAProxy: " + reform.Inspect(s.HAProxy, true) - res[7] = "Mongod: " + reform.Inspect(s.Mongod, true) - res[8] = "CreatedAt: " + reform.Inspect(s.CreatedAt, true) - res[9] = "UpdatedAt: " + reform.Inspect(s.UpdatedAt, true) - return strings.Join(res, ", ") -} - -// Values returns a slice of struct or record field values. -// Returned interface{} values are never untyped nils. -func (s *KubernetesCluster) Values() []interface{} { - return []interface{}{ - s.ID, - s.KubernetesClusterName, - s.KubeConfig, - s.IsReady, - s.PXC, - s.ProxySQL, - s.HAProxy, - s.Mongod, - s.CreatedAt, - s.UpdatedAt, - } -} - -// Pointers returns a slice of pointers to struct or record fields. -// Returned interface{} values are never untyped nils. -func (s *KubernetesCluster) Pointers() []interface{} { - return []interface{}{ - &s.ID, - &s.KubernetesClusterName, - &s.KubeConfig, - &s.IsReady, - &s.PXC, - &s.ProxySQL, - &s.HAProxy, - &s.Mongod, - &s.CreatedAt, - &s.UpdatedAt, - } -} - -// View returns View object for that struct. -func (s *KubernetesCluster) View() reform.View { - return KubernetesClusterTable -} - -// Table returns Table object for that record. -func (s *KubernetesCluster) Table() reform.Table { - return KubernetesClusterTable -} - -// PKValue returns a value of primary key for that record. -// Returned interface{} value is never untyped nil. -func (s *KubernetesCluster) PKValue() interface{} { - return s.ID -} - -// PKPointer returns a pointer to primary key field for that record. -// Returned interface{} value is never untyped nil. -func (s *KubernetesCluster) PKPointer() interface{} { - return &s.ID -} - -// HasPK returns true if record has non-zero primary key set, false otherwise. -func (s *KubernetesCluster) HasPK() bool { - return s.ID != KubernetesClusterTable.z[KubernetesClusterTable.s.PKFieldIndex] -} - -// SetPK sets record primary key, if possible. -// -// Deprecated: prefer direct field assignment where possible: s.ID = pk. -func (s *KubernetesCluster) SetPK(pk interface{}) { - reform.SetPK(s, pk) -} - -// check interfaces -var ( - _ reform.View = KubernetesClusterTable - _ reform.Struct = (*KubernetesCluster)(nil) - _ reform.Table = KubernetesClusterTable - _ reform.Record = (*KubernetesCluster)(nil) - _ fmt.Stringer = (*KubernetesCluster)(nil) -) - -func init() { - parse.AssertUpToDate(&KubernetesClusterTable.s, new(KubernetesCluster)) -} diff --git a/managed/models/settings.go b/managed/models/settings.go index 981f2fee9c..a0389a07a4 100644 --- a/managed/models/settings.go +++ b/managed/models/settings.go @@ -79,11 +79,6 @@ type Settings struct { SaaS SaaS `json:"sass"` // sic :( - // DBaaS config options - DBaaS struct { - Enabled bool `json:"enabled"` - } `json:"dbaas"` - Alerting Alerting `json:"alerting"` Azurediscover struct { @@ -189,7 +184,6 @@ func (s *Settings) fillDefaults() { // SSHKey is empty by default // AlertManagerURL is empty by default // SaaS.STTDisabled is false by default - // DBaaS.Enabled is false by default // Alerting.Disabled is false by default // VictoriaMetrics CacheEnable is false by default // PMMPublicAddress is empty by default diff --git a/managed/models/settings_helpers.go b/managed/models/settings_helpers.go index b439121cf8..056bc3bc5f 100644 --- a/managed/models/settings_helpers.go +++ b/managed/models/settings_helpers.go @@ -81,11 +81,6 @@ type ChangeSettingsParams struct { // STT check intervals STTCheckIntervals STTCheckIntervals - // Enable DBaaS features. - EnableDBaaS bool - // Disable DBaaS features. - DisableDBaaS bool - // Enable Azure Discover features. EnableAzurediscover bool // Disable Azure Discover features. @@ -240,14 +235,6 @@ func UpdateSettings(q reform.DBTX, params *ChangeSettingsParams) (*Settings, err settings.SaaS.DisabledSTTChecks = res } - if params.EnableDBaaS { - settings.DBaaS.Enabled = true - } - - if params.DisableDBaaS { - settings.DBaaS.Enabled = false - } - if params.DisableVMCache { settings.VictoriaMetrics.CacheEnabled = false } diff --git a/managed/packages.dot b/managed/packages.dot index b0b874749b..529737a6c2 100644 --- a/managed/packages.dot +++ b/managed/packages.dot @@ -7,13 +7,11 @@ digraph packages { "/" -> "/services/backup"; "/" -> "/services/checks"; "/" -> "/services/config"; - "/" -> "/services/dbaas"; "/" -> "/services/grafana"; "/" -> "/services/inventory"; "/" -> "/services/inventory/grpc"; "/" -> "/services/management"; "/" -> "/services/management/backup"; - "/" -> "/services/management/dbaas"; "/" -> "/services/management/grpc"; "/" -> "/services/management/ia"; "/" -> "/services/minio"; diff --git a/managed/services/dbaas/dbaas_client.go b/managed/services/dbaas/dbaas_client.go deleted file mode 100644 index 2768eea2b1..0000000000 --- a/managed/services/dbaas/dbaas_client.go +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -// Package dbaas contains logic related to communication with dbaas-controller. -// -//nolint:lll -package dbaas - -import ( - "context" - "sync" - "time" - - controllerv1beta1 "github.com/percona-platform/dbaas-api/gen/controller" - "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "google.golang.org/grpc" - "google.golang.org/grpc/backoff" - "google.golang.org/grpc/credentials/insecure" - - "github.com/percona/pmm/managed/services/dbaas/kubernetes" - "github.com/percona/pmm/version" -) - -// Client is a client for dbaas-controller. -type Client struct { - l *logrus.Entry - kubernetesClient controllerv1beta1.KubernetesClusterAPIClient - pxcClusterClient controllerv1beta1.PXCClusterAPIClient - psmdbClusterClient controllerv1beta1.PSMDBClusterAPIClient - logsClient controllerv1beta1.LogsAPIClient - pxcOperatorClient controllerv1beta1.PXCOperatorAPIClient - psmdbOperatorClient controllerv1beta1.PSMDBOperatorAPIClient - connM sync.RWMutex - conn *grpc.ClientConn - dbaasControllerAPIAddress string -} - -// NewClient creates new Client object. -func NewClient(dbaasControllerAPIAddress string) *Client { - c := &Client{ - l: logrus.WithField("component", "dbaas.Client"), - dbaasControllerAPIAddress: dbaasControllerAPIAddress, - } - return c -} - -// Connect connects the client to dbaas-controller API. -func (c *Client) Connect(ctx context.Context) error { - c.connM.Lock() - defer c.connM.Unlock() - c.l.Infof("Connecting to dbaas-controller API on %s.", c.dbaasControllerAPIAddress) - if c.conn != nil { - c.l.Warnf("Trying to connect to dbaas-controller API but connection is already up.") - return nil - } - backoffConfig := backoff.DefaultConfig - backoffConfig.MaxDelay = 10 * time.Second - opts := []grpc.DialOption{ - grpc.WithBlock(), // Dial blocks, we do not connect in background. - grpc.WithTransportCredentials(insecure.NewCredentials()), - grpc.WithConnectParams(grpc.ConnectParams{Backoff: backoffConfig, MinConnectTimeout: 10 * time.Second}), - grpc.WithUserAgent("pmm-managed/" + version.Version), - } - - conn, err := grpc.DialContext(ctx, c.dbaasControllerAPIAddress, opts...) - if err != nil { - return errors.Errorf("failed to connect to dbaas-controller API: %v", err) - } - c.conn = conn - - c.kubernetesClient = controllerv1beta1.NewKubernetesClusterAPIClient(conn) - c.pxcClusterClient = controllerv1beta1.NewPXCClusterAPIClient(conn) - c.psmdbClusterClient = controllerv1beta1.NewPSMDBClusterAPIClient(conn) - c.logsClient = controllerv1beta1.NewLogsAPIClient(conn) - c.psmdbOperatorClient = controllerv1beta1.NewPSMDBOperatorAPIClient(conn) - c.pxcOperatorClient = controllerv1beta1.NewPXCOperatorAPIClient(conn) - - c.l.Info("Connected to dbaas-controller API.") - return nil -} - -// Disconnect disconnects the client from dbaas-controller API. -func (c *Client) Disconnect() error { - c.connM.Lock() - defer c.connM.Unlock() - c.l.Info("Disconnecting from dbaas-controller API.") - - if c.conn == nil { - c.l.Warnf("Trying to disconnect from dbaas-controller API but the connection is not up.") - return nil - } - - if err := c.conn.Close(); err != nil { - return errors.Errorf("failed to close conn to dbaas-controller API: %v", err) - } - c.conn = nil - c.l.Info("Disconected from dbaas-controller API.") - return nil -} - -// GetLogs gets logs out of cluster containers and events out of pods. -func (c *Client) GetLogs(ctx context.Context, in *controllerv1beta1.GetLogsRequest, opts ...grpc.CallOption) (*controllerv1beta1.GetLogsResponse, error) { - c.connM.RLock() - defer c.connM.RUnlock() - return c.logsClient.GetLogs(ctx, in, opts...) -} - -// GetResources returns all and available resources of a Kubernetes cluster. -func (c *Client) GetResources(ctx context.Context, in *controllerv1beta1.GetResourcesRequest, opts ...grpc.CallOption) (*controllerv1beta1.GetResourcesResponse, error) { - c.connM.RLock() - defer c.connM.RUnlock() - return c.kubernetesClient.GetResources(ctx, in, opts...) -} - -// InstallPXCOperator installs kubernetes pxc operator. -func (c *Client) InstallPXCOperator(ctx context.Context, in *controllerv1beta1.InstallPXCOperatorRequest, opts ...grpc.CallOption) (*controllerv1beta1.InstallPXCOperatorResponse, error) { - c.connM.RLock() - defer c.connM.RUnlock() - return c.pxcOperatorClient.InstallPXCOperator(ctx, in, opts...) -} - -// InstallPSMDBOperator installs kubernetes PSMDB operator. -func (c *Client) InstallPSMDBOperator(ctx context.Context, in *controllerv1beta1.InstallPSMDBOperatorRequest, opts ...grpc.CallOption) (*controllerv1beta1.InstallPSMDBOperatorResponse, error) { - c.connM.RLock() - defer c.connM.RUnlock() - return c.psmdbOperatorClient.InstallPSMDBOperator(ctx, in, opts...) -} - -// StartMonitoring sets up victoria metrics operator to monitor kubernetes cluster. -func (c *Client) StartMonitoring(ctx context.Context, in *controllerv1beta1.StartMonitoringRequest, opts ...grpc.CallOption) (*controllerv1beta1.StartMonitoringResponse, error) { - c.connM.RLock() - defer c.connM.RUnlock() - return c.kubernetesClient.StartMonitoring(ctx, in, opts...) -} - -// StopMonitoring removes victoria metrics operator from the kubernetes cluster. -func (c *Client) StopMonitoring(ctx context.Context, in *controllerv1beta1.StopMonitoringRequest, opts ...grpc.CallOption) (*controllerv1beta1.StopMonitoringResponse, error) { - c.connM.RLock() - defer c.connM.RUnlock() - return c.kubernetesClient.StopMonitoring(ctx, in, opts...) -} - -func (c *Client) GetKubeConfig(ctx context.Context, _ *controllerv1beta1.GetKubeconfigRequest, _ ...grpc.CallOption) (*controllerv1beta1.GetKubeconfigResponse, error) { - c.connM.RLock() - defer c.connM.RUnlock() - - kClient, err := kubernetes.NewIncluster() - if err != nil { - c.l.Errorf("failed creating kubernetes client: %v", err) - return nil, err - } - - kubeConfig, err := kClient.GetKubeconfig(ctx) - return &controllerv1beta1.GetKubeconfigResponse{ - Kubeconfig: kubeConfig, - }, err -} diff --git a/managed/services/dbaas/kubernetes/client/client.go b/managed/services/dbaas/kubernetes/client/client.go deleted file mode 100644 index 832023e00b..0000000000 --- a/managed/services/dbaas/kubernetes/client/client.go +++ /dev/null @@ -1,1089 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -// Package client TODO. -package client - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - "log" - "os" - "sort" - "strings" - "sync" - "text/tabwriter" - "time" - - v1 "github.com/operator-framework/api/pkg/operators/v1" - "github.com/operator-framework/api/pkg/operators/v1alpha1" - "github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned" - dbaasv1 "github.com/percona/dbaas-operator/api/v1" - "github.com/pkg/errors" - "gopkg.in/yaml.v3" - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - storagev1 "k8s.io/api/storage/v1" - apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - apiextv1clientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - yamlSerializer "k8s.io/apimachinery/pkg/runtime/serializer/yaml" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/duration" - "k8s.io/apimachinery/pkg/util/wait" - yamlutil "k8s.io/apimachinery/pkg/util/yaml" - "k8s.io/apimachinery/pkg/version" - "k8s.io/cli-runtime/pkg/resource" - "k8s.io/client-go/dynamic" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/kubernetes/scheme" - corev1client "k8s.io/client-go/kubernetes/typed/core/v1" - _ "k8s.io/client-go/plugin/pkg/client/auth" // load all auth plugins - "k8s.io/client-go/rest" - "k8s.io/client-go/restmapper" - "k8s.io/client-go/tools/clientcmd" - "k8s.io/client-go/tools/reference" - deploymentutil "k8s.io/kubectl/pkg/util/deployment" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/apiutil" - - "github.com/percona/pmm/managed/services/dbaas/kubernetes/client/database" -) - -const ( - configKind = "Config" - apiVersion = "v1" - defaultName = "default" - - dbaasToolPath = "/opt/dbaas-tools/bin" - - defaultQPSLimit = 100 - defaultBurstLimit = 150 - defaultChunkSize = 500 - - defaultAPIURIPath = "/api" - defaultAPIsURIPath = "/apis" -) - -// Each level has 2 spaces for PrefixWriter -// -//nolint:stylecheck -const ( - LEVEL_0 = iota - LEVEL_1 - LEVEL_2 - LEVEL_3 - LEVEL_4 -) - -// Client is the internal client for Kubernetes. -type Client struct { - clientset kubernetes.Interface - apiextClientset apiextv1clientset.Interface - dynamicClientset dynamic.Interface - dbClusterClient *database.DatabaseClusterClient - rcLock *sync.Mutex - restConfig *rest.Config - namespace string -} - -// SortableEvents implements sort.Interface for []api.Event based on the Timestamp field. -type SortableEvents []corev1.Event - -func (list SortableEvents) Len() int { - return len(list) -} - -func (list SortableEvents) Swap(i, j int) { - list[i], list[j] = list[j], list[i] -} - -func (list SortableEvents) Less(i, j int) bool { - return list[i].LastTimestamp.Time.Before(list[j].LastTimestamp.Time) -} - -type resourceError struct { - name string - issue string -} - -type podError struct { - resourceError -} - -type deploymentError struct { - resourceError - podErrs podErrors -} - -type ( - deploymentErrors []deploymentError - podErrors []podError -) - -func (e deploymentErrors) Error() string { - var sb strings.Builder - for _, i := range e { - sb.WriteString(fmt.Sprintf("deployment %s has error: %s\n%s", i.name, i.issue, i.podErrs.Error())) - } - return sb.String() -} - -func (e podErrors) Error() string { - var sb strings.Builder - for _, i := range e { - sb.WriteString(fmt.Sprintf("\tpod %s has error: %s\n", i.name, i.issue)) - } - return sb.String() -} - -// NewFromInCluster returns a client object which uses the service account -// kubernetes gives to pods. It's intended for clients that expect to be -// running inside a pod running on kubernetes. It will return ErrNotInCluster -// if called from a process not running in a kubernetes environment. -func NewFromInCluster() (*Client, error) { - config, err := rest.InClusterConfig() - if err != nil { - return nil, err - } - config.QPS = defaultQPSLimit - config.Burst = defaultBurstLimit - clientset, err := kubernetes.NewForConfig(config) - if err != nil { - return nil, err - } - apiextClientset, err := apiextv1clientset.NewForConfig(config) - if err != nil { - return nil, err - } - dynamicClientset, err := dynamic.NewForConfig(config) - if err != nil { - return nil, err - } - c := &Client{ - clientset: clientset, - apiextClientset: apiextClientset, - dynamicClientset: dynamicClientset, - restConfig: config, - rcLock: &sync.Mutex{}, - } - err = c.setup() - return c, err -} - -// NewFromKubeConfigString creates a new client for the given config string. -// It's intended for clients that expect to be running outside of a cluster. -func NewFromKubeConfigString(kubeconfig string) (*Client, error) { - config, err := clientcmd.BuildConfigFromKubeconfigGetter("", NewConfigGetter(kubeconfig).loadFromString) - if err != nil { - return nil, err - } - config.QPS = defaultQPSLimit - config.Burst = defaultBurstLimit - clientset, err := kubernetes.NewForConfig(config) - if err != nil { - return nil, err - } - apiextClientset, err := apiextv1clientset.NewForConfig(config) - if err != nil { - return nil, err - } - dynamicClientset, err := dynamic.NewForConfig(config) - if err != nil { - return nil, err - } - c := &Client{ - clientset: clientset, - apiextClientset: apiextClientset, - dynamicClientset: dynamicClientset, - restConfig: config, - rcLock: &sync.Mutex{}, - } - err = c.setup() - return c, err -} - -func (c *Client) setup() error { - namespace := "default" - if space := os.Getenv("NAMESPACE"); space != "" { - namespace = space - } - // Set PATH variable to make aws-iam-authenticator executable - path := fmt.Sprintf("%s:%s", os.Getenv("PATH"), dbaasToolPath) - os.Setenv("PATH", path) - c.namespace = namespace - return c.initOperatorClients() -} - -// Initializes clients for operators. -func (c *Client) initOperatorClients() error { - dbClusterClient, err := database.NewForConfig(c.restConfig) - if err != nil { - return err - } - c.dbClusterClient = dbClusterClient - _, err = c.GetServerVersion() - return err -} - -// GetSecretsForServiceAccount returns secret by given service account name. -func (c *Client) GetSecretsForServiceAccount(ctx context.Context, accountName string) (*corev1.Secret, error) { - serviceAccount, err := c.clientset.CoreV1().ServiceAccounts(c.namespace).Get(ctx, accountName, metav1.GetOptions{}) - if err != nil { - return nil, err - } - - if len(serviceAccount.Secrets) == 0 { - return nil, errors.Errorf("no secrets available for namespace %s", c.namespace) - } - - return c.clientset.CoreV1().Secrets(c.namespace).Get( - ctx, - serviceAccount.Secrets[0].Name, - metav1.GetOptions{}) -} - -// GenerateKubeConfig generates kubeconfig. -func (c *Client) GenerateKubeConfig(secret *corev1.Secret) ([]byte, error) { - conf := &Config{ - Kind: configKind, - APIVersion: apiVersion, - CurrentContext: defaultName, - } - conf.Clusters = []ClusterInfo{ - { - Name: defaultName, - Cluster: Cluster{ - CertificateAuthorityData: secret.Data["ca.crt"], - Server: c.restConfig.Host, - }, - }, - } - conf.Contexts = []ContextInfo{ - { - Name: defaultName, - Context: Context{ - Cluster: defaultName, - User: "pmm-service-account", - Namespace: defaultName, - }, - }, - } - conf.Users = []UserInfo{ - { - Name: "pmm-service-account", - User: User{ - Token: string(secret.Data["token"]), - }, - }, - } - - return c.marshalKubeConfig(conf) -} - -// GetServerVersion returns server version. -func (c *Client) GetServerVersion() (*version.Info, error) { - return c.clientset.Discovery().ServerVersion() -} - -// ListDatabaseClusters returns list of managed PCX clusters. -func (c *Client) ListDatabaseClusters(ctx context.Context) (*dbaasv1.DatabaseClusterList, error) { - return c.dbClusterClient.DBClusters(c.namespace).List(ctx, metav1.ListOptions{}) -} - -// GetDatabaseCluster returns PXC clusters by provided name. -func (c *Client) GetDatabaseCluster(ctx context.Context, name string) (*dbaasv1.DatabaseCluster, error) { - cluster, err := c.dbClusterClient.DBClusters(c.namespace).Get(ctx, name, metav1.GetOptions{}) - if err != nil { - return nil, err - } - return cluster, nil -} - -// GetStorageClasses returns all storage classes available in the cluster. -func (c *Client) GetStorageClasses(ctx context.Context) (*storagev1.StorageClassList, error) { - return c.clientset.StorageV1().StorageClasses().List(ctx, metav1.ListOptions{}) -} - -// GetDeployment returns deployment by name. -func (c *Client) GetDeployment(ctx context.Context, name string) (*appsv1.Deployment, error) { - return c.clientset.AppsV1().Deployments(c.namespace).Get(ctx, name, metav1.GetOptions{}) -} - -// GetSecret returns secret by name. -func (c *Client) GetSecret(ctx context.Context, name string) (*corev1.Secret, error) { - return c.clientset.CoreV1().Secrets(c.namespace).Get(ctx, name, metav1.GetOptions{}) -} - -// ListSecrets returns secrets. -func (c *Client) ListSecrets(ctx context.Context) (*corev1.SecretList, error) { - return c.clientset.CoreV1().Secrets(c.namespace).List(ctx, metav1.ListOptions{}) -} - -// DeleteObject deletes object from the k8s cluster. -func (c *Client) DeleteObject(obj runtime.Object) error { - groupResources, err := restmapper.GetAPIGroupResources(c.clientset.Discovery()) - if err != nil { - return err - } - mapper := restmapper.NewDiscoveryRESTMapper(groupResources) - - gvk := obj.GetObjectKind().GroupVersionKind() - gk := schema.GroupKind{Group: gvk.Group, Kind: gvk.Kind} - mapping, err := mapper.RESTMapping(gk, gvk.Version) - if err != nil { - return err - } - namespace, name, err := c.retrieveMetaFromObject(obj) - if err != nil { - return err - } - cli, err := c.resourceClient(mapping.GroupVersionKind.GroupVersion()) - if err != nil { - return err - } - helper := resource.NewHelper(cli, mapping) - err = deleteObject(helper, namespace, name) - return err -} - -func deleteObject(helper *resource.Helper, namespace, name string) error { - if _, err := helper.Get(namespace, name); err == nil { - _, err = helper.Delete(namespace, name) - if err != nil { - return err - } - } - return nil -} - -func (c *Client) ApplyObject(obj runtime.Object) error { - groupResources, err := restmapper.GetAPIGroupResources(c.clientset.Discovery()) - if err != nil { - return err - } - mapper := restmapper.NewDiscoveryRESTMapper(groupResources) - - gvk := obj.GetObjectKind().GroupVersionKind() - gk := schema.GroupKind{Group: gvk.Group, Kind: gvk.Kind} - mapping, err := mapper.RESTMapping(gk, gvk.Version) - if err != nil { - return err - } - namespace, name, err := c.retrieveMetaFromObject(obj) - if err != nil { - return err - } - cli, err := c.resourceClient(mapping.GroupVersionKind.GroupVersion()) - if err != nil { - return err - } - helper := resource.NewHelper(cli, mapping) - return c.applyObject(helper, namespace, name, obj) -} - -func (c *Client) applyObject(helper *resource.Helper, namespace, name string, obj runtime.Object) error { - if _, err := helper.Get(namespace, name); err != nil { - _, err = helper.Create(namespace, false, obj) - if err != nil { - return err - } - } else { - _, err = helper.Replace(namespace, name, true, obj) - if err != nil { - return err - } - } - return nil -} - -func (c *Client) retrieveMetaFromObject(obj runtime.Object) (namespace, name string, err error) { //nolint:nonamedreturns - name, err = meta.NewAccessor().Name(obj) - if err != nil { - return - } - namespace, err = meta.NewAccessor().Namespace(obj) - if err != nil { - return - } - if namespace == "" { - namespace = c.namespace - } - return -} - -func (c *Client) resourceClient(gv schema.GroupVersion) (*rest.RESTClient, error) { - cfg := c.restConfig - cfg.ContentConfig = resource.UnstructuredPlusDefaultContentConfig() - cfg.GroupVersion = &gv - if len(gv.Group) == 0 { - cfg.APIPath = defaultAPIURIPath - } else { - cfg.APIPath = defaultAPIsURIPath - } - return rest.RESTClientFor(cfg) -} - -func (c *Client) marshalKubeConfig(conf *Config) ([]byte, error) { - config, err := json.Marshal(&conf) - if err != nil { - return nil, err - } - - var jsonObj interface{} - err = yaml.Unmarshal(config, &jsonObj) - if err != nil { - return nil, err - } - - return yaml.Marshal(jsonObj) -} - -// GetPersistentVolumes returns Persistent Volumes available in the cluster. -func (c *Client) GetPersistentVolumes(ctx context.Context) (*corev1.PersistentVolumeList, error) { - return c.clientset.CoreV1().PersistentVolumes().List(ctx, metav1.ListOptions{}) -} - -// GetPods returns list of pods. -func (c *Client) GetPods(ctx context.Context, namespace string, labelSelector *metav1.LabelSelector) (*corev1.PodList, error) { - options := metav1.ListOptions{} - if labelSelector != nil && (labelSelector.MatchLabels != nil || labelSelector.MatchExpressions != nil) { - options.LabelSelector = metav1.FormatLabelSelector(labelSelector) - } - - return c.clientset.CoreV1().Pods(namespace).List(ctx, options) -} - -// GetNodes returns list of nodes. -func (c *Client) GetNodes(ctx context.Context) (*corev1.NodeList, error) { - return c.clientset.CoreV1().Nodes().List(ctx, metav1.ListOptions{}) -} - -// GetLogs returns logs for pod. -func (c *Client) GetLogs(ctx context.Context, pod, container string) (string, error) { - defaultLogLines := int64(3000) - options := &corev1.PodLogOptions{} - if container != "" { - options.Container = container - } - - options.TailLines = &defaultLogLines - buf := &bytes.Buffer{} - - req := c.clientset.CoreV1().Pods(c.namespace).GetLogs(pod, options) - podLogs, err := req.Stream(ctx) - if err != nil { - return buf.String(), err - } - - _, err = io.Copy(buf, podLogs) - if err != nil { - return buf.String(), err - } - - return buf.String(), nil -} - -func (c *Client) GetEvents(ctx context.Context, name string) (string, error) { - pod, err := c.clientset.CoreV1().Pods(c.namespace).Get(ctx, name, metav1.GetOptions{}) - if err != nil { - eventsInterface := c.clientset.CoreV1().Events(c.namespace) - selector := eventsInterface.GetFieldSelector(&name, &c.namespace, nil, nil) - initialOpts := metav1.ListOptions{ - FieldSelector: selector.String(), - Limit: defaultChunkSize, - } - events := &corev1.EventList{} - err2 := resource.FollowContinue(&initialOpts, - func(options metav1.ListOptions) (runtime.Object, error) { - newList, err := eventsInterface.List(ctx, options) - if err != nil { - return nil, resource.EnhanceListError(err, options, "events") - } - - events.Items = append(events.Items, newList.Items...) - return newList, nil - }) - - if err2 == nil && len(events.Items) != 0 { - return tabbedString(func(out io.Writer) error { - w := NewPrefixWriter(out) - w.Writef(0, "Pod '%v': error '%v', but found events.\n", name, err) - DescribeEvents(events, w) - return nil - }) - } - - return "", err - } - - var events *corev1.EventList - if ref, err := reference.GetReference(scheme.Scheme, pod); err != nil { - fmt.Printf("Unable to construct reference to '%#v': %v", pod, err) //nolint:forbidigo - } else { - ref.Kind = "" - if _, isMirrorPod := pod.Annotations[corev1.MirrorPodAnnotationKey]; isMirrorPod { - ref.UID = types.UID(pod.Annotations[corev1.MirrorPodAnnotationKey]) - } - - events, _ = searchEvents(c.clientset.CoreV1(), ref, defaultChunkSize) //nolint:contextcheck - } - - return tabbedString(func(out io.Writer) error { - w := NewPrefixWriter(out) - w.Writef(LEVEL_0, name+" ") - DescribeEvents(events, w) - return nil - }) -} - -func tabbedString(f func(io.Writer) error) (string, error) { - out := &tabwriter.Writer{} - buf := &bytes.Buffer{} - out.Init(buf, 0, 8, 2, ' ', 0) - - err := f(out) - if err != nil { - return "", err - } - - out.Flush() - str := buf.String() - return str, nil -} - -func DescribeEvents(el *corev1.EventList, w PrefixWriter) { - if len(el.Items) == 0 { - w.Writef(LEVEL_0, "Events:\t\n") - return - } - - w.Flush() - sort.Sort(SortableEvents(el.Items)) - w.Writef(LEVEL_0, "Events:\n Type\tReason\tAge\tFrom\tMessage\n") - w.Writef(LEVEL_1, "----\t------\t----\t----\t-------\n") - for _, e := range el.Items { - var interval string - firstTimestampSince := translateMicroTimestampSince(e.EventTime) - if e.EventTime.IsZero() { - firstTimestampSince = translateTimestampSince(e.FirstTimestamp) - } - - switch { - case e.Series != nil: - interval = fmt.Sprintf("%s (x%d over %s)", translateMicroTimestampSince(e.Series.LastObservedTime), e.Series.Count, firstTimestampSince) - case e.Count > 1: - interval = fmt.Sprintf("%s (x%d over %s)", translateTimestampSince(e.LastTimestamp), e.Count, firstTimestampSince) - default: - interval = firstTimestampSince - } - - source := e.Source.Component - if source == "" { - source = e.ReportingController - } - - w.Writef(LEVEL_1, "%v\t%v\t%s\t%v\t%v\n", - e.Type, - e.Reason, - interval, - source, - strings.TrimSpace(e.Message)) - } -} - -// searchEvents finds events about the specified object. -// It is very similar to CoreV1.Events.Search, but supports the Limit parameter. -func searchEvents(client corev1client.EventsGetter, objOrRef runtime.Object, limit int64) (*corev1.EventList, error) { - ref, err := reference.GetReference(scheme.Scheme, objOrRef) - if err != nil { - return nil, err - } - - stringRefKind := ref.Kind - var refKind *string - if len(stringRefKind) > 0 { - refKind = &stringRefKind - } - - stringRefUID := string(ref.UID) - var refUID *string - if len(stringRefUID) > 0 { - refUID = &stringRefUID - } - - e := client.Events(ref.Namespace) - fieldSelector := e.GetFieldSelector(&ref.Name, &ref.Namespace, refKind, refUID) - initialOpts := metav1.ListOptions{FieldSelector: fieldSelector.String(), Limit: limit} - eventList := &corev1.EventList{} - err = resource.FollowContinue(&initialOpts, - func(options metav1.ListOptions) (runtime.Object, error) { - newEvents, err := e.List(context.TODO(), options) - if err != nil { - return nil, resource.EnhanceListError(err, options, "events") - } - - eventList.Items = append(eventList.Items, newEvents.Items...) - return newEvents, nil - }) - - return eventList, err -} - -// translateMicroTimestampSince returns the elapsed time since timestamp in -// human-readable approximation. -func translateMicroTimestampSince(timestamp metav1.MicroTime) string { - if timestamp.IsZero() { - return "" - } - - return duration.HumanDuration(time.Since(timestamp.Time)) -} - -// translateTimestampSince returns the elapsed time since timestamp in -// human-readable approximation. -func translateTimestampSince(timestamp metav1.Time) string { - if timestamp.IsZero() { - return "" - } - - return duration.HumanDuration(time.Since(timestamp.Time)) -} - -// ApplyFile accepts manifest file contents, parses into []runtime.Object -// and applies them against the cluster. -func (c *Client) ApplyFile(fileBytes []byte) error { - objs, err := c.getObjects(fileBytes) - if err != nil { - return err - } - for i := range objs { - err := c.ApplyObject(objs[i]) - if err != nil { - return err - } - } - return nil -} - -func (c *Client) getObjects(f []byte) ([]runtime.Object, error) { - objs := []runtime.Object{} - decoder := yamlutil.NewYAMLOrJSONDecoder(bytes.NewReader(f), 100) - var err error - for { - var rawObj runtime.RawExtension - if err = decoder.Decode(&rawObj); err != nil { - break - } - - obj, _, err := yamlSerializer.NewDecodingSerializer(unstructured.UnstructuredJSONScheme).Decode(rawObj.Raw, nil, nil) - if err != nil { - return nil, err - } - - unstructuredMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(obj) - if err != nil { - return nil, err - } - - objs = append(objs, &unstructured.Unstructured{Object: unstructuredMap}) - } - - return objs, nil //nolint:nilerr -} - -// DoCSVWait waits until for a CSV to be applied. -func (c Client) DoCSVWait(ctx context.Context, key types.NamespacedName) error { - var ( - curPhase v1alpha1.ClusterServiceVersionPhase - newPhase v1alpha1.ClusterServiceVersionPhase - ) - - kubeclient, err := c.getKubeclient() - if err != nil { - return err - } - - csv := v1alpha1.ClusterServiceVersion{} - csvPhaseSucceeded := func() (bool, error) { - err := kubeclient.Get(ctx, key, &csv) - if err != nil { - if apierrors.IsNotFound(err) { - return false, nil - } - return false, err - } - newPhase = csv.Status.Phase - if newPhase != curPhase { - curPhase = newPhase - } - - switch curPhase { - case v1alpha1.CSVPhaseFailed: - return false, fmt.Errorf("csv failed: reason: %q, message: %q", csv.Status.Reason, csv.Status.Message) - case v1alpha1.CSVPhaseSucceeded: - return true, nil - default: - return false, nil - } - } - - err = wait.PollImmediateUntil(time.Second, csvPhaseSucceeded, ctx.Done()) - if err != nil && errors.Is(err, context.DeadlineExceeded) { - depCheckErr := c.checkDeploymentErrors(ctx, key, csv) - if depCheckErr != nil { - return depCheckErr - } - } - return err -} - -// GetSubscriptionCSV retrieves a subscription CSV. -func (c Client) GetSubscriptionCSV(ctx context.Context, subKey types.NamespacedName) (types.NamespacedName, error) { - var csvKey types.NamespacedName - - kubeclient, err := c.getKubeclient() - if err != nil { - return csvKey, err - } - - subscriptionInstalledCSV := func() (bool, error) { - sub := v1alpha1.Subscription{} - err := kubeclient.Get(ctx, subKey, &sub) - if err != nil { - return false, err - } - installedCSV := sub.Status.InstalledCSV - if installedCSV == "" { - return false, nil - } - csvKey = types.NamespacedName{ - Namespace: subKey.Namespace, - Name: installedCSV, - } - log.Printf(" Found installed CSV %q", installedCSV) - return true, nil - } - return csvKey, wait.PollImmediateUntil(time.Second, subscriptionInstalledCSV, ctx.Done()) -} - -func (c *Client) getKubeclient() (client.Client, error) { //nolint:ireturn - rm, err := apiutil.NewDynamicRESTMapper(c.restConfig) - if err != nil { - return nil, errors.Wrap(err, "failed to create dynamic rest mapper") - } - - cl, err := client.New(c.restConfig, client.Options{ - Scheme: scheme.Scheme, - Mapper: rm, - }) - if err != nil { - return nil, errors.Wrap(err, "failed to create client") - } - return cl, nil -} - -// checkDeploymentErrors function loops through deployment specs of a given CSV, and prints reason -// in case of failures, based on deployment condition. -func (c Client) checkDeploymentErrors(ctx context.Context, key types.NamespacedName, csv v1alpha1.ClusterServiceVersion) error { - depErrs := deploymentErrors{} - if key.Namespace == "" { - return fmt.Errorf("no namespace provided to get deployment failures") - } - - kubeclient, err := c.getKubeclient() - if err != nil { - return err - } - - dep := &appsv1.Deployment{} - for _, ds := range csv.Spec.InstallStrategy.StrategySpec.DeploymentSpecs { - depKey := types.NamespacedName{ - Namespace: key.Namespace, - Name: ds.Name, - } - depSelectors := ds.Spec.Selector - if err := kubeclient.Get(ctx, depKey, dep); err != nil { - depErrs = append(depErrs, deploymentError{ - resourceError: resourceError{ - name: ds.Name, - issue: err.Error(), - }, - }) - continue - } - for _, s := range dep.Status.Conditions { - if s.Type == appsv1.DeploymentAvailable && s.Status != corev1.ConditionTrue { - depErr := deploymentError{ - resourceError: resourceError{ - name: ds.Name, - issue: s.Reason, - }, - } - podErr := c.checkPodErrors(ctx, kubeclient, depSelectors, key) - podErrs := podErrors{} - if errors.As(podErr, &podErrs) { - depErr.podErrs = append(depErr.podErrs, podErrs...) - } else { - return podErr - } - depErrs = append(depErrs, depErr) - } - } - } - - return depErrs -} - -// checkPodErrors loops through pods, and returns pod errors if any. -func (c Client) checkPodErrors(ctx context.Context, kubeclient client.Client, depSelectors *metav1.LabelSelector, key types.NamespacedName) error { - // loop through pods and return specific error message. - podErr := podErrors{} - podList := &corev1.PodList{} - podLabelSelectors, err := metav1.LabelSelectorAsSelector(depSelectors) - if err != nil { - return err - } - - options := client.ListOptions{ - LabelSelector: podLabelSelectors, - Namespace: key.Namespace, - } - - if err := kubeclient.List(ctx, podList, &options); err != nil { - return errors.Wrap(err, "error getting Pods") - } - - for _, p := range podList.Items { - for _, cs := range p.Status.ContainerStatuses { - if !cs.Ready { - if cs.State.Waiting != nil { - containerName := p.Name + ":" + cs.Name - podErr = append(podErr, podError{resourceError{name: containerName, issue: cs.State.Waiting.Message}}) - } - } - } - } - - return podErr -} - -// DoRolloutWait waits until a deployment has been rolled out susccessfully or there is an error. -func (c Client) DoRolloutWait(ctx context.Context, key types.NamespacedName) error { - kubeclient, err := c.getKubeclient() - if err != nil { - return err - } - - rolloutComplete := func() (bool, error) { - deployment := appsv1.Deployment{} - err := kubeclient.Get(ctx, key, &deployment) - if err != nil { - if apierrors.IsNotFound(err) { - // Waiting for Deployment to appear - return false, nil - } - return false, err - } - if deployment.Generation <= deployment.Status.ObservedGeneration { - cond := deploymentutil.GetDeploymentCondition(deployment.Status, appsv1.DeploymentProgressing) - if cond != nil && cond.Reason == deploymentutil.TimedOutReason { - return false, errors.New("progress deadline exceeded") - } - if deployment.Spec.Replicas != nil && deployment.Status.UpdatedReplicas < *deployment.Spec.Replicas { - // Waiting for Deployment to rollout. Not all replicas have been updated - return false, nil - } - if deployment.Status.Replicas > deployment.Status.UpdatedReplicas { - // Waiting for Deployment to rollout. Old replicas are pending termination - return false, nil - } - if deployment.Status.AvailableReplicas < deployment.Status.UpdatedReplicas { - // Waiting for Deployment to rollout. Not all updated replicas are available - return false, nil - } - // Deployment successfully rolled out - return true, nil - } - // Waiting for Deployment to rollout: waiting for deployment spec update to be observed - return false, nil - } - return wait.PollImmediateUntil(time.Second, rolloutComplete, ctx.Done()) -} - -// GetOperatorGroup retrieves an operator group details by namespace and name. -func (c *Client) GetOperatorGroup(ctx context.Context, namespace, name string) (*v1.OperatorGroup, error) { - operatorClient, err := versioned.NewForConfig(c.restConfig) - if err != nil { - return nil, errors.Wrap(err, "cannot create an operator client instance") - } - - if namespace == "" { - namespace = c.namespace - } - - return operatorClient.OperatorsV1().OperatorGroups(namespace).Get(ctx, name, metav1.GetOptions{}) -} - -// CreateOperatorGroup creates an operator group to be used as part of a subscription. -func (c *Client) CreateOperatorGroup(ctx context.Context, namespace, name string) (*v1.OperatorGroup, error) { - operatorClient, err := versioned.NewForConfig(c.restConfig) - if err != nil { - return nil, errors.Wrap(err, "cannot create an operator client instance") - } - - if namespace == "" { - namespace = c.namespace - } - og := &v1.OperatorGroup{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - }, - Spec: v1.OperatorGroupSpec{ - TargetNamespaces: []string{namespace}, - }, - Status: v1.OperatorGroupStatus{ - LastUpdated: &metav1.Time{ - Time: time.Now(), - }, - }, - } - - return operatorClient.OperatorsV1().OperatorGroups(namespace).Create(ctx, og, metav1.CreateOptions{}) -} - -// CreateSubscriptionForCatalog creates an OLM subscription. -func (c *Client) CreateSubscriptionForCatalog(ctx context.Context, namespace, name, catalogNamespace, catalog, - packageName, channel, startingCSV string, approval v1alpha1.Approval, -) (*v1alpha1.Subscription, error) { - operatorClient, err := versioned.NewForConfig(c.restConfig) - if err != nil { - return nil, errors.Wrap(err, "cannot create an operator client instance") - } - - subscription := &v1alpha1.Subscription{ - TypeMeta: metav1.TypeMeta{ - Kind: v1alpha1.SubscriptionKind, - APIVersion: v1alpha1.SubscriptionCRDAPIVersion, - }, - ObjectMeta: metav1.ObjectMeta{ - Namespace: namespace, - Name: name, - }, - Spec: &v1alpha1.SubscriptionSpec{ - CatalogSource: catalog, - CatalogSourceNamespace: catalogNamespace, - Package: packageName, - Channel: channel, - StartingCSV: startingCSV, - InstallPlanApproval: approval, - }, - } - - sub, err := operatorClient.OperatorsV1alpha1().Subscriptions(namespace).Create(ctx, subscription, metav1.CreateOptions{}) - if err != nil { - if apierrors.IsAlreadyExists(err) { - return sub, nil - } - return sub, err - } - return sub, nil -} - -// GetSubscription retrieves an OLM subscription by namespace and name. -func (c *Client) GetSubscription(ctx context.Context, namespace, name string) (*v1alpha1.Subscription, error) { - c.rcLock.Lock() - defer c.rcLock.Unlock() - - operatorClient, err := versioned.NewForConfig(c.restConfig) - if err != nil { - return nil, errors.Wrap(err, "cannot create an operator client instance") - } - - return operatorClient.OperatorsV1alpha1().Subscriptions(namespace).Get(ctx, name, metav1.GetOptions{}) -} - -// ListSubscriptions all the subscriptions in the namespace. -func (c *Client) ListSubscriptions(ctx context.Context, namespace string) (*v1alpha1.SubscriptionList, error) { - c.rcLock.Lock() - defer c.rcLock.Unlock() - - operatorClient, err := versioned.NewForConfig(c.restConfig) - if err != nil { - return nil, errors.Wrap(err, "cannot create an operator client instance") - } - - return operatorClient.OperatorsV1alpha1().Subscriptions(namespace).List(ctx, metav1.ListOptions{}) -} - -// GetInstallPlan retrieves an OLM install plan by namespace and name. -func (c *Client) GetInstallPlan(ctx context.Context, namespace string, name string) (*v1alpha1.InstallPlan, error) { - c.rcLock.Lock() - defer c.rcLock.Unlock() - - operatorClient, err := versioned.NewForConfig(c.restConfig) - if err != nil { - return nil, errors.Wrap(err, "cannot create an operator client instance") - } - - return operatorClient.OperatorsV1alpha1().InstallPlans(namespace).Get(ctx, name, metav1.GetOptions{}) -} - -// UpdateInstallPlan updates the existing install plan in the specified namespace. -func (c *Client) UpdateInstallPlan(ctx context.Context, namespace string, installPlan *v1alpha1.InstallPlan) (*v1alpha1.InstallPlan, error) { - c.rcLock.Lock() - defer c.rcLock.Unlock() - - operatorClient, err := versioned.NewForConfig(c.restConfig) - if err != nil { - return nil, errors.Wrap(err, "cannot create an operator client instance") - } - - return operatorClient.OperatorsV1alpha1().InstallPlans(namespace).Update(ctx, installPlan, metav1.UpdateOptions{}) -} - -// ListCRDs returns a list of CRDs. -func (c *Client) ListCRDs(ctx context.Context, labelSelector *metav1.LabelSelector) (*apiextv1.CustomResourceDefinitionList, error) { - options := metav1.ListOptions{} - if labelSelector != nil && (labelSelector.MatchLabels != nil || labelSelector.MatchExpressions != nil) { - options.LabelSelector = metav1.FormatLabelSelector(labelSelector) - } - - return c.apiextClientset.ApiextensionsV1().CustomResourceDefinitions().List(ctx, options) -} - -// ListCRs returns a list of CRs. -func (c *Client) ListCRs( - ctx context.Context, - namespace string, - gvr schema.GroupVersionResource, - labelSelector *metav1.LabelSelector, -) (*unstructured.UnstructuredList, error) { - options := metav1.ListOptions{} - if labelSelector != nil && (labelSelector.MatchLabels != nil || labelSelector.MatchExpressions != nil) { - options.LabelSelector = metav1.FormatLabelSelector(labelSelector) - } - - return c.dynamicClientset.Resource(gvr).Namespace(namespace).List(ctx, options) -} diff --git a/managed/services/dbaas/kubernetes/client/client_test.go b/managed/services/dbaas/kubernetes/client/client_test.go deleted file mode 100644 index 6bcdcf0e62..0000000000 --- a/managed/services/dbaas/kubernetes/client/client_test.go +++ /dev/null @@ -1,631 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package client - -import ( - "context" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - corev1 "k8s.io/api/core/v1" - apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - apiextv1clientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - apiextfake "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/version" - "k8s.io/client-go/dynamic" - dynamicfake "k8s.io/client-go/dynamic/fake" - "k8s.io/client-go/kubernetes" - fake "k8s.io/client-go/kubernetes/fake" -) - -func TestGetSecretsForServiceAccount(t *testing.T) { - clientset := fake.NewSimpleClientset( - &corev1.ServiceAccount{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pmm-service-account", - Namespace: "default", - }, - Secrets: []corev1.ObjectReference{ - { - Name: "pmm-service-account-token", - }, - { - Name: "pmm-service-account-token-ktgqd", - }, - }, - }, - &corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pmm-service-account-token", - Namespace: "default", - }, - }, - &corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pmm-service-account-token-ktgqd", - Namespace: "default", - }, - }) - client := &Client{clientset: clientset, restConfig: nil, namespace: "default"} - - ctx := context.Background() - secret, err := client.GetSecretsForServiceAccount(ctx, "pmm-service-account") - assert.NotNil(t, secret, "secret is nil") - assert.NoError(t, err) -} - -func TestGetSecretsForServiceAccountNoSecrets(t *testing.T) { - clientset := fake.NewSimpleClientset( - &corev1.ServiceAccount{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pmm-service-account", - Namespace: "default", - }, - }) - client := &Client{clientset: clientset, restConfig: nil, namespace: "default"} - - ctx := context.Background() - secret, err := client.GetSecretsForServiceAccount(ctx, "pmm-service-account") - assert.Nil(t, secret, "secret is not nil") - assert.Error(t, err) -} - -func TestGetServerVersion(t *testing.T) { - clientset := fake.NewSimpleClientset() - client := &Client{clientset: clientset, namespace: "default"} - ver, err := client.GetServerVersion() - expectedVersion := &version.Info{} - require.NoError(t, err) - assert.Equal(t, expectedVersion.Minor, ver.Minor) -} - -func TestGetPods(t *testing.T) { - t.Parallel() - - data := []struct { - clientset kubernetes.Interface - countExpectedPods int - inputNamespace string - err error - }{ - // there are no pods in the specified namespace - { - clientset: fake.NewSimpleClientset(&corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "awesome-pod", - Namespace: "my-safe-space", - }, - Status: corev1.PodStatus{ - Phase: corev1.PodRunning, - }, - }, &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cool-pod", - Namespace: "get-me-outta-here", - }, - }), - inputNamespace: "default", - countExpectedPods: 0, - }, - // there is a pod in the specified namespace - { - clientset: fake.NewSimpleClientset(&corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pmm-0", - Namespace: "default", - }, - Status: corev1.PodStatus{ - Phase: corev1.PodRunning, - }, - }, &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cool-pod", - Namespace: "get-me-outta-here", - }, - }), - inputNamespace: "default", - countExpectedPods: 1, - }, - } - - for _, test := range data { - t.Run("", func(test struct { - clientset kubernetes.Interface - countExpectedPods int - inputNamespace string - err error - }, - ) func(t *testing.T) { - return func(t *testing.T) { - clientset := test.clientset - client := &Client{clientset: clientset, namespace: "default"} - - pods, err := client.GetPods(context.Background(), test.inputNamespace, nil) - if test.err == nil { - assert.NoError(t, err) - assert.Equal(t, test.countExpectedPods, len(pods.Items)) - } else { - assert.Error(t, err) - assert.Equal(t, test.err, err) - } - } - }(test)) - } -} - -func TestListCRDs(t *testing.T) { - t.Parallel() - - data := []struct { - clientset apiextv1clientset.Interface - inputLabelSelector *metav1.LabelSelector - countExpectedCRDs int - err error - }{ - // no label selector - { - clientset: apiextfake.NewSimpleClientset(&apiextv1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "awesome-crd", - Labels: map[string]string{ - "custom_label_key_1": "custom_label_value_1", - }, - }, - }, &apiextv1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cool-crd", - Labels: map[string]string{ - "custom_label_key_2": "custom_label_value_2", - }, - }, - }), - inputLabelSelector: nil, - countExpectedCRDs: 2, - }, - // one CRD matches label selector - { - clientset: apiextfake.NewSimpleClientset(&apiextv1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "awesome-crd", - Labels: map[string]string{ - "custom_label_key_1": "custom_label_value_1", - }, - }, - }, &apiextv1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cool-crd", - Labels: map[string]string{ - "custom_label_key_2": "custom_label_value_2", - }, - }, - }), - inputLabelSelector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "custom_label_key_1": "custom_label_value_1", - }, - }, - countExpectedCRDs: 1, - }, - // two CRDs match label selector - { - clientset: apiextfake.NewSimpleClientset(&apiextv1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "awesome-crd", - Labels: map[string]string{ - "custom_label_key_1": "custom_label_value_1", - }, - }, - }, &apiextv1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cool-crd", - Labels: map[string]string{ - "custom_label_key_1": "custom_label_value_1", - "custom_label_key_2": "custom_label_value_2", - }, - }, - }, &apiextv1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "another-crd", - Labels: map[string]string{ - "custom_label_key_3": "custom_label_value_1", - }, - }, - }), - inputLabelSelector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "custom_label_key_1": "custom_label_value_1", - }, - }, - countExpectedCRDs: 2, - }, - // one CRD matches label selector with multiple labels - { - clientset: apiextfake.NewSimpleClientset(&apiextv1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "awesome-crd", - Labels: map[string]string{ - "custom_label_key_1": "custom_label_value_1", - }, - }, - }, &apiextv1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cool-crd", - Labels: map[string]string{ - "custom_label_key_1": "custom_label_value_1", - "custom_label_key_2": "custom_label_value_2", - }, - }, - }, &apiextv1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{ - Name: "another-crd", - Labels: map[string]string{ - "custom_label_key_3": "custom_label_value_1", - }, - }, - }), - inputLabelSelector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "custom_label_key_1": "custom_label_value_1", - "custom_label_key_2": "custom_label_value_2", - }, - }, - countExpectedCRDs: 1, - }, - } - - for _, test := range data { - t.Run("", func(test struct { - clientset apiextv1clientset.Interface - inputLabelSelector *metav1.LabelSelector - countExpectedCRDs int - err error - }, - ) func(t *testing.T) { - return func(t *testing.T) { - clientset := test.clientset - client := &Client{apiextClientset: clientset, namespace: "default"} - - crds, err := client.ListCRDs(context.Background(), test.inputLabelSelector) - if test.err == nil { - assert.NoError(t, err) - assert.Equal(t, test.countExpectedCRDs, len(crds.Items)) - } else { - assert.Error(t, err) - assert.Equal(t, test.err, err) - } - } - }(test)) - } -} - -func TestListCRs(t *testing.T) { - t.Parallel() - - data := []struct { - clientset dynamic.Interface - inputNamespace string - inputGVR schema.GroupVersionResource - inputLabelSelector *metav1.LabelSelector - countExpectedCRs int - err error - }{ - // one CR matches namespace - { - clientset: dynamicfake.NewSimpleDynamicClientWithCustomListKinds(runtime.NewScheme(), - map[schema.GroupVersionResource]string{ - {Group: "dbaas.percona.com", Version: "v1", Resource: "mycoolkinds"}: "MyCoolKindList", - }, &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "dbaas.percona.com/v1", - "kind": "MyCoolKind", - "metadata": map[string]interface{}{ - "name": "awesome-cr", - "namespace": "my-safe-space", - "labels": map[string]interface{}{ - "custom_label_key_1": "custom_label_value_1", - }, - }, - }, - }, &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "dbaas.percona.com/v1", - "kind": "MyCoolKind", - "metadata": map[string]interface{}{ - "name": "another-cr", - "namespace": "get-me-outta-here", - "labels": map[string]interface{}{ - "custom_label_key_1": "custom_label_value_1", - }, - }, - }, - }), - inputNamespace: "my-safe-space", - inputGVR: schema.GroupVersionResource{ - Group: "dbaas.percona.com", - Version: "v1", - Resource: "mycoolkinds", - }, - inputLabelSelector: nil, - countExpectedCRs: 1, - }, - // one CR matches GVR - { - clientset: dynamicfake.NewSimpleDynamicClientWithCustomListKinds(runtime.NewScheme(), - map[schema.GroupVersionResource]string{ - {Group: "dbaas.percona.com", Version: "v1", Resource: "mycoolkinds"}: "MyCoolKindList", - {Group: "dbaas.percona.com", Version: "v1", Resource: "othercoolkinds"}: "OtherKindList", - }, &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "dbaas.percona.com/v1", - "kind": "MyCoolKind", - "metadata": map[string]interface{}{ - "name": "awesome-cr", - "namespace": "my-safe-space", - "labels": map[string]interface{}{ - "custom_label_key_1": "custom_label_value_1", - }, - }, - }, - }, &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "dbaas.percona.com/v1", - "kind": "OtherKind", - "metadata": map[string]interface{}{ - "name": "another-cr", - "namespace": "my-safe-space", - "labels": map[string]interface{}{ - "custom_label_key_1": "custom_label_value_1", - }, - }, - }, - }), - inputNamespace: "my-safe-space", - inputGVR: schema.GroupVersionResource{ - Group: "dbaas.percona.com", - Version: "v1", - Resource: "mycoolkinds", - }, - inputLabelSelector: nil, - countExpectedCRs: 1, - }, - // no label selector - { - clientset: dynamicfake.NewSimpleDynamicClientWithCustomListKinds(runtime.NewScheme(), - map[schema.GroupVersionResource]string{ - {Group: "dbaas.percona.com", Version: "v1", Resource: "mycoolkinds"}: "MyCoolKindList", - }, &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "dbaas.percona.com/v1", - "kind": "MyCoolKind", - "metadata": map[string]interface{}{ - "name": "awesome-cr", - "namespace": "my-safe-space", - "labels": map[string]interface{}{ - "custom_label_key_1": "custom_label_value_1", - }, - }, - }, - }, &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "dbaas.percona.com/v1", - "kind": "MyCoolKind", - "metadata": map[string]interface{}{ - "name": "cool-cr", - "namespace": "my-safe-space", - "labels": map[string]interface{}{ - "custom_label_key_2": "custom_label_value_2", - }, - }, - }, - }), - inputNamespace: "my-safe-space", - inputGVR: schema.GroupVersionResource{ - Group: "dbaas.percona.com", - Version: "v1", - Resource: "mycoolkinds", - }, - inputLabelSelector: nil, - countExpectedCRs: 2, - }, - // one CR matches label selector - { - clientset: dynamicfake.NewSimpleDynamicClientWithCustomListKinds(runtime.NewScheme(), - map[schema.GroupVersionResource]string{ - {Group: "dbaas.percona.com", Version: "v1", Resource: "mycoolkinds"}: "MyCoolKindList", - }, &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "dbaas.percona.com/v1", - "kind": "MyCoolKind", - "metadata": map[string]interface{}{ - "name": "awesome-cr", - "namespace": "my-safe-space", - "labels": map[string]interface{}{ - "custom_label_key_1": "custom_label_value_1", - }, - }, - }, - }, &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "dbaas.percona.com/v1", - "kind": "MyCoolKind", - "metadata": map[string]interface{}{ - "name": "cool-cr", - "namespace": "my-safe-space", - "labels": map[string]interface{}{ - "custom_label_key_2": "custom_label_value_2", - }, - }, - }, - }), - inputNamespace: "my-safe-space", - inputGVR: schema.GroupVersionResource{ - Group: "dbaas.percona.com", - Version: "v1", - Resource: "mycoolkinds", - }, - inputLabelSelector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "custom_label_key_1": "custom_label_value_1", - }, - }, - countExpectedCRs: 1, - }, - // two CRs match label selector - { - clientset: dynamicfake.NewSimpleDynamicClientWithCustomListKinds(runtime.NewScheme(), - map[schema.GroupVersionResource]string{ - {Group: "dbaas.percona.com", Version: "v1", Resource: "mycoolkinds"}: "MyCoolKindList", - }, &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "dbaas.percona.com/v1", - "kind": "MyCoolKind", - "metadata": map[string]interface{}{ - "name": "awesome-cr", - "namespace": "my-safe-space", - "labels": map[string]interface{}{ - "custom_label_key_1": "custom_label_value_1", - }, - }, - }, - }, &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "dbaas.percona.com/v1", - "kind": "MyCoolKind", - "metadata": map[string]interface{}{ - "name": "cool-cr", - "namespace": "my-safe-space", - "labels": map[string]interface{}{ - "custom_label_key_1": "custom_label_value_1", - "custom_label_key_2": "custom_label_value_2", - }, - }, - }, - }, &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "dbaas.percona.com/v1", - "kind": "MyCoolKind", - "metadata": map[string]interface{}{ - "name": "another-cr", - "namespace": "my-safe-space", - "labels": map[string]interface{}{ - "custom_label_key_3": "custom_label_value_1", - }, - }, - }, - }), - inputNamespace: "my-safe-space", - inputGVR: schema.GroupVersionResource{ - Group: "dbaas.percona.com", - Version: "v1", - Resource: "mycoolkinds", - }, - inputLabelSelector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "custom_label_key_1": "custom_label_value_1", - }, - }, - countExpectedCRs: 2, - }, - // one CR matches label selector with multiple labels - { - clientset: dynamicfake.NewSimpleDynamicClientWithCustomListKinds(runtime.NewScheme(), - map[schema.GroupVersionResource]string{ - {Group: "dbaas.percona.com", Version: "v1", Resource: "mycoolkinds"}: "MyCoolKindList", - }, &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "dbaas.percona.com/v1", - "kind": "MyCoolKind", - "metadata": map[string]interface{}{ - "name": "awesome-cr", - "namespace": "my-safe-space", - "labels": map[string]interface{}{ - "custom_label_key_1": "custom_label_value_1", - }, - }, - }, - }, &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "dbaas.percona.com/v1", - "kind": "MyCoolKind", - "metadata": map[string]interface{}{ - "name": "cool-cr", - "namespace": "my-safe-space", - "labels": map[string]interface{}{ - "custom_label_key_1": "custom_label_value_1", - "custom_label_key_2": "custom_label_value_2", - }, - }, - }, - }, &unstructured.Unstructured{ - Object: map[string]interface{}{ - "apiVersion": "dbaas.percona.com/v1", - "kind": "MyCoolKind", - "metadata": map[string]interface{}{ - "name": "another-cr", - "namespace": "my-safe-space", - "labels": map[string]interface{}{ - "custom_label_key_3": "custom_label_value_1", - }, - }, - }, - }), - inputNamespace: "my-safe-space", - inputGVR: schema.GroupVersionResource{ - Group: "dbaas.percona.com", - Version: "v1", - Resource: "mycoolkinds", - }, - inputLabelSelector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "custom_label_key_1": "custom_label_value_1", - "custom_label_key_2": "custom_label_value_2", - }, - }, - countExpectedCRs: 1, - }, - } - - for _, test := range data { - t.Run("", func(test struct { - clientset dynamic.Interface - inputNamespace string - inputGVR schema.GroupVersionResource - inputLabelSelector *metav1.LabelSelector - countExpectedCRs int - err error - }, - ) func(t *testing.T) { - return func(t *testing.T) { - clientset := test.clientset - client := &Client{dynamicClientset: clientset, namespace: "default"} - - crds, err := client.ListCRs(context.Background(), test.inputNamespace, test.inputGVR, test.inputLabelSelector) - if test.err == nil { - assert.NoError(t, err) - assert.Equal(t, test.countExpectedCRs, len(crds.Items)) - } else { - assert.Error(t, err) - assert.Equal(t, test.err, err) - } - } - }(test)) - } -} diff --git a/managed/services/dbaas/kubernetes/client/ctl.go b/managed/services/dbaas/kubernetes/client/ctl.go deleted file mode 100644 index a3081c35bb..0000000000 --- a/managed/services/dbaas/kubernetes/client/ctl.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package client - -type ( - // Cluster contains information about how to communicate with a kubernetes cluster. - Cluster struct { - CertificateAuthorityData []byte `json:"certificate-authority-data"` - Server string `json:"server"` - } - // ClusterInfo is a struct used to parse Cluster config from kubeconfig. - ClusterInfo struct { - Name string `json:"name"` - Cluster Cluster `json:"cluster"` - } - // User contains information that describes identity information. This is use to tell the kubernetes cluster who you are. - User struct { - Token string `json:"token"` - } - // UserInfo is a struct used to parse User config from kubeconfig. - UserInfo struct { - Name string `json:"name"` - User User `json:"user"` - } - // Context is a tuple of references to a cluster (how do I communicate with a kubernetes cluster), - // a user (how do I identify myself), and a namespace (what subset of resources do I want to work with). - Context struct { - Cluster string `json:"cluster"` - User string `json:"user"` - Namespace string `json:"namespace"` - } - // ContextInfo is a struct used to parse Context config from kubeconfig. - ContextInfo struct { - Name string `json:"name"` - Context Context `json:"context"` - } - // Config holds the information needed to build connect to remote kubernetes clusters as a given user. - Config struct { - // Legacy field from pkg/api/types.go TypeMeta. - Kind string `json:"kind,omitempty"` - // Legacy field from pkg/api/types.go TypeMeta. - APIVersion string `json:"apiVersion,omitempty"` - // Preferences holds general information to be use for cli interactions - Clusters []ClusterInfo `json:"clusters"` - // AuthInfos is a map of referencable names to user configs - Users []UserInfo `json:"users"` - // Contexts is a map of referencable names to context configs - Contexts []ContextInfo `json:"contexts"` - // CurrentContext is the name of the context that you would like to use by default - CurrentContext string `json:"current-context"` - } -) diff --git a/managed/services/dbaas/kubernetes/client/database/database.go b/managed/services/dbaas/kubernetes/client/database/database.go deleted file mode 100644 index b332f0f1e9..0000000000 --- a/managed/services/dbaas/kubernetes/client/database/database.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -// Package database TODO. -package database - -import ( - "context" - "sync" - - dbaasv1 "github.com/percona/dbaas-operator/api/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" -) - -const ( - DBClusterKind = "DatabaseCluster" - apiKind = "databaseclusters" -) - -type DatabaseClusterClientInterface interface { - DBClusters(namespace string) DatabaseClusterInterface -} - -type DatabaseClusterClient struct { - restClient rest.Interface -} - -var addToScheme sync.Once - -func NewForConfig(c *rest.Config) (*DatabaseClusterClient, error) { - config := *c - config.ContentConfig.GroupVersion = &dbaasv1.GroupVersion - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - config.UserAgent = rest.DefaultKubernetesUserAgent() - - addToScheme.Do(func() { - dbaasv1.SchemeBuilder.AddToScheme(scheme.Scheme) - metav1.AddToGroupVersion(scheme.Scheme, dbaasv1.GroupVersion) - }) - - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - - return &DatabaseClusterClient{restClient: client}, nil -} - -func (c *DatabaseClusterClient) DBClusters(namespace string) DatabaseClusterInterface { //nolint:ireturn - return &dbClusterClient{ - restClient: c.restClient, - namespace: namespace, - } -} - -type DatabaseClusterInterface interface { - List(ctx context.Context, opts metav1.ListOptions) (*dbaasv1.DatabaseClusterList, error) - Get(ctx context.Context, name string, options metav1.GetOptions) (*dbaasv1.DatabaseCluster, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) -} - -type dbClusterClient struct { - restClient rest.Interface - namespace string -} - -func (c *dbClusterClient) List(ctx context.Context, opts metav1.ListOptions) (*dbaasv1.DatabaseClusterList, error) { - result := &dbaasv1.DatabaseClusterList{} - err := c.restClient. - Get(). - Namespace(c.namespace). - Resource(apiKind). - VersionedParams(&opts, scheme.ParameterCodec). - Do(ctx). - Into(result) - return result, err -} - -func (c *dbClusterClient) Get(ctx context.Context, name string, opts metav1.GetOptions) (*dbaasv1.DatabaseCluster, error) { - result := &dbaasv1.DatabaseCluster{} - err := c.restClient. - Get(). - Namespace(c.namespace). - Resource(apiKind). - VersionedParams(&opts, scheme.ParameterCodec). - Name(name). - Do(ctx). - Into(result) - return result, err -} - -func (c *dbClusterClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { //nolint:ireturn - opts.Watch = true - return c.restClient. - Get(). - Namespace(c.namespace). - Resource(apiKind). - VersionedParams(&opts, scheme.ParameterCodec). - Watch(ctx) -} diff --git a/managed/services/dbaas/kubernetes/client/gen.go b/managed/services/dbaas/kubernetes/client/gen.go deleted file mode 100644 index 1b9eddf585..0000000000 --- a/managed/services/dbaas/kubernetes/client/gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package client - -//go:generate ../../../../../bin/ifacemaker -f client.go -s Client -i KubeClientConnector -p client -o kubeclient_interface.go -//go:generate ../../../../../bin/mockery --name=KubeClientConnector --case=snake --inpackage diff --git a/managed/services/dbaas/kubernetes/client/kubeclient_interface.go b/managed/services/dbaas/kubernetes/client/kubeclient_interface.go deleted file mode 100644 index 4a258117c6..0000000000 --- a/managed/services/dbaas/kubernetes/client/kubeclient_interface.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by ifacemaker; DO NOT EDIT. - -package client - -import ( - "context" - - v1 "github.com/operator-framework/api/pkg/operators/v1" - "github.com/operator-framework/api/pkg/operators/v1alpha1" - dbaasv1 "github.com/percona/dbaas-operator/api/v1" - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - storagev1 "k8s.io/api/storage/v1" - apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/version" - _ "k8s.io/client-go/plugin/pkg/client/auth" -) - -// KubeClientConnector ... -type KubeClientConnector interface { - // GetSecretsForServiceAccount returns secret by given service account name. - GetSecretsForServiceAccount(ctx context.Context, accountName string) (*corev1.Secret, error) - // GenerateKubeConfig generates kubeconfig. - GenerateKubeConfig(secret *corev1.Secret) ([]byte, error) - // GetServerVersion returns server version. - GetServerVersion() (*version.Info, error) - // ListDatabaseClusters returns list of managed PCX clusters. - ListDatabaseClusters(ctx context.Context) (*dbaasv1.DatabaseClusterList, error) - // GetDatabaseCluster returns PXC clusters by provided name. - GetDatabaseCluster(ctx context.Context, name string) (*dbaasv1.DatabaseCluster, error) - // GetStorageClasses returns all storage classes available in the cluster. - GetStorageClasses(ctx context.Context) (*storagev1.StorageClassList, error) - // GetDeployment returns deployment by name. - GetDeployment(ctx context.Context, name string) (*appsv1.Deployment, error) - // GetSecret returns secret by name. - GetSecret(ctx context.Context, name string) (*corev1.Secret, error) - // ListSecrets returns secrets. - ListSecrets(ctx context.Context) (*corev1.SecretList, error) - // DeleteObject deletes object from the k8s cluster. - DeleteObject(obj runtime.Object) error - ApplyObject(obj runtime.Object) error - // GetPersistentVolumes returns Persistent Volumes available in the cluster. - GetPersistentVolumes(ctx context.Context) (*corev1.PersistentVolumeList, error) - // GetPods returns list of pods. - GetPods(ctx context.Context, namespace string, labelSelector *metav1.LabelSelector) (*corev1.PodList, error) - // GetNodes returns list of nodes. - GetNodes(ctx context.Context) (*corev1.NodeList, error) - // GetLogs returns logs for pod. - GetLogs(ctx context.Context, pod, container string) (string, error) - GetEvents(ctx context.Context, name string) (string, error) - // ApplyFile accepts manifest file contents, parses into []runtime.Object - // and applies them against the cluster. - ApplyFile(fileBytes []byte) error - // DoCSVWait waits until for a CSV to be applied. - DoCSVWait(ctx context.Context, key types.NamespacedName) error - // GetSubscriptionCSV retrieves a subscription CSV. - GetSubscriptionCSV(ctx context.Context, subKey types.NamespacedName) (types.NamespacedName, error) - // DoRolloutWait waits until a deployment has been rolled out susccessfully or there is an error. - DoRolloutWait(ctx context.Context, key types.NamespacedName) error - // GetOperatorGroup retrieves an operator group details by namespace and name. - GetOperatorGroup(ctx context.Context, namespace, name string) (*v1.OperatorGroup, error) - // CreateOperatorGroup creates an operator group to be used as part of a subscription. - CreateOperatorGroup(ctx context.Context, namespace, name string) (*v1.OperatorGroup, error) - // CreateSubscriptionForCatalog creates an OLM subscription. - CreateSubscriptionForCatalog(ctx context.Context, namespace, name, catalogNamespace, catalog, packageName, channel, startingCSV string, approval v1alpha1.Approval) (*v1alpha1.Subscription, error) - // GetSubscription retrieves an OLM subscription by namespace and name. - GetSubscription(ctx context.Context, namespace, name string) (*v1alpha1.Subscription, error) - // ListSubscriptions all the subscriptions in the namespace. - ListSubscriptions(ctx context.Context, namespace string) (*v1alpha1.SubscriptionList, error) - // GetInstallPlan retrieves an OLM install plan by namespace and name. - GetInstallPlan(ctx context.Context, namespace string, name string) (*v1alpha1.InstallPlan, error) - // UpdateInstallPlan updates the existing install plan in the specified namespace. - UpdateInstallPlan(ctx context.Context, namespace string, installPlan *v1alpha1.InstallPlan) (*v1alpha1.InstallPlan, error) - // ListCRDs returns a list of CRDs. - ListCRDs(ctx context.Context, labelSelector *metav1.LabelSelector) (*apiextv1.CustomResourceDefinitionList, error) - // ListCRs returns a list of CRs. - ListCRs(ctx context.Context, namespace string, gvr schema.GroupVersionResource, labelSelector *metav1.LabelSelector) (*unstructured.UnstructuredList, error) -} diff --git a/managed/services/dbaas/kubernetes/client/load_config.go b/managed/services/dbaas/kubernetes/client/load_config.go deleted file mode 100644 index ec8cffa41c..0000000000 --- a/managed/services/dbaas/kubernetes/client/load_config.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package client - -import ( - "k8s.io/client-go/tools/clientcmd" - clientcmdapi "k8s.io/client-go/tools/clientcmd/api" -) - -// configGetter stores kubeconfig string to convert it to the final object -type configGetter struct { - kubeconfig string -} - -// NewConfigGetter creates a new configGetter struct -func NewConfigGetter(kubeconfig string) *configGetter { - return &configGetter{kubeconfig: kubeconfig} -} - -// loadFromString takes a kubeconfig and deserializes the contents into Config object. -func (g *configGetter) loadFromString() (*clientcmdapi.Config, error) { - config, err := clientcmd.Load([]byte(g.kubeconfig)) - if err != nil { - return nil, err - } - - if config.AuthInfos == nil { - config.AuthInfos = make(map[string]*clientcmdapi.AuthInfo) - } - if config.Clusters == nil { - config.Clusters = make(map[string]*clientcmdapi.Cluster) - } - if config.Contexts == nil { - config.Contexts = make(map[string]*clientcmdapi.Context) - } - - return config, nil -} diff --git a/managed/services/dbaas/kubernetes/client/mock_kube_client_connector.go b/managed/services/dbaas/kubernetes/client/mock_kube_client_connector.go deleted file mode 100644 index 1a84ff20de..0000000000 --- a/managed/services/dbaas/kubernetes/client/mock_kube_client_connector.go +++ /dev/null @@ -1,730 +0,0 @@ -// Code generated by mockery v2.33.0. DO NOT EDIT. - -package client - -import ( - context "context" - - v1 "github.com/operator-framework/api/pkg/operators/v1" - v1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" - apiv1 "github.com/percona/dbaas-operator/api/v1" - mock "github.com/stretchr/testify/mock" - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - storagev1 "k8s.io/api/storage/v1" - apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - version "k8s.io/apimachinery/pkg/version" -) - -// MockKubeClientConnector is an autogenerated mock type for the KubeClientConnector type -type MockKubeClientConnector struct { - mock.Mock -} - -// ApplyFile provides a mock function with given fields: fileBytes -func (_m *MockKubeClientConnector) ApplyFile(fileBytes []byte) error { - ret := _m.Called(fileBytes) - - var r0 error - if rf, ok := ret.Get(0).(func([]byte) error); ok { - r0 = rf(fileBytes) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ApplyObject provides a mock function with given fields: obj -func (_m *MockKubeClientConnector) ApplyObject(obj runtime.Object) error { - ret := _m.Called(obj) - - var r0 error - if rf, ok := ret.Get(0).(func(runtime.Object) error); ok { - r0 = rf(obj) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// CreateOperatorGroup provides a mock function with given fields: ctx, namespace, name -func (_m *MockKubeClientConnector) CreateOperatorGroup(ctx context.Context, namespace string, name string) (*v1.OperatorGroup, error) { - ret := _m.Called(ctx, namespace, name) - - var r0 *v1.OperatorGroup - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (*v1.OperatorGroup, error)); ok { - return rf(ctx, namespace, name) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string) *v1.OperatorGroup); ok { - r0 = rf(ctx, namespace, name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.OperatorGroup) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, namespace, name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// CreateSubscriptionForCatalog provides a mock function with given fields: ctx, namespace, name, catalogNamespace, catalog, packageName, channel, startingCSV, approval -func (_m *MockKubeClientConnector) CreateSubscriptionForCatalog(ctx context.Context, namespace string, name string, catalogNamespace string, catalog string, packageName string, channel string, startingCSV string, approval v1alpha1.Approval) (*v1alpha1.Subscription, error) { - ret := _m.Called(ctx, namespace, name, catalogNamespace, catalog, packageName, channel, startingCSV, approval) - - var r0 *v1alpha1.Subscription - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, string, string, string, v1alpha1.Approval) (*v1alpha1.Subscription, error)); ok { - return rf(ctx, namespace, name, catalogNamespace, catalog, packageName, channel, startingCSV, approval) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, string, string, string, v1alpha1.Approval) *v1alpha1.Subscription); ok { - r0 = rf(ctx, namespace, name, catalogNamespace, catalog, packageName, channel, startingCSV, approval) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1alpha1.Subscription) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, string, string, string, v1alpha1.Approval) error); ok { - r1 = rf(ctx, namespace, name, catalogNamespace, catalog, packageName, channel, startingCSV, approval) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DeleteObject provides a mock function with given fields: obj -func (_m *MockKubeClientConnector) DeleteObject(obj runtime.Object) error { - ret := _m.Called(obj) - - var r0 error - if rf, ok := ret.Get(0).(func(runtime.Object) error); ok { - r0 = rf(obj) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// DoCSVWait provides a mock function with given fields: ctx, key -func (_m *MockKubeClientConnector) DoCSVWait(ctx context.Context, key types.NamespacedName) error { - ret := _m.Called(ctx, key) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, types.NamespacedName) error); ok { - r0 = rf(ctx, key) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// DoRolloutWait provides a mock function with given fields: ctx, key -func (_m *MockKubeClientConnector) DoRolloutWait(ctx context.Context, key types.NamespacedName) error { - ret := _m.Called(ctx, key) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, types.NamespacedName) error); ok { - r0 = rf(ctx, key) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// GenerateKubeConfig provides a mock function with given fields: secret -func (_m *MockKubeClientConnector) GenerateKubeConfig(secret *corev1.Secret) ([]byte, error) { - ret := _m.Called(secret) - - var r0 []byte - var r1 error - if rf, ok := ret.Get(0).(func(*corev1.Secret) ([]byte, error)); ok { - return rf(secret) - } - if rf, ok := ret.Get(0).(func(*corev1.Secret) []byte); ok { - r0 = rf(secret) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - if rf, ok := ret.Get(1).(func(*corev1.Secret) error); ok { - r1 = rf(secret) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetDatabaseCluster provides a mock function with given fields: ctx, name -func (_m *MockKubeClientConnector) GetDatabaseCluster(ctx context.Context, name string) (*apiv1.DatabaseCluster, error) { - ret := _m.Called(ctx, name) - - var r0 *apiv1.DatabaseCluster - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*apiv1.DatabaseCluster, error)); ok { - return rf(ctx, name) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *apiv1.DatabaseCluster); ok { - r0 = rf(ctx, name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.DatabaseCluster) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetDeployment provides a mock function with given fields: ctx, name -func (_m *MockKubeClientConnector) GetDeployment(ctx context.Context, name string) (*appsv1.Deployment, error) { - ret := _m.Called(ctx, name) - - var r0 *appsv1.Deployment - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*appsv1.Deployment, error)); ok { - return rf(ctx, name) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *appsv1.Deployment); ok { - r0 = rf(ctx, name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*appsv1.Deployment) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetEvents provides a mock function with given fields: ctx, name -func (_m *MockKubeClientConnector) GetEvents(ctx context.Context, name string) (string, error) { - ret := _m.Called(ctx, name) - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { - return rf(ctx, name) - } - if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { - r0 = rf(ctx, name) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetInstallPlan provides a mock function with given fields: ctx, namespace, name -func (_m *MockKubeClientConnector) GetInstallPlan(ctx context.Context, namespace string, name string) (*v1alpha1.InstallPlan, error) { - ret := _m.Called(ctx, namespace, name) - - var r0 *v1alpha1.InstallPlan - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (*v1alpha1.InstallPlan, error)); ok { - return rf(ctx, namespace, name) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string) *v1alpha1.InstallPlan); ok { - r0 = rf(ctx, namespace, name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1alpha1.InstallPlan) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, namespace, name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetLogs provides a mock function with given fields: ctx, pod, container -func (_m *MockKubeClientConnector) GetLogs(ctx context.Context, pod string, container string) (string, error) { - ret := _m.Called(ctx, pod, container) - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (string, error)); ok { - return rf(ctx, pod, container) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string) string); ok { - r0 = rf(ctx, pod, container) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, pod, container) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetNodes provides a mock function with given fields: ctx -func (_m *MockKubeClientConnector) GetNodes(ctx context.Context) (*corev1.NodeList, error) { - ret := _m.Called(ctx) - - var r0 *corev1.NodeList - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*corev1.NodeList, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *corev1.NodeList); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*corev1.NodeList) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetOperatorGroup provides a mock function with given fields: ctx, namespace, name -func (_m *MockKubeClientConnector) GetOperatorGroup(ctx context.Context, namespace string, name string) (*v1.OperatorGroup, error) { - ret := _m.Called(ctx, namespace, name) - - var r0 *v1.OperatorGroup - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (*v1.OperatorGroup, error)); ok { - return rf(ctx, namespace, name) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string) *v1.OperatorGroup); ok { - r0 = rf(ctx, namespace, name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.OperatorGroup) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, namespace, name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetPersistentVolumes provides a mock function with given fields: ctx -func (_m *MockKubeClientConnector) GetPersistentVolumes(ctx context.Context) (*corev1.PersistentVolumeList, error) { - ret := _m.Called(ctx) - - var r0 *corev1.PersistentVolumeList - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*corev1.PersistentVolumeList, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *corev1.PersistentVolumeList); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*corev1.PersistentVolumeList) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetPods provides a mock function with given fields: ctx, namespace, labelSelector -func (_m *MockKubeClientConnector) GetPods(ctx context.Context, namespace string, labelSelector *metav1.LabelSelector) (*corev1.PodList, error) { - ret := _m.Called(ctx, namespace, labelSelector) - - var r0 *corev1.PodList - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, *metav1.LabelSelector) (*corev1.PodList, error)); ok { - return rf(ctx, namespace, labelSelector) - } - if rf, ok := ret.Get(0).(func(context.Context, string, *metav1.LabelSelector) *corev1.PodList); ok { - r0 = rf(ctx, namespace, labelSelector) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*corev1.PodList) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, *metav1.LabelSelector) error); ok { - r1 = rf(ctx, namespace, labelSelector) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetSecret provides a mock function with given fields: ctx, name -func (_m *MockKubeClientConnector) GetSecret(ctx context.Context, name string) (*corev1.Secret, error) { - ret := _m.Called(ctx, name) - - var r0 *corev1.Secret - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*corev1.Secret, error)); ok { - return rf(ctx, name) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *corev1.Secret); ok { - r0 = rf(ctx, name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*corev1.Secret) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetSecretsForServiceAccount provides a mock function with given fields: ctx, accountName -func (_m *MockKubeClientConnector) GetSecretsForServiceAccount(ctx context.Context, accountName string) (*corev1.Secret, error) { - ret := _m.Called(ctx, accountName) - - var r0 *corev1.Secret - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*corev1.Secret, error)); ok { - return rf(ctx, accountName) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *corev1.Secret); ok { - r0 = rf(ctx, accountName) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*corev1.Secret) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, accountName) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetServerVersion provides a mock function with given fields: -func (_m *MockKubeClientConnector) GetServerVersion() (*version.Info, error) { - ret := _m.Called() - - var r0 *version.Info - var r1 error - if rf, ok := ret.Get(0).(func() (*version.Info, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() *version.Info); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*version.Info) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetStorageClasses provides a mock function with given fields: ctx -func (_m *MockKubeClientConnector) GetStorageClasses(ctx context.Context) (*storagev1.StorageClassList, error) { - ret := _m.Called(ctx) - - var r0 *storagev1.StorageClassList - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*storagev1.StorageClassList, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *storagev1.StorageClassList); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*storagev1.StorageClassList) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetSubscription provides a mock function with given fields: ctx, namespace, name -func (_m *MockKubeClientConnector) GetSubscription(ctx context.Context, namespace string, name string) (*v1alpha1.Subscription, error) { - ret := _m.Called(ctx, namespace, name) - - var r0 *v1alpha1.Subscription - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (*v1alpha1.Subscription, error)); ok { - return rf(ctx, namespace, name) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string) *v1alpha1.Subscription); ok { - r0 = rf(ctx, namespace, name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1alpha1.Subscription) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, namespace, name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetSubscriptionCSV provides a mock function with given fields: ctx, subKey -func (_m *MockKubeClientConnector) GetSubscriptionCSV(ctx context.Context, subKey types.NamespacedName) (types.NamespacedName, error) { - ret := _m.Called(ctx, subKey) - - var r0 types.NamespacedName - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.NamespacedName) (types.NamespacedName, error)); ok { - return rf(ctx, subKey) - } - if rf, ok := ret.Get(0).(func(context.Context, types.NamespacedName) types.NamespacedName); ok { - r0 = rf(ctx, subKey) - } else { - r0 = ret.Get(0).(types.NamespacedName) - } - - if rf, ok := ret.Get(1).(func(context.Context, types.NamespacedName) error); ok { - r1 = rf(ctx, subKey) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ListCRDs provides a mock function with given fields: ctx, labelSelector -func (_m *MockKubeClientConnector) ListCRDs(ctx context.Context, labelSelector *metav1.LabelSelector) (*apiextensionsv1.CustomResourceDefinitionList, error) { - ret := _m.Called(ctx, labelSelector) - - var r0 *apiextensionsv1.CustomResourceDefinitionList - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *metav1.LabelSelector) (*apiextensionsv1.CustomResourceDefinitionList, error)); ok { - return rf(ctx, labelSelector) - } - if rf, ok := ret.Get(0).(func(context.Context, *metav1.LabelSelector) *apiextensionsv1.CustomResourceDefinitionList); ok { - r0 = rf(ctx, labelSelector) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiextensionsv1.CustomResourceDefinitionList) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *metav1.LabelSelector) error); ok { - r1 = rf(ctx, labelSelector) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ListCRs provides a mock function with given fields: ctx, namespace, gvr, labelSelector -func (_m *MockKubeClientConnector) ListCRs(ctx context.Context, namespace string, gvr schema.GroupVersionResource, labelSelector *metav1.LabelSelector) (*unstructured.UnstructuredList, error) { - ret := _m.Called(ctx, namespace, gvr, labelSelector) - - var r0 *unstructured.UnstructuredList - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, schema.GroupVersionResource, *metav1.LabelSelector) (*unstructured.UnstructuredList, error)); ok { - return rf(ctx, namespace, gvr, labelSelector) - } - if rf, ok := ret.Get(0).(func(context.Context, string, schema.GroupVersionResource, *metav1.LabelSelector) *unstructured.UnstructuredList); ok { - r0 = rf(ctx, namespace, gvr, labelSelector) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*unstructured.UnstructuredList) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, schema.GroupVersionResource, *metav1.LabelSelector) error); ok { - r1 = rf(ctx, namespace, gvr, labelSelector) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ListDatabaseClusters provides a mock function with given fields: ctx -func (_m *MockKubeClientConnector) ListDatabaseClusters(ctx context.Context) (*apiv1.DatabaseClusterList, error) { - ret := _m.Called(ctx) - - var r0 *apiv1.DatabaseClusterList - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*apiv1.DatabaseClusterList, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *apiv1.DatabaseClusterList); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*apiv1.DatabaseClusterList) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ListSecrets provides a mock function with given fields: ctx -func (_m *MockKubeClientConnector) ListSecrets(ctx context.Context) (*corev1.SecretList, error) { - ret := _m.Called(ctx) - - var r0 *corev1.SecretList - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*corev1.SecretList, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *corev1.SecretList); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*corev1.SecretList) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ListSubscriptions provides a mock function with given fields: ctx, namespace -func (_m *MockKubeClientConnector) ListSubscriptions(ctx context.Context, namespace string) (*v1alpha1.SubscriptionList, error) { - ret := _m.Called(ctx, namespace) - - var r0 *v1alpha1.SubscriptionList - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*v1alpha1.SubscriptionList, error)); ok { - return rf(ctx, namespace) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *v1alpha1.SubscriptionList); ok { - r0 = rf(ctx, namespace) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1alpha1.SubscriptionList) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, namespace) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// UpdateInstallPlan provides a mock function with given fields: ctx, namespace, installPlan -func (_m *MockKubeClientConnector) UpdateInstallPlan(ctx context.Context, namespace string, installPlan *v1alpha1.InstallPlan) (*v1alpha1.InstallPlan, error) { - ret := _m.Called(ctx, namespace, installPlan) - - var r0 *v1alpha1.InstallPlan - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, *v1alpha1.InstallPlan) (*v1alpha1.InstallPlan, error)); ok { - return rf(ctx, namespace, installPlan) - } - if rf, ok := ret.Get(0).(func(context.Context, string, *v1alpha1.InstallPlan) *v1alpha1.InstallPlan); ok { - r0 = rf(ctx, namespace, installPlan) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1alpha1.InstallPlan) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, *v1alpha1.InstallPlan) error); ok { - r1 = rf(ctx, namespace, installPlan) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewMockKubeClientConnector creates a new instance of MockKubeClientConnector. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMockKubeClientConnector(t interface { - mock.TestingT - Cleanup(func()) -}, -) *MockKubeClientConnector { - mock := &MockKubeClientConnector{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/managed/services/dbaas/kubernetes/client/writer.go b/managed/services/dbaas/kubernetes/client/writer.go deleted file mode 100644 index 2c5839504c..0000000000 --- a/managed/services/dbaas/kubernetes/client/writer.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package client - -import ( - "fmt" - "io" -) - -// PrefixWriter can write text at various indentation levels. -type PrefixWriter interface { - // Writef writes text with the specified indentation level. - Writef(level int, format string, a ...interface{}) - // WriteLine writes an entire line with no indentation level. - WriteLine(a ...interface{}) - // Flush forces indentation to be reset. - Flush() -} - -// prefixWriter implements PrefixWriter -type prefixWriter struct { - out io.Writer -} - -var _ PrefixWriter = &prefixWriter{} - -// NewPrefixWriter creates a new PrefixWriter. -func NewPrefixWriter(out io.Writer) PrefixWriter { //nolint:ireturn - return &prefixWriter{out: out} -} - -func (pw *prefixWriter) Writef(level int, format string, a ...interface{}) { - levelSpace := " " - prefix := "" - for i := 0; i < level; i++ { - prefix += levelSpace - } - - fmt.Fprintf(pw.out, prefix+format, a...) -} - -func (pw *prefixWriter) WriteLine(a ...interface{}) { - fmt.Fprintln(pw.out, a...) -} - -func (pw *prefixWriter) Flush() { - if f, ok := pw.out.(flusher); ok { - f.Flush() - } -} - -type flusher interface { - Flush() -} diff --git a/managed/services/dbaas/kubernetes/kubernetes.go b/managed/services/dbaas/kubernetes/kubernetes.go deleted file mode 100644 index 207bff645a..0000000000 --- a/managed/services/dbaas/kubernetes/kubernetes.go +++ /dev/null @@ -1,973 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -// Package kubernetes provides functionality for kubernetes. -package kubernetes - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - "io/fs" - "log" - "net/http" - "strings" - "sync" - "time" - - "github.com/operator-framework/api/pkg/operators/v1alpha1" - dbaasv1 "github.com/percona/dbaas-operator/api/v1" - "github.com/pkg/errors" - "github.com/sirupsen/logrus" - corev1 "k8s.io/api/core/v1" - storagev1 "k8s.io/api/storage/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/util/yaml" - "k8s.io/apimachinery/pkg/version" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/tools/clientcmd" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - "github.com/percona/pmm/managed/data" - "github.com/percona/pmm/managed/services/dbaas/kubernetes/client" - "github.com/percona/pmm/managed/services/dbaas/utils/convertors" -) - -type ClusterType string - -const ( - ClusterTypeUnknown ClusterType = "unknown" - ClusterTypeMinikube ClusterType = "minikube" - ClusterTypeEKS ClusterType = "eks" - ClusterTypeGeneric ClusterType = "generic" - pxcDeploymentName = "percona-xtradb-cluster-operator" - psmdbDeploymentName = "percona-server-mongodb-operator" - dbaasDeploymentName = "dbaas-operator-controller-manager" - psmdbOperatorContainerName = "percona-server-mongodb-operator" - pxcOperatorContainerName = "percona-xtradb-cluster-operator" - dbaasOperatorContainerName = "manager" - databaseClusterKind = "DatabaseCluster" - databaseClusterAPIVersion = "dbaas.percona.com/v1" - restartAnnotationKey = "dbaas.percona.com/restart" - managedByKey = "dbaas.percona.com/managed-by" - templateLabelKey = "dbaas.percona.com/template" - engineLabelKey = "dbaas.percona.com/engine" - - // ContainerStateWaiting represents a state when container requires some - // operations being done in order to complete start up. - ContainerStateWaiting ContainerState = "waiting" - // ContainerStateTerminated indicates that container began execution and - // then either ran to completion or failed for some reason. - ContainerStateTerminated ContainerState = "terminated" - - // Max size of volume for AWS Elastic Block Storage service is 16TiB. - maxVolumeSizeEBS uint64 = 16 * 1024 * 1024 * 1024 * 1024 - olmNamespace = "olm" - useDefaultNamespace = "" - - // APIVersionCoreosV1 constant for some API requests. - APIVersionCoreosV1 = "operators.coreos.com/v1" - - pollInterval = 1 * time.Second - pollDuration = 5 * time.Minute -) - -// ErrEmptyVersionTag Got an empty version tag from GitHub API. -var ErrEmptyVersionTag error = errors.New("got an empty version tag from Github") - -// Kubernetes is a client for Kubernetes. -type Kubernetes struct { - lock *sync.RWMutex - client client.KubeClientConnector - l *logrus.Entry - httpClient *http.Client - kubeconfig string -} - -// ContainerState describes container's state - waiting, running, terminated. -type ContainerState string - -// NodeSummaryNode holds information about Node inside Node's summary. -type NodeSummaryNode struct { - FileSystem NodeFileSystemSummary `json:"fs,omitempty"` -} - -// NodeSummary holds summary of the Node. -// One gets this by requesting Kubernetes API endpoint: -// /v1/nodes//proxy/stats/summary. -type NodeSummary struct { - Node NodeSummaryNode `json:"node,omitempty"` -} - -// NodeFileSystemSummary holds a summary of Node's filesystem. -type NodeFileSystemSummary struct { - UsedBytes uint64 `json:"usedBytes,omitempty"` -} - -// NewIncluster returns new Kubernetes object. -func NewIncluster() (*Kubernetes, error) { - l := logrus.WithField("component", "kubernetes") - - client, err := client.NewFromInCluster() - if err != nil { - return nil, err - } - - return &Kubernetes{ - client: client, - l: l, - lock: &sync.RWMutex{}, - httpClient: &http.Client{ - Timeout: time.Second * 5, - Transport: &http.Transport{ - MaxIdleConns: 1, - IdleConnTimeout: 10 * time.Second, - }, - }, - }, nil -} - -// New returns new Kubernetes object. -func New(kubeconfig string) (*Kubernetes, error) { - l := logrus.WithField("component", "kubernetes") - - client, err := client.NewFromKubeConfigString(kubeconfig) - if err != nil { - return nil, err - } - - return &Kubernetes{ - client: client, - l: l, - lock: &sync.RWMutex{}, - httpClient: &http.Client{ - Timeout: time.Second * 5, - Transport: &http.Transport{ - MaxIdleConns: 1, - IdleConnTimeout: 10 * time.Second, - }, - }, - kubeconfig: kubeconfig, - }, nil -} - -// NewEmpty returns new Kubernetes object. -func NewEmpty() *Kubernetes { - return &Kubernetes{ - client: &client.Client{}, - lock: &sync.RWMutex{}, - l: logrus.WithField("component", "kubernetes"), - httpClient: &http.Client{ - Timeout: time.Second * 5, - Transport: &http.Transport{ - MaxIdleConns: 1, - IdleConnTimeout: 10 * time.Second, - }, - }, - } -} - -// SetKubeconfig changes kubeconfig for active client. -func (k *Kubernetes) SetKubeconfig(kubeconfig string) error { - k.lock.Lock() - defer k.lock.Unlock() - client, err := client.NewFromKubeConfigString(kubeconfig) - if err != nil { - return err - } - k.client = client - k.kubeconfig = kubeconfig - return nil -} - -// GetKubeconfig generates kubeconfig compatible with kubectl for incluster created clients. -func (k *Kubernetes) GetKubeconfig(ctx context.Context) (string, error) { - k.lock.RLock() - defer k.lock.RUnlock() - secret, err := k.client.GetSecretsForServiceAccount(ctx, "pmm-service-account") - if err != nil { - k.l.Errorf("failed getting service account: %v", err) - return "", err - } - - kubeConfig, err := k.client.GenerateKubeConfig(secret) - if err != nil { - k.l.Errorf("failed generating kubeconfig: %v", err) - return "", err - } - - return string(kubeConfig), nil -} - -// ListDatabaseClusters returns list of managed PCX clusters. -func (k *Kubernetes) ListDatabaseClusters(ctx context.Context) (*dbaasv1.DatabaseClusterList, error) { - k.lock.RLock() - defer k.lock.RUnlock() - return k.client.ListDatabaseClusters(ctx) -} - -// GetDatabaseCluster returns PXC clusters by provided name. -func (k *Kubernetes) GetDatabaseCluster(ctx context.Context, name string) (*dbaasv1.DatabaseCluster, error) { - k.lock.RLock() - defer k.lock.RUnlock() - return k.client.GetDatabaseCluster(ctx, name) -} - -// RestartDatabaseCluster restarts database cluster. -func (k *Kubernetes) RestartDatabaseCluster(ctx context.Context, name string) error { - k.lock.Lock() - defer k.lock.Unlock() - cluster, err := k.client.GetDatabaseCluster(ctx, name) - if err != nil { - return err - } - cluster.TypeMeta.APIVersion = databaseClusterAPIVersion - cluster.TypeMeta.Kind = databaseClusterKind - if cluster.ObjectMeta.Annotations == nil { - cluster.ObjectMeta.Annotations = make(map[string]string) - } - cluster.ObjectMeta.Annotations[restartAnnotationKey] = "true" - return k.client.ApplyObject(cluster) -} - -// PatchDatabaseCluster patches CR of managed Database cluster. -func (k *Kubernetes) PatchDatabaseCluster(cluster *dbaasv1.DatabaseCluster) error { - k.lock.Lock() - defer k.lock.Unlock() - return k.client.ApplyObject(cluster) -} - -// CreateDatabaseCluster creates database cluster. -func (k *Kubernetes) CreateDatabaseCluster(cluster *dbaasv1.DatabaseCluster) error { - k.lock.Lock() - defer k.lock.Unlock() - if cluster.ObjectMeta.Annotations == nil { - cluster.ObjectMeta.Annotations = make(map[string]string) - } - cluster.ObjectMeta.Annotations[managedByKey] = "pmm" - return k.client.ApplyObject(cluster) -} - -// DeleteDatabaseCluster deletes database cluster. -func (k *Kubernetes) DeleteDatabaseCluster(ctx context.Context, name string) error { - k.lock.Lock() - defer k.lock.Unlock() - cluster, err := k.client.GetDatabaseCluster(ctx, name) - if err != nil { - return err - } - cluster.TypeMeta.APIVersion = databaseClusterAPIVersion - cluster.TypeMeta.Kind = databaseClusterKind - return k.client.DeleteObject(cluster) -} - -// GetDefaultStorageClassName returns first storageClassName from kubernetes cluster. -func (k *Kubernetes) GetDefaultStorageClassName(ctx context.Context) (string, error) { - k.lock.RLock() - defer k.lock.RUnlock() - storageClasses, err := k.client.GetStorageClasses(ctx) - if err != nil { - return "", err - } - if len(storageClasses.Items) != 0 { - return storageClasses.Items[0].Name, nil - } - return "", errors.New("no storage classes available") -} - -// GetClusterType tries to guess the underlying kubernetes cluster based on storage class. -func (k *Kubernetes) GetClusterType(ctx context.Context) (ClusterType, error) { - k.lock.RLock() - defer k.lock.RUnlock() - storageClasses, err := k.client.GetStorageClasses(ctx) - if err != nil { - return ClusterTypeUnknown, err - } - for _, storageClass := range storageClasses.Items { - if strings.Contains(storageClass.Provisioner, "aws") { - return ClusterTypeEKS, nil - } - if strings.Contains(storageClass.Provisioner, "minikube") || - strings.Contains(storageClass.Provisioner, "kubevirt.io/hostpath-provisioner") || - strings.Contains(storageClass.Provisioner, "standard") { - return ClusterTypeMinikube, nil - } - } - return ClusterTypeGeneric, nil -} - -// getOperatorVersion parses operator version from operator deployment. -func (k *Kubernetes) getOperatorVersion(ctx context.Context, deploymentName, containerName string) (string, error) { - deployment, err := k.client.GetDeployment(ctx, deploymentName) - if err != nil { - return "", err - } - for _, container := range deployment.Spec.Template.Spec.Containers { - if container.Name == containerName { - return strings.Split(container.Image, ":")[1], nil - } - } - return "", errors.New("unknown version of operator") -} - -// GetPSMDBOperatorVersion parses PSMDB operator version from operator deployment. -func (k *Kubernetes) GetPSMDBOperatorVersion(ctx context.Context) (string, error) { - k.lock.RLock() - defer k.lock.RUnlock() - return k.getOperatorVersion(ctx, psmdbDeploymentName, psmdbOperatorContainerName) -} - -// GetPXCOperatorVersion parses PXC operator version from operator deployment -func (k *Kubernetes) GetPXCOperatorVersion(ctx context.Context) (string, error) { - k.lock.RLock() - defer k.lock.RUnlock() - return k.getOperatorVersion(ctx, pxcDeploymentName, pxcOperatorContainerName) -} - -// GetDBaaSOperatorVersion parses DBaaS operator version from operator deployment. -func (k *Kubernetes) GetDBaaSOperatorVersion(ctx context.Context) (string, error) { - k.lock.RLock() - defer k.lock.RUnlock() - return k.getOperatorVersion(ctx, dbaasDeploymentName, dbaasOperatorContainerName) -} - -// GetSecret returns secret by name. -func (k *Kubernetes) GetSecret(ctx context.Context, name string) (*corev1.Secret, error) { - k.lock.RLock() - defer k.lock.RUnlock() - return k.client.GetSecret(ctx, name) -} - -// ListSecrets returns secret by name. -func (k *Kubernetes) ListSecrets(ctx context.Context) (*corev1.SecretList, error) { - k.lock.RLock() - defer k.lock.RUnlock() - return k.client.ListSecrets(ctx) -} - -// CreatePMMSecret creates pmm secret in kubernetes. -func (k *Kubernetes) CreatePMMSecret(secretName string, secrets map[string][]byte) error { - k.lock.Lock() - defer k.lock.Unlock() - secret := &corev1.Secret{ //nolint: exhaustruct - TypeMeta: metav1.TypeMeta{ - APIVersion: "v1", - Kind: "Secret", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: secretName, - }, - Type: corev1.SecretTypeOpaque, - Data: secrets, - } - return k.client.ApplyObject(secret) -} - -func (k *Kubernetes) CreateRestore(restore *dbaasv1.DatabaseClusterRestore) error { - k.lock.Lock() - defer k.lock.Unlock() - return k.client.ApplyObject(restore) -} - -// GetPods returns list of pods. -func (k *Kubernetes) GetPods(ctx context.Context, namespace string, labelSelector *metav1.LabelSelector) (*corev1.PodList, error) { - return k.client.GetPods(ctx, namespace, labelSelector) -} - -// GetLogs returns logs as slice of log lines - strings - for given pod's container. -func (k *Kubernetes) GetLogs( - ctx context.Context, - containerStatuses []corev1.ContainerStatus, - pod, - container string, -) ([]string, error) { - if IsContainerInState(containerStatuses, ContainerStateWaiting) { - return []string{}, nil - } - - stdout, err := k.client.GetLogs(ctx, pod, container) - if err != nil { - return nil, errors.Wrap(err, "couldn't get logs") - } - - if stdout == "" { - return []string{}, nil - } - - return strings.Split(stdout, "\n"), nil -} - -// GetEvents returns pod's events as a slice of strings. -func (k *Kubernetes) GetEvents(ctx context.Context, pod string) ([]string, error) { - stdout, err := k.client.GetEvents(ctx, pod) - if err != nil { - return nil, errors.Wrap(err, "couldn't describe pod") - } - - lines := strings.Split(stdout, "\n") - - return lines, nil -} - -// IsContainerInState returns true if container is in give state, otherwise false. -func IsContainerInState(containerStatuses []corev1.ContainerStatus, state ContainerState) bool { - containerState := make(map[string]interface{}) - for _, status := range containerStatuses { - data, err := json.Marshal(status.State) - if err != nil { - return false - } - - if err := json.Unmarshal(data, &containerState); err != nil { - return false - } - - if _, ok := containerState[string(state)]; ok { - return true - } - } - - return false -} - -// IsNodeInCondition returns true if node's condition given as an argument has -// status "True". Otherwise it returns false. -func IsNodeInCondition(node corev1.Node, conditionType corev1.NodeConditionType) bool { - for _, condition := range node.Status.Conditions { - if condition.Status == corev1.ConditionTrue && condition.Type == conditionType { - return true - } - } - return false -} - -// GetWorkerNodes returns list of cluster workers nodes. -func (k *Kubernetes) GetWorkerNodes(ctx context.Context) ([]corev1.Node, error) { - nodes, err := k.client.GetNodes(ctx) - if err != nil { - return nil, errors.Wrap(err, "could not get nodes of Kubernetes cluster") - } - forbidenTaints := map[string]corev1.TaintEffect{ - "node.cloudprovider.kubernetes.io/uninitialized": corev1.TaintEffectNoSchedule, - "node.kubernetes.io/unschedulable": corev1.TaintEffectNoSchedule, - "node-role.kubernetes.io/master": corev1.TaintEffectNoSchedule, - } - workers := make([]corev1.Node, 0, len(nodes.Items)) - for _, node := range nodes.Items { - if len(node.Spec.Taints) == 0 { - workers = append(workers, node) - continue - } - for _, taint := range node.Spec.Taints { - effect, keyFound := forbidenTaints[taint.Key] - if !keyFound || effect != taint.Effect { - workers = append(workers, node) - } - } - } - return workers, nil -} - -// GetAllClusterResources goes through all cluster nodes and sums their allocatable resources. -func (k *Kubernetes) GetAllClusterResources(ctx context.Context, clusterType ClusterType, volumes *corev1.PersistentVolumeList) ( //nolint:nonamedreturns - cpuMillis uint64, memoryBytes uint64, diskSizeBytes uint64, err error, -) { - nodes, err := k.GetWorkerNodes(ctx) - if err != nil { - return 0, 0, 0, errors.Wrap(err, "could not get a list of nodes") - } - var volumeCountEKS uint64 - for _, node := range nodes { - cpu, memory, err := getResources(node.Status.Allocatable) - if err != nil { - return 0, 0, 0, errors.Wrap(err, "could not get allocatable resources of the node") - } - cpuMillis += cpu - memoryBytes += memory - - switch clusterType { - case ClusterTypeUnknown: - return 0, 0, 0, errors.Errorf("unknown cluster type") - case ClusterTypeGeneric: - // TODO support other cluster types - continue - case ClusterTypeMinikube: - storage, ok := node.Status.Allocatable[corev1.ResourceEphemeralStorage] - if !ok { - return 0, 0, 0, errors.Errorf("could not get storage size of the node") - } - bytes, err := convertors.StrToBytes(storage.String()) - if err != nil { - return 0, 0, 0, errors.Wrapf(err, "could not convert storage size '%s' to bytes", storage.String()) - } - diskSizeBytes += bytes - case ClusterTypeEKS: - // See https://kubernetes.io/docs/tasks/administer-cluster/out-of-resource/#scheduler. - if IsNodeInCondition(node, corev1.NodeDiskPressure) { - continue - } - - // Get nodes's type. - nodeType, ok := node.Labels["beta.kubernetes.io/instance-type"] - if !ok { - return 0, 0, 0, errors.New("dealing with AWS EKS cluster but the node does not have label 'beta.kubernetes.io/instance-type'") - } - // 39 is a default limit for EKS cluster nodes ... - volumeLimitPerNode := uint64(39) - typeAndSize := strings.Split(strings.ToLower(nodeType), ".") - if len(typeAndSize) < 2 { - return 0, 0, 0, errors.Errorf("failed to parse EKS node type '%s', it's not in expected format 'type.size'", nodeType) - } - // ... however, if the node type is one of M5, C5, R5, T3, Z1D it's 25. - limitedVolumesSet := map[string]struct{}{ - "m5": {}, "c5": {}, "r5": {}, "t3": {}, "t1d": {}, - } - if _, ok := limitedVolumesSet[typeAndSize[0]]; ok { - volumeLimitPerNode = 25 - } - volumeCountEKS += volumeLimitPerNode - } - } - if clusterType == ClusterTypeEKS { - volumeCountEKSBackup := volumeCountEKS - volumeCountEKS -= uint64(len(volumes.Items)) - if volumeCountEKS > volumeCountEKSBackup { - // handle uint underflow - volumeCountEKS = 0 - } - - consumedBytes, err := sumVolumesSize(volumes) - if err != nil { - return 0, 0, 0, errors.Wrap(err, "failed to sum persistent volumes storage sizes") - } - diskSizeBytes = (volumeCountEKS * maxVolumeSizeEBS) + consumedBytes - } - return cpuMillis, memoryBytes, diskSizeBytes, nil -} - -// getResources extracts resources out of corev1.ResourceList and converts them to int64 values. -// Millicpus are used for CPU values and bytes for memory. -func getResources(resources corev1.ResourceList) (cpuMillis uint64, memoryBytes uint64, err error) { //nolint:nonamedreturns - cpu, ok := resources[corev1.ResourceCPU] - if ok { - cpuMillis, err = convertors.StrToMilliCPU(cpu.String()) - if err != nil { - return 0, 0, errors.Wrapf(err, "failed to convert '%s' to millicpus", cpu.String()) - } - } - memory, ok := resources[corev1.ResourceMemory] - if ok { - memoryBytes, err = convertors.StrToBytes(memory.String()) - if err != nil { - return 0, 0, errors.Wrapf(err, "failed to convert '%s' to bytes", memory.String()) - } - } - return cpuMillis, memoryBytes, nil -} - -// GetConsumedCPUAndMemory returns consumed CPU and Memory in given namespace. If namespace -// is empty, it tries to get them from all namespaces. -func (k *Kubernetes) GetConsumedCPUAndMemory(ctx context.Context, namespace string) ( //nolint:nonamedreturns - cpuMillis uint64, memoryBytes uint64, err error, -) { - // Get CPU and Memory Requests of Pods' containers. - pods, err := k.GetPods(ctx, namespace, nil) - if err != nil { - return 0, 0, errors.Wrap(err, "failed to get consumed resources") - } - for _, ppod := range pods.Items { - if ppod.Status.Phase != corev1.PodRunning { - continue - } - nonTerminatedInitContainers := make([]corev1.Container, 0, len(ppod.Spec.InitContainers)) - for _, container := range ppod.Spec.InitContainers { - if !IsContainerInState( - ppod.Status.InitContainerStatuses, ContainerStateTerminated, - ) { - nonTerminatedInitContainers = append(nonTerminatedInitContainers, container) - } - } - for _, container := range append(ppod.Spec.Containers, nonTerminatedInitContainers...) { - cpu, memory, err := getResources(container.Resources.Requests) - if err != nil { - return 0, 0, errors.Wrap(err, "failed to sum all consumed resources") - } - cpuMillis += cpu - memoryBytes += memory - } - } - - return cpuMillis, memoryBytes, nil -} - -// GetConsumedDiskBytes returns consumed bytes. The strategy differs based on k8s cluster type. -func (k *Kubernetes) GetConsumedDiskBytes(ctx context.Context, clusterType ClusterType, volumes *corev1.PersistentVolumeList) (consumedBytes uint64, err error) { //nolint:lll,nonamedreturns - switch clusterType { - case ClusterTypeUnknown: - return 0, errors.Errorf("unknown cluster type") - case ClusterTypeGeneric: - // TODO support other cluster types - return 0, nil - case ClusterTypeMinikube: - nodes, err := k.GetWorkerNodes(ctx) - if err != nil { - return 0, errors.Wrap(err, "can't compute consumed disk size: failed to get worker nodes") - } - clientConfig, err := clientcmd.NewClientConfigFromBytes([]byte(k.kubeconfig)) - if err != nil { - return 0, errors.Wrap(err, "failed to build kubeconfig out of given path") - } - config, err := clientConfig.ClientConfig() - if err != nil { - return 0, errors.Wrap(err, "failed to build kubeconfig out of given path") - } - clientset, err := kubernetes.NewForConfig(config) - if err != nil { - return 0, errors.Wrap(err, "failed to build client out of submited kubeconfig") - } - for _, node := range nodes { - var summary NodeSummary - request := clientset.CoreV1().RESTClient().Get().Resource("nodes").Name(node.Name).SubResource("proxy").Suffix("stats/summary") - responseRawArrayOfBytes, err := request.DoRaw(context.Background()) //nolint:contextcheck - if err != nil { - return 0, errors.Wrap(err, "failed to get stats from node") - } - if err := json.Unmarshal(responseRawArrayOfBytes, &summary); err != nil { - return 0, errors.Wrap(err, "failed to unmarshal response from kubernetes API") - } - consumedBytes += summary.Node.FileSystem.UsedBytes - } - return consumedBytes, nil - case ClusterTypeEKS: - consumedBytes, err := sumVolumesSize(volumes) - if err != nil { - return 0, errors.Wrap(err, "failed to sum persistent volumes storage sizes") - } - return consumedBytes, nil - } - - return 0, nil -} - -// sumVolumesSize returns sum of persistent volumes storage size in bytes. -func sumVolumesSize(pvs *corev1.PersistentVolumeList) (sum uint64, err error) { //nolint:nonamedreturns - for _, pv := range pvs.Items { - bytes, err := convertors.StrToBytes(pv.Spec.Capacity.Storage().String()) - if err != nil { - return 0, err - } - sum += bytes - } - return -} - -// GetPersistentVolumes returns list of persistent volumes. -func (k *Kubernetes) GetPersistentVolumes(ctx context.Context) (*corev1.PersistentVolumeList, error) { - return k.client.GetPersistentVolumes(ctx) -} - -// GetStorageClasses returns all storage classes available in the cluster. -func (k *Kubernetes) GetStorageClasses(ctx context.Context) (*storagev1.StorageClassList, error) { - return k.client.GetStorageClasses(ctx) -} - -// InstallOLMOperator installs the OLM in the Kubernetes cluster. -func (k *Kubernetes) InstallOLMOperator(ctx context.Context) error { - deployment, err := k.client.GetDeployment(ctx, "olm-operator") - if err == nil && deployment != nil && deployment.ObjectMeta.Name != "" { - return nil // already installed - } - - var crdFile, olmFile, perconaCatalog []byte - - crdFile, err = fs.ReadFile(data.OLMCRDs, "crds/olm/crds.yaml") - if err != nil { - return errors.Wrapf(err, "failed to read OLM CRDs file") - } - - if err := k.client.ApplyFile(crdFile); err != nil { - return errors.Wrapf(err, "cannot apply %q file", crdFile) - } - - olmFile, err = fs.ReadFile(data.OLMCRDs, "crds/olm/olm.yaml") - if err != nil { - return errors.Wrapf(err, "failed to read OLM file") - } - - if err := k.client.ApplyFile(olmFile); err != nil { - return errors.Wrapf(err, "cannot apply %q file", crdFile) - } - - perconaCatalog, err = fs.ReadFile(data.OLMCRDs, "crds/olm/percona-dbaas-catalog.yaml") - if err != nil { - return errors.Wrapf(err, "failed to read percona catalog yaml file") - } - - if err := k.client.ApplyFile(perconaCatalog); err != nil { - return errors.Wrapf(err, "cannot apply %q file", crdFile) - } - - if err := k.client.DoRolloutWait(ctx, types.NamespacedName{Namespace: olmNamespace, Name: "olm-operator"}); err != nil { - return errors.Wrap(err, "error while waiting for deployment rollout") - } - if err := k.client.DoRolloutWait(ctx, types.NamespacedName{Namespace: "olm", Name: "catalog-operator"}); err != nil { - return errors.Wrap(err, "error while waiting for deployment rollout") - } - - crdResources, err := decodeResources(crdFile) - if err != nil { - return errors.Wrap(err, "cannot decode crd resources") - } - - olmResources, err := decodeResources(olmFile) - if err != nil { - return errors.Wrap(err, "cannot decode olm resources") - } - - resources := append(crdResources, olmResources...) //nolint:gocritic - - subscriptions := filterResources(resources, func(r unstructured.Unstructured) bool { - return r.GroupVersionKind() == schema.GroupVersionKind{ - Group: v1alpha1.GroupName, - Version: v1alpha1.GroupVersion, - Kind: v1alpha1.SubscriptionKind, - } - }) - - for _, sub := range subscriptions { - subscriptionKey := types.NamespacedName{Namespace: sub.GetNamespace(), Name: sub.GetName()} - log.Printf("Waiting for subscription/%s to install CSV", subscriptionKey.Name) - csvKey, err := k.client.GetSubscriptionCSV(ctx, subscriptionKey) - if err != nil { - return fmt.Errorf("subscription/%s failed to install CSV: %w", subscriptionKey.Name, err) - } - log.Printf("Waiting for clusterserviceversion/%s to reach 'Succeeded' phase", csvKey.Name) - if err := k.client.DoCSVWait(ctx, csvKey); err != nil { - return fmt.Errorf("clusterserviceversion/%s failed to reach 'Succeeded' phase", csvKey.Name) - } - } - - if err := k.client.DoRolloutWait(ctx, types.NamespacedName{Namespace: "olm", Name: "packageserver"}); err != nil { - return errors.Wrap(err, "error while waiting for deployment rollout") - } - - return nil -} - -func decodeResources(f []byte) ([]unstructured.Unstructured, error) { - dec := yaml.NewYAMLOrJSONDecoder(bytes.NewReader(f), 8) - var objs []unstructured.Unstructured - - for { - var u unstructured.Unstructured - err := dec.Decode(&u) - if errors.Is(err, io.EOF) { - break - } else if err != nil { - return nil, err - } - objs = append(objs, u) - } - - return objs, nil -} - -func filterResources( //nolint:nonamedreturns - resources []unstructured.Unstructured, - filter func(unstructured.Unstructured) bool, -) (filtered []unstructured.Unstructured) { - for _, r := range resources { - if filter(r) { - filtered = append(filtered, r) - } - } - return filtered -} - -// InstallOperatorRequest holds the fields to make an operator install request. -type InstallOperatorRequest struct { - Namespace string - Name string - OperatorGroup string - CatalogSource string - CatalogSourceNamespace string - Channel string - InstallPlanApproval v1alpha1.Approval - StartingCSV string -} - -// InstallOperator installs an operator via OLM. -func (k *Kubernetes) InstallOperator(ctx context.Context, req InstallOperatorRequest) error { - if err := createOperatorGroupIfNeeded(ctx, k.client, req.OperatorGroup); err != nil { - return err - } - - subs, err := k.client.CreateSubscriptionForCatalog(ctx, req.Namespace, req.Name, "olm", req.CatalogSource, - req.Name, req.Channel, req.StartingCSV, v1alpha1.ApprovalManual) - if err != nil { - return errors.Wrap(err, "cannot create a susbcription to install the operator") - } - - err = wait.Poll(pollInterval, pollDuration, func() (bool, error) { - k.lock.Lock() - defer k.lock.Unlock() - - subs, err = k.client.GetSubscription(ctx, req.Namespace, req.Name) - if err != nil || subs == nil || (subs != nil && subs.Status.Install == nil) { - return false, err - } - - return true, nil - }) - - if err != nil { - return err - } - if subs == nil { - return fmt.Errorf("cannot get an install plan for the operator subscription: %q", req.Name) - } - - ip, err := k.client.GetInstallPlan(ctx, req.Namespace, subs.Status.Install.Name) - if err != nil { - return err - } - - ip.Spec.Approved = true - _, err = k.client.UpdateInstallPlan(ctx, req.Namespace, ip) - - return err -} - -func createOperatorGroupIfNeeded(ctx context.Context, client client.KubeClientConnector, name string) error { - _, err := client.GetOperatorGroup(ctx, useDefaultNamespace, name) - if err == nil { - return nil - } - - _, err = client.CreateOperatorGroup(ctx, "default", name) - - return err -} - -// ListSubscriptions all the subscriptions in the namespace. -func (k *Kubernetes) ListSubscriptions(ctx context.Context, namespace string) (*v1alpha1.SubscriptionList, error) { - return k.client.ListSubscriptions(ctx, namespace) -} - -// UpgradeOperator upgrades an operator to the next available version. -func (k *Kubernetes) UpgradeOperator(ctx context.Context, namespace, name string) error { - var subs *v1alpha1.Subscription - - // If the subscription was recently created, the install plan might not be ready yet. - err := wait.Poll(pollInterval, pollDuration, func() (bool, error) { - var err error - subs, err = k.client.GetSubscription(ctx, namespace, name) - if err != nil { - return false, err - } - if subs == nil || subs.Status.Install == nil || subs.Status.Install.Name == "" { - return false, nil - } - - return true, nil - }) - if err != nil { - return err - } - if subs == nil || subs.Status.Install == nil || subs.Status.Install.Name == "" { - return fmt.Errorf("cannot get subscription for %q operator", name) - } - - ip, err := k.client.GetInstallPlan(ctx, namespace, subs.Status.Install.Name) - if err != nil { - return errors.Wrapf(err, "cannot get install plan to upgrade %q", name) - } - - if ip.Spec.Approved { - return nil // There are no upgrades. - } - - ip.Spec.Approved = true - - _, err = k.client.UpdateInstallPlan(ctx, namespace, ip) - - return err -} - -// GetServerVersion returns server version. -func (k *Kubernetes) GetServerVersion() (*version.Info, error) { - return k.client.GetServerVersion() -} - -// ListTemplates returns a list of templates. -func (k *Kubernetes) ListTemplates(ctx context.Context, engine, namespace string) ([]*dbaasv1beta1.Template, error) { - k.lock.RLock() - defer k.lock.RUnlock() - - labelSelector := &metav1.LabelSelector{ - MatchLabels: map[string]string{ - templateLabelKey: "yes", - engineLabelKey: engine, - }, - } - - templateCRDs, err := k.client.ListCRDs(ctx, labelSelector) - if err != nil { - return nil, errors.Wrap(err, "failed listing template CRDs") - } - - templates := []*dbaasv1beta1.Template{} - for _, templateCRD := range templateCRDs.Items { - var storedVersionName string - for _, version := range templateCRD.Spec.Versions { - if version.Storage { - storedVersionName = version.Name - break - } - } - // XXX: logically we should check that storedVersionName has been set and - // return an error otherwise but according to the - // CustomResourceDefinitionVersion documentation - // "There must be exactly one version with storage=true." so we are sure - // that storedVersionName will be set. If for some reason it's not, it will - // fail to find the CRs so an error will be returned either way. - gvr := schema.GroupVersionResource{ - Group: templateCRD.Spec.Group, - Version: storedVersionName, - Resource: templateCRD.Spec.Names.Plural, - } - - templateCRs, err := k.client.ListCRs(ctx, namespace, gvr, labelSelector) - if err != nil { - return nil, errors.Wrap(err, "failed listing template CRs") - } - - for _, templateCR := range templateCRs.Items { - //nolint:forcetypeassert - templates = append(templates, &dbaasv1beta1.Template{ - Name: templateCR.Object["metadata"].(map[string]interface{})["name"].(string), - Kind: templateCR.Object["kind"].(string), - }) - } - } - - return templates, nil -} diff --git a/managed/services/dbaas/kubernetes/olm_operator_test.go b/managed/services/dbaas/kubernetes/olm_operator_test.go deleted file mode 100644 index 83906ee61b..0000000000 --- a/managed/services/dbaas/kubernetes/olm_operator_test.go +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -// Package operator contains logic related to kubernetes operators. -package kubernetes - -import ( - "context" - "testing" - - v1 "github.com/operator-framework/api/pkg/operators/v1" - "github.com/operator-framework/api/pkg/operators/v1alpha1" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - appsv1 "k8s.io/api/apps/v1" - "k8s.io/apimachinery/pkg/types" - - "github.com/percona/pmm/managed/services/dbaas/kubernetes/client" -) - -func TestInstallOlmOperator(t *testing.T) { - ctx := context.Background() - k8sclient := &client.MockKubeClientConnector{} - - olms := NewEmpty() - olms.client = k8sclient - - t.Run("Install OLM Operator", func(t *testing.T) { - k8sclient.On("CreateSubscriptionForCatalog", mock.Anything, mock.Anything, mock.Anything, - mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything). - Return(&v1alpha1.Subscription{}, nil) - k8sclient.On("GetDeployment", ctx, mock.Anything).Return(&appsv1.Deployment{}, nil) - k8sclient.On("ApplyFile", mock.Anything).Return(nil) - k8sclient.On("DoRolloutWait", ctx, mock.Anything).Return(nil) - k8sclient.On("GetSubscriptionCSV", ctx, mock.Anything).Return(types.NamespacedName{}, nil) - k8sclient.On("DoRolloutWait", ctx, mock.Anything).Return(nil) - err := olms.InstallOLMOperator(ctx) - assert.NoError(t, err) - }) - - t.Run("Install PSMDB Operator", func(t *testing.T) { - // Install PSMDB Operator - subscriptionNamespace := "default" - operatorGroup := "percona-operators-group" - catalosSourceNamespace := "olm" - operatorName := "percona-server-mongodb-operator" - params := InstallOperatorRequest{ - Namespace: subscriptionNamespace, - Name: operatorName, - OperatorGroup: operatorGroup, - CatalogSource: "operatorhubio-catalog", - CatalogSourceNamespace: catalosSourceNamespace, - Channel: "stable", - InstallPlanApproval: v1alpha1.ApprovalManual, - } - - k8sclient.On("GetOperatorGroup", ctx, "", operatorGroup).Return(&v1.OperatorGroup{}, nil) - mockSubscription := &v1alpha1.Subscription{ - Status: v1alpha1.SubscriptionStatus{ - Install: &v1alpha1.InstallPlanReference{ - Name: "abcd1234", - }, - }, - } - k8sclient.On("GetSubscription", ctx, subscriptionNamespace, operatorName).Return(mockSubscription, nil) - mockInstallPlan := &v1alpha1.InstallPlan{} - k8sclient.On("GetInstallPlan", ctx, subscriptionNamespace, mockSubscription.Status.Install.Name).Return(mockInstallPlan, nil) - k8sclient.On("UpdateInstallPlan", ctx, subscriptionNamespace, mockInstallPlan).Return(mockInstallPlan, nil) - err := olms.InstallOperator(ctx, params) - assert.NoError(t, err) - }) -} diff --git a/managed/services/dbaas/kubernetes/operator_service_interface.go b/managed/services/dbaas/kubernetes/operator_service_interface.go deleted file mode 100644 index 01d184b605..0000000000 --- a/managed/services/dbaas/kubernetes/operator_service_interface.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by ifacemaker; DO NOT EDIT. - -package kubernetes - -import ( - "context" - - "github.com/operator-framework/api/pkg/operators/v1alpha1" -) - -// OperatorServiceManager ... -type OperatorServiceManager interface { - // SetKubeConfig receives a new config and establish a new connection to the K8 cluster. - SetKubeConfig(kubeConfig string) error - // InstallOLMOperator installs the OLM in the Kubernetes cluster. - InstallOLMOperator(ctx context.Context) error - // InstallOperator installs an operator via OLM. - InstallOperator(ctx context.Context, req InstallOperatorRequest) error - // ListSubscriptions all the subscriptions in the namespace. - ListSubscriptions(ctx context.Context, namespace string) (*v1alpha1.SubscriptionList, error) - // UpgradeOperator upgrades an operator to the next available version. - UpgradeOperator(ctx context.Context, namespace, name string) error -} diff --git a/managed/services/dbaas/kubernetes/types.go b/managed/services/dbaas/kubernetes/types.go deleted file mode 100644 index db29220e1c..0000000000 --- a/managed/services/dbaas/kubernetes/types.go +++ /dev/null @@ -1,597 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package kubernetes - -import ( - "fmt" - "strconv" - "strings" - - dbaasv1 "github.com/percona/dbaas-operator/api/v1" - "github.com/pkg/errors" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - "github.com/percona/pmm/managed/models" -) - -const ( - dbaasAPI = "dbaas.percona.com/v1" - dbaasKind = "DatabaseCluster" - pxcSecretNameTmpl = "dbaas-%s-pxc-secrets" //nolint:gosec - psmdbSecretNameTmpl = "dbaas-%s-psmdb-secrets" //nolint:gosec - // DatabaseTypePXC is a pxc database - DatabaseTypePXC dbaasv1.EngineType = "pxc" - // DatabaseTypePSMDB is a psmdb database - DatabaseTypePSMDB dbaasv1.EngineType = "psmdb" - externalNLB string = "external" - - dbTemplateKindAnnotationKey = "dbaas.percona.com/dbtemplate-kind" - dbTemplateNameAnnotationKey = "dbaas.percona.com/dbtemplate-name" -) - -var errSimultaneous = errors.New("field suspend and resume cannot be true simultaneously") - -var exposeTypeMap = map[ClusterType]corev1.ServiceType{ - ClusterTypeMinikube: corev1.ServiceTypeNodePort, - ClusterTypeEKS: corev1.ServiceTypeLoadBalancer, - ClusterTypeGeneric: corev1.ServiceTypeLoadBalancer, -} - -var exposeAnnotationsMap = map[ClusterType]map[string]string{ - ClusterTypeMinikube: make(map[string]string), - ClusterTypeEKS: { - "service.beta.kubernetes.io/aws-load-balancer-nlb-target-type": "ip", - "service.beta.kubernetes.io/aws-load-balancer-scheme": "internet-facing", - "service.beta.kubernetes.io/aws-load-balancer-target-group-attributes": "preserve_client_ip.enabled=true", - }, - ClusterTypeGeneric: make(map[string]string), -} - -func convertComputeResource(res *dbaasv1beta1.ComputeResources) (corev1.ResourceRequirements, error) { - req := corev1.ResourceRequirements{} - if res == nil { - return req, nil - } - cpu, err := resource.ParseQuantity(fmt.Sprintf("%dm", res.CpuM)) - if err != nil { - return req, err - } - memory, err := resource.ParseQuantity(strconv.FormatInt(res.MemoryBytes, 10)) - if err != nil { - return req, err - } - req.Limits = corev1.ResourceList{} - req.Limits[corev1.ResourceCPU] = cpu - req.Limits[corev1.ResourceMemory] = memory - return req, nil -} - -// DatabaseClusterForPXC fills dbaasv1.DatabaseCluster struct with data provided for specified cluster type -func DatabaseClusterForPXC(cluster *dbaasv1beta1.CreatePXCClusterRequest, clusterType ClusterType, backupLocation *models.BackupLocation) (*dbaasv1.DatabaseCluster, *dbaasv1.DatabaseClusterRestore, error) { //nolint:lll - if (cluster.Params.Proxysql != nil) == (cluster.Params.Haproxy != nil) { - return nil, nil, errors.New("pxc cluster must have one and only one proxy type defined") - } - if backupLocation != nil && backupLocation.Type != models.S3BackupLocationType { - return nil, nil, errors.New("only s3 compatible storages are supported for backup/restore") - } - diskSize := resource.NewQuantity(cluster.Params.Pxc.DiskSize, resource.DecimalSI) - cpu, err := resource.ParseQuantity(fmt.Sprintf("%dm", cluster.Params.Pxc.ComputeResources.CpuM)) - if err != nil { - return nil, nil, err - } - clusterMemory := resource.NewQuantity(cluster.Params.Pxc.ComputeResources.MemoryBytes, resource.DecimalSI) - dbCluster := &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: cluster.Name, - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - }, - Spec: dbaasv1.DatabaseSpec{ - Database: DatabaseTypePXC, - DatabaseImage: cluster.Params.Pxc.Image, - DatabaseConfig: cluster.Params.Pxc.Configuration, - ClusterSize: cluster.Params.ClusterSize, - SecretsName: fmt.Sprintf(pxcSecretNameTmpl, cluster.Name), - DBInstance: dbaasv1.DBInstanceSpec{ - DiskSize: *diskSize, - CPU: cpu, - Memory: *clusterMemory, - }, - Monitoring: dbaasv1.MonitoringSpec{ - PMM: &dbaasv1.PMMSpec{}, - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{}, - Backup: &dbaasv1.BackupSpec{}, - }, - } - if cluster.Params.Pxc.StorageClass != "" { - dbCluster.Spec.DBInstance.StorageClassName = &cluster.Params.Pxc.StorageClass - } - if cluster.Params.Haproxy != nil { - resources, err := convertComputeResource(cluster.Params.Haproxy.ComputeResources) - if err != nil { - return nil, nil, err - } - dbCluster.Spec.LoadBalancer.Image = cluster.Params.Haproxy.Image - dbCluster.Spec.LoadBalancer.Size = cluster.Params.ClusterSize - dbCluster.Spec.LoadBalancer.Resources = resources - dbCluster.Spec.LoadBalancer.Type = "haproxy" - dbCluster.Spec.LoadBalancer.TrafficPolicy = "Cluster" - } - if cluster.Params.Proxysql != nil { - resources, err := convertComputeResource(cluster.Params.Proxysql.ComputeResources) - if err != nil { - return nil, nil, err - } - dbCluster.Spec.LoadBalancer.Size = cluster.Params.ClusterSize - dbCluster.Spec.LoadBalancer.Image = cluster.Params.Proxysql.Image - dbCluster.Spec.LoadBalancer.Resources = resources - dbCluster.Spec.LoadBalancer.Type = "proxysql" - } - if cluster.Params.Backup != nil { - storageName := strings.ToLower(backupLocation.Name) - dbCluster.Spec.Backup.Enabled = true - dbCluster.Spec.Backup.Storages = map[string]*dbaasv1.BackupStorageSpec{ - storageName: { - Type: dbaasv1.BackupStorageType(backupLocation.Type), - StorageProvider: &dbaasv1.BackupStorageProviderSpec{ - Bucket: backupLocation.S3Config.BucketName, - Region: backupLocation.S3Config.BucketRegion, - EndpointURL: backupLocation.S3Config.Endpoint, - CredentialsSecret: fmt.Sprintf("%s-backup", dbCluster.Spec.SecretsName), - }, - }, - } - dbCluster.Spec.Backup.ServiceAccountName = cluster.Params.Backup.ServiceAccount - dbCluster.Spec.Backup.Schedule = []dbaasv1.BackupSchedule{ - { - Name: "schedule", - Enabled: true, - Schedule: cluster.Params.Backup.CronExpression, - Keep: int(cluster.Params.Backup.KeepCopies), - StorageName: storageName, - }, - } - } - if cluster.Expose { - exposeType, ok := exposeTypeMap[clusterType] - if !ok { - return dbCluster, nil, fmt.Errorf("failed to recognize expose type for %s cluster type", clusterType) - } - dbCluster.Spec.LoadBalancer.ExposeType = exposeType - annotations, ok := exposeAnnotationsMap[clusterType] - if !ok { - return dbCluster, nil, fmt.Errorf("failed to recognize expose annotations for %s cluster type", clusterType) - } - dbCluster.Spec.LoadBalancer.Annotations = annotations - if cluster.InternetFacing && clusterType == ClusterTypeEKS { - dbCluster.Spec.LoadBalancer.Annotations["service.beta.kubernetes.io/aws-load-balancer-type"] = externalNLB - } - } - var sourceRanges []string - for _, sourceRange := range cluster.SourceRanges { - if sourceRange != "" { - sourceRanges = append(sourceRanges, sourceRange) - } - } - if len(sourceRanges) != 0 { - dbCluster.Spec.LoadBalancer.LoadBalancerSourceRanges = sourceRanges - } - - if cluster.Template != nil && cluster.Template.Name != "" && cluster.Template.Kind != "" { - if dbCluster.ObjectMeta.Annotations == nil { - dbCluster.ObjectMeta.Annotations = make(map[string]string) - } - dbCluster.ObjectMeta.Annotations[dbTemplateNameAnnotationKey] = cluster.Template.Name - dbCluster.ObjectMeta.Annotations[dbTemplateKindAnnotationKey] = cluster.Template.Kind - } - - if cluster.Params.Restore != nil && cluster.Params.Restore.Destination != "" { - if cluster.Params.Restore.SecretsName != "" { - dbCluster.Spec.SecretsName = cluster.Params.Restore.SecretsName - } - dbCluster.Spec.Backup.Enabled = true - storageName := strings.ToLower(backupLocation.Name) - dbCluster.Spec.Backup.Storages = map[string]*dbaasv1.BackupStorageSpec{ - storageName: { - Type: dbaasv1.BackupStorageType(backupLocation.Type), - StorageProvider: &dbaasv1.BackupStorageProviderSpec{ - Bucket: backupLocation.S3Config.BucketName, - Region: backupLocation.S3Config.BucketRegion, - EndpointURL: backupLocation.S3Config.Endpoint, - CredentialsSecret: fmt.Sprintf("%s-backup", dbCluster.Spec.SecretsName), - }, - }, - } - - dbRestore := &dbaasv1.DatabaseClusterRestore{ - TypeMeta: metav1.TypeMeta{ - Kind: "DatabaseClusterRestore", - APIVersion: "dbaas.percona.com/v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("%s-restore", dbCluster.Name), - }, - Spec: dbaasv1.DatabaseClusterRestoreSpec{ - DatabaseCluster: dbCluster.Name, - DatabaseType: "pxc", - BackupSource: &dbaasv1.BackupSource{ - Destination: cluster.Params.Restore.Destination, - StorageType: dbaasv1.BackupStorageS3, - S3: &dbaasv1.BackupStorageProviderSpec{ - Bucket: backupLocation.S3Config.BucketName, - Region: backupLocation.S3Config.BucketRegion, - EndpointURL: backupLocation.S3Config.Endpoint, - CredentialsSecret: fmt.Sprintf("%s-backup", dbCluster.Spec.SecretsName), - }, - StorageName: storageName, - }, - }, - } - return dbCluster, dbRestore, nil - } - return dbCluster, nil, nil -} - -// DatabaseClusterForPSMDB fills dbaasv1.DatabaseCluster struct with data provided for specified cluster type -func DatabaseClusterForPSMDB(cluster *dbaasv1beta1.CreatePSMDBClusterRequest, clusterType ClusterType, backupLocation *models.BackupLocation, backupImage string) (*dbaasv1.DatabaseCluster, *dbaasv1.DatabaseClusterRestore, error) { //nolint:lll - if backupLocation != nil && backupLocation.Type != models.S3BackupLocationType { - return nil, nil, errors.New("only s3 compatible storages are supported for backup/restore") - } - diskSize := resource.NewQuantity(cluster.Params.Replicaset.DiskSize, resource.DecimalSI) - cpu, err := resource.ParseQuantity(fmt.Sprintf("%dm", cluster.Params.Replicaset.ComputeResources.CpuM)) - if err != nil { - return nil, nil, err - } - clusterMemory := resource.NewQuantity(cluster.Params.Replicaset.ComputeResources.MemoryBytes, resource.DecimalSI) - dbCluster := &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: cluster.Name, - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - }, - Spec: dbaasv1.DatabaseSpec{ - Database: DatabaseTypePSMDB, - DatabaseImage: cluster.Params.Image, - DatabaseConfig: cluster.Params.Replicaset.Configuration, - ClusterSize: cluster.Params.ClusterSize, - SecretsName: fmt.Sprintf(psmdbSecretNameTmpl, cluster.Name), - DBInstance: dbaasv1.DBInstanceSpec{ - DiskSize: *diskSize, - CPU: cpu, - Memory: *clusterMemory, - }, - Monitoring: dbaasv1.MonitoringSpec{ - PMM: &dbaasv1.PMMSpec{}, - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{}, - Backup: &dbaasv1.BackupSpec{}, - }, - } - if cluster.Params.Replicaset.StorageClass != "" { - dbCluster.Spec.DBInstance.StorageClassName = &cluster.Params.Replicaset.StorageClass - } - dbCluster.Spec.LoadBalancer.Size = cluster.Params.ClusterSize - dbCluster.Spec.LoadBalancer.Type = "mongos" - if cluster.Expose { - exposeType, ok := exposeTypeMap[clusterType] - if !ok { - return dbCluster, nil, fmt.Errorf("failed to recognize expose type for %s cluster type", clusterType) - } - dbCluster.Spec.LoadBalancer.ExposeType = exposeType - annotations, ok := exposeAnnotationsMap[clusterType] - if !ok { - return dbCluster, nil, fmt.Errorf("failed to recognize expose annotations for %s cluster type", clusterType) - } - dbCluster.Spec.LoadBalancer.Annotations = annotations - if cluster.InternetFacing && clusterType == ClusterTypeEKS { - dbCluster.Spec.LoadBalancer.Annotations["service.beta.kubernetes.io/aws-load-balancer-type"] = externalNLB - } - } - if cluster.Params.Backup != nil { - dbCluster.Spec.Backup.Enabled = true - if backupImage != "" { - dbCluster.Spec.Backup.Image = backupImage - } - storageName := strings.ToLower(backupLocation.Name) - dbCluster.Spec.Backup.Storages = map[string]*dbaasv1.BackupStorageSpec{ - storageName: { - Type: dbaasv1.BackupStorageType(backupLocation.Type), - StorageProvider: &dbaasv1.BackupStorageProviderSpec{ - Bucket: backupLocation.S3Config.BucketName, - Region: backupLocation.S3Config.BucketRegion, - EndpointURL: backupLocation.S3Config.Endpoint, - CredentialsSecret: fmt.Sprintf("%s-backup", dbCluster.Spec.SecretsName), - }, - }, - } - dbCluster.Spec.Backup.ServiceAccountName = cluster.Params.Backup.ServiceAccount - dbCluster.Spec.Backup.Schedule = []dbaasv1.BackupSchedule{ - { - Name: "schedule", - Enabled: true, - Schedule: cluster.Params.Backup.CronExpression, - Keep: int(cluster.Params.Backup.KeepCopies), - StorageName: storageName, - }, - } - } - var sourceRanges []string - for _, sourceRange := range cluster.SourceRanges { - if sourceRange != "" { - sourceRanges = append(sourceRanges, sourceRange) - } - } - if len(sourceRanges) != 0 { - dbCluster.Spec.LoadBalancer.LoadBalancerSourceRanges = sourceRanges - } - - if cluster.Template != nil && cluster.Template.Name != "" && cluster.Template.Kind != "" { - if dbCluster.ObjectMeta.Annotations == nil { - dbCluster.ObjectMeta.Annotations = make(map[string]string) - } - dbCluster.ObjectMeta.Annotations[dbTemplateNameAnnotationKey] = cluster.Template.Name - dbCluster.ObjectMeta.Annotations[dbTemplateKindAnnotationKey] = cluster.Template.Kind - } - - if cluster.Params.Restore != nil && cluster.Params.Restore.Destination != "" { - if cluster.Params.Restore.SecretsName != "" { - dbCluster.Spec.SecretsName = cluster.Params.Restore.SecretsName - } - dbCluster.Spec.Backup.Enabled = true - storageName := strings.ToLower(backupLocation.Name) - dbCluster.Spec.Backup.Storages = map[string]*dbaasv1.BackupStorageSpec{ - storageName: { - Type: dbaasv1.BackupStorageType(backupLocation.Type), - StorageProvider: &dbaasv1.BackupStorageProviderSpec{ - Bucket: backupLocation.S3Config.BucketName, - Region: backupLocation.S3Config.BucketRegion, - EndpointURL: backupLocation.S3Config.Endpoint, - CredentialsSecret: fmt.Sprintf("%s-backup", dbCluster.Spec.SecretsName), - }, - }, - } - - dbRestore := &dbaasv1.DatabaseClusterRestore{ - TypeMeta: metav1.TypeMeta{ - Kind: "DatabaseClusterRestore", - APIVersion: "dbaas.percona.com/v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("%s-restore", dbCluster.Name), - }, - Spec: dbaasv1.DatabaseClusterRestoreSpec{ - DatabaseCluster: dbCluster.Name, - DatabaseType: "psmdb", - BackupSource: &dbaasv1.BackupSource{ - Destination: cluster.Params.Restore.Destination, - StorageType: dbaasv1.BackupStorageS3, - S3: &dbaasv1.BackupStorageProviderSpec{ - Bucket: backupLocation.S3Config.BucketName, - Region: backupLocation.S3Config.BucketRegion, - EndpointURL: backupLocation.S3Config.Endpoint, - CredentialsSecret: fmt.Sprintf("%s-backup", dbCluster.Spec.SecretsName), - }, - StorageName: storageName, - }, - }, - } - return dbCluster, dbRestore, nil - } - return dbCluster, nil, nil -} - -// UpdatePatchForPSMDB returns a patch to update a database cluster -func UpdatePatchForPSMDB(dbCluster *dbaasv1.DatabaseCluster, updateRequest *dbaasv1beta1.UpdatePSMDBClusterRequest, clusterType ClusterType) error { - if updateRequest.Params.Suspend && updateRequest.Params.Resume { - return errSimultaneous - } - dbCluster.TypeMeta = metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - } - if updateRequest.Template != nil && updateRequest.Template.Name != "" && updateRequest.Template.Kind != "" { - if dbCluster.ObjectMeta.Annotations == nil { - dbCluster.ObjectMeta.Annotations = make(map[string]string) - } - dbCluster.ObjectMeta.Annotations[dbTemplateNameAnnotationKey] = updateRequest.Template.Name - dbCluster.ObjectMeta.Annotations[dbTemplateKindAnnotationKey] = updateRequest.Template.Kind - } else { - delete(dbCluster.ObjectMeta.Annotations, dbTemplateNameAnnotationKey) - delete(dbCluster.ObjectMeta.Annotations, dbTemplateKindAnnotationKey) - } - if updateRequest.Params.ClusterSize > 0 { - dbCluster.Spec.ClusterSize = updateRequest.Params.ClusterSize - } - if updateRequest.Params.Image != "" { - dbCluster.Spec.DatabaseImage = updateRequest.Params.Image - } - //nolint:nestif - if updateRequest.Params.Replicaset != nil { - if updateRequest.Params.Replicaset.ComputeResources != nil { - if updateRequest.Params.Replicaset.ComputeResources.CpuM > 0 { - cpu, err := resource.ParseQuantity(fmt.Sprintf("%dm", updateRequest.Params.Replicaset.ComputeResources.CpuM)) - if err != nil { - return err - } - dbCluster.Spec.DBInstance.CPU = cpu - } - if updateRequest.Params.Replicaset.ComputeResources.MemoryBytes > 0 { - clusterMemory := resource.NewQuantity(updateRequest.Params.Replicaset.ComputeResources.MemoryBytes, resource.DecimalSI) - dbCluster.Spec.DBInstance.Memory = *clusterMemory - } - } - if updateRequest.Params.Replicaset.Configuration != "" { - dbCluster.Spec.DatabaseConfig = updateRequest.Params.Replicaset.Configuration - } - - if updateRequest.Params.Replicaset.StorageClass != "" { - dbCluster.Spec.DBInstance.StorageClassName = &updateRequest.Params.Replicaset.StorageClass - } - } - if updateRequest.Params.Suspend { - dbCluster.Spec.Pause = true - } - if updateRequest.Params.Resume { - dbCluster.Spec.Pause = false - } - if !updateRequest.Expose { - dbCluster.Spec.LoadBalancer.ExposeType = corev1.ServiceTypeClusterIP - } - if updateRequest.Expose { - exposeType, ok := exposeTypeMap[clusterType] - if !ok { - return fmt.Errorf("failed to recognize expose type for %s cluster type", clusterType) - } - dbCluster.Spec.LoadBalancer.ExposeType = exposeType - annotations, ok := exposeAnnotationsMap[clusterType] - if !ok { - return fmt.Errorf("failed to recognize expose annotations for %s cluster type", clusterType) - } - dbCluster.Spec.LoadBalancer.Annotations = annotations - if updateRequest.InternetFacing && clusterType == ClusterTypeEKS { - dbCluster.Spec.LoadBalancer.Annotations["service.beta.kubernetes.io/aws-load-balancer-type"] = externalNLB - } - } - var sourceRanges []string - for _, sourceRange := range updateRequest.SourceRanges { - if sourceRange != "" { - sourceRanges = append(sourceRanges, sourceRange) - } - } - if len(sourceRanges) != 0 { - dbCluster.Spec.LoadBalancer.LoadBalancerSourceRanges = sourceRanges - } - if len(sourceRanges) == 0 && len(dbCluster.Spec.LoadBalancer.LoadBalancerSourceRanges) != 0 { - dbCluster.Spec.LoadBalancer.LoadBalancerSourceRanges = sourceRanges - } - return nil -} - -// UpdatePatchForPXC returns a patch to update a database cluster -func UpdatePatchForPXC(dbCluster *dbaasv1.DatabaseCluster, updateRequest *dbaasv1beta1.UpdatePXCClusterRequest, clusterType ClusterType) error { //nolint:cyclop - if updateRequest.Params.Suspend && updateRequest.Params.Resume { - return errSimultaneous - } - dbCluster.TypeMeta = metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - } - if updateRequest.Template != nil && updateRequest.Template.Name != "" && updateRequest.Template.Kind != "" { - if dbCluster.ObjectMeta.Annotations == nil { - dbCluster.ObjectMeta.Annotations = make(map[string]string) - } - dbCluster.ObjectMeta.Annotations[dbTemplateNameAnnotationKey] = updateRequest.Template.Name - dbCluster.ObjectMeta.Annotations[dbTemplateKindAnnotationKey] = updateRequest.Template.Kind - } else { - delete(dbCluster.ObjectMeta.Annotations, dbTemplateNameAnnotationKey) - delete(dbCluster.ObjectMeta.Annotations, dbTemplateKindAnnotationKey) - } - - if updateRequest.Params.ClusterSize > 0 { - dbCluster.Spec.ClusterSize = updateRequest.Params.ClusterSize - } - if updateRequest.Params.Pxc != nil { - if updateRequest.Params.Pxc.Image != "" { - dbCluster.Spec.DatabaseImage = updateRequest.Params.Pxc.Image - } - if updateRequest.Params.Pxc.Configuration != "" { - dbCluster.Spec.DatabaseConfig = updateRequest.Params.Pxc.Configuration - } - if updateRequest.Params.Pxc.StorageClass != "" { - dbCluster.Spec.DBInstance.StorageClassName = &updateRequest.Params.Pxc.StorageClass - } - } - - if updateRequest.Params.Pxc != nil && updateRequest.Params.Pxc.ComputeResources != nil { - if updateRequest.Params.Pxc.ComputeResources.CpuM > 0 { - cpu, err := resource.ParseQuantity(fmt.Sprintf("%dm", updateRequest.Params.Pxc.ComputeResources.CpuM)) - if err != nil { - return err - } - dbCluster.Spec.DBInstance.CPU = cpu - } - if updateRequest.Params.Pxc.ComputeResources.MemoryBytes > 0 { - clusterMemory := resource.NewQuantity(updateRequest.Params.Pxc.ComputeResources.MemoryBytes, resource.DecimalSI) - dbCluster.Spec.DBInstance.Memory = *clusterMemory - } - } - if updateRequest.Params.Haproxy != nil && updateRequest.Params.Haproxy.ComputeResources != nil { - resources, err := convertComputeResource(updateRequest.Params.Haproxy.ComputeResources) - if err != nil { - return err - } - dbCluster.Spec.LoadBalancer.Resources = resources - } - if updateRequest.Params.Proxysql != nil && updateRequest.Params.Proxysql.ComputeResources != nil { - resources, err := convertComputeResource(updateRequest.Params.Proxysql.ComputeResources) - if err != nil { - return err - } - dbCluster.Spec.LoadBalancer.Resources = resources - } - if updateRequest.Params.Suspend { - dbCluster.Spec.Pause = true - } - if updateRequest.Params.Resume { - dbCluster.Spec.Pause = false - } - if !updateRequest.Expose { - dbCluster.Spec.LoadBalancer.ExposeType = corev1.ServiceTypeClusterIP - } - if updateRequest.Expose { - exposeType, ok := exposeTypeMap[clusterType] - if !ok { - return fmt.Errorf("failed to recognize expose type for %s cluster type", clusterType) - } - dbCluster.Spec.LoadBalancer.ExposeType = exposeType - annotations, ok := exposeAnnotationsMap[clusterType] - if !ok { - return fmt.Errorf("failed to recognize expose annotations for %s cluster type", clusterType) - } - dbCluster.Spec.LoadBalancer.Annotations = annotations - if updateRequest.InternetFacing && clusterType == ClusterTypeEKS { - dbCluster.Spec.LoadBalancer.Annotations["service.beta.kubernetes.io/aws-load-balancer-type"] = externalNLB - } - } - var sourceRanges []string - for _, sourceRange := range updateRequest.SourceRanges { - if sourceRange != "" { - sourceRanges = append(sourceRanges, sourceRange) - } - } - if len(sourceRanges) != 0 { - dbCluster.Spec.LoadBalancer.LoadBalancerSourceRanges = sourceRanges - } - if len(sourceRanges) == 0 && len(dbCluster.Spec.LoadBalancer.LoadBalancerSourceRanges) != 0 { - dbCluster.Spec.LoadBalancer.LoadBalancerSourceRanges = sourceRanges - } - return nil -} - -func SecretForBackup(backupLocation *models.BackupLocation) map[string][]byte { - return map[string][]byte{ - "AWS_ACCESS_KEY_ID": []byte(backupLocation.S3Config.AccessKey), - "AWS_SECRET_ACCESS_KEY": []byte(backupLocation.S3Config.SecretKey), - } -} diff --git a/managed/services/dbaas/kubernetes/types_test.go b/managed/services/dbaas/kubernetes/types_test.go deleted file mode 100644 index 08daf4c349..0000000000 --- a/managed/services/dbaas/kubernetes/types_test.go +++ /dev/null @@ -1,772 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package kubernetes - -import ( - "testing" - - dbaasv1 "github.com/percona/dbaas-operator/api/v1" - "github.com/stretchr/testify/assert" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - "github.com/percona/pmm/managed/models" -) - -func TestDatabaseClusterForPXC(t *testing.T) { - t.Parallel() - testCases := []struct { - name string - input *dbaasv1beta1.CreatePXCClusterRequest - clusterType ClusterType - expected *dbaasv1.DatabaseCluster - }{ - { - name: "Basic PXC cluster with ProxySQL", - input: &dbaasv1beta1.CreatePXCClusterRequest{ - Name: "test-pxc-whatever", - Expose: false, - InternetFacing: false, - SourceRanges: []string{}, - Params: &dbaasv1beta1.PXCClusterParams{ - ClusterSize: 1, - Pxc: &dbaasv1beta1.PXCClusterParams_PXC{ - Image: "pxc_image", - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 200, - MemoryBytes: 2000, - }, - DiskSize: 2000, - Configuration: "", - StorageClass: "", - }, - Proxysql: &dbaasv1beta1.PXCClusterParams_ProxySQL{ - Image: "something", - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 100, - MemoryBytes: 100, - }, - DiskSize: 100, - }, - }, - }, - clusterType: ClusterTypeGeneric, - expected: &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pxc-whatever", - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - }, - Spec: dbaasv1.DatabaseSpec{ - Database: DatabaseTypePXC, - DatabaseImage: "pxc_image", - DatabaseConfig: "", - ClusterSize: 1, - SecretsName: "dbaas-test-pxc-whatever-pxc-secrets", - DBInstance: dbaasv1.DBInstanceSpec{ - DiskSize: resource.MustParse("2000"), - CPU: resource.MustParse("200m"), - Memory: resource.MustParse("2000"), - }, - Monitoring: dbaasv1.MonitoringSpec{ - PMM: &dbaasv1.PMMSpec{}, - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "proxysql", - Image: "something", - Size: 1, - Configuration: "", - Resources: corev1.ResourceRequirements{ - Limits: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("100"), - corev1.ResourceCPU: resource.MustParse("100m"), - }, - }, - LoadBalancerSourceRanges: nil, - }, - Backup: &dbaasv1.BackupSpec{}, - }, - }, - }, - { - name: "Basic PXC cluster with HAProxy", - input: &dbaasv1beta1.CreatePXCClusterRequest{ - Name: "test-pxc-whatever", - Expose: false, - InternetFacing: false, - SourceRanges: []string{}, - Params: &dbaasv1beta1.PXCClusterParams{ - ClusterSize: 1, - Pxc: &dbaasv1beta1.PXCClusterParams_PXC{ - Image: "pxc_image", - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 200, - MemoryBytes: 2000, - }, - DiskSize: 2000, - Configuration: "", - StorageClass: "", - }, - Haproxy: &dbaasv1beta1.PXCClusterParams_HAProxy{ - Image: "something", - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 100, - MemoryBytes: 100, - }, - }, - }, - }, - clusterType: ClusterTypeGeneric, - expected: &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pxc-whatever", - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - }, - Spec: dbaasv1.DatabaseSpec{ - Database: DatabaseTypePXC, - DatabaseImage: "pxc_image", - DatabaseConfig: "", - ClusterSize: 1, - SecretsName: "dbaas-test-pxc-whatever-pxc-secrets", - DBInstance: dbaasv1.DBInstanceSpec{ - DiskSize: resource.MustParse("2000"), - CPU: resource.MustParse("200m"), - Memory: resource.MustParse("2000"), - }, - Monitoring: dbaasv1.MonitoringSpec{ - PMM: &dbaasv1.PMMSpec{}, - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "haproxy", - Image: "something", - Size: 1, - Configuration: "", - TrafficPolicy: "Cluster", - Resources: corev1.ResourceRequirements{ - Limits: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("100"), - corev1.ResourceCPU: resource.MustParse("100m"), - }, - }, - LoadBalancerSourceRanges: nil, - }, - Backup: &dbaasv1.BackupSpec{}, - }, - }, - }, - { - name: "Basic PXC cluster with HAProxy without compute resources", - input: &dbaasv1beta1.CreatePXCClusterRequest{ - Name: "test-pxc-whatever", - Expose: false, - InternetFacing: false, - SourceRanges: []string{}, - Params: &dbaasv1beta1.PXCClusterParams{ - ClusterSize: 1, - Pxc: &dbaasv1beta1.PXCClusterParams_PXC{ - Image: "pxc_image", - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 200, - MemoryBytes: 2000, - }, - DiskSize: 2000, - Configuration: "", - StorageClass: "", - }, - Haproxy: &dbaasv1beta1.PXCClusterParams_HAProxy{ - Image: "something", - }, - }, - }, - clusterType: ClusterTypeGeneric, - expected: &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pxc-whatever", - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - }, - Spec: dbaasv1.DatabaseSpec{ - Database: DatabaseTypePXC, - DatabaseImage: "pxc_image", - DatabaseConfig: "", - ClusterSize: 1, - SecretsName: "dbaas-test-pxc-whatever-pxc-secrets", - DBInstance: dbaasv1.DBInstanceSpec{ - DiskSize: resource.MustParse("2000"), - CPU: resource.MustParse("200m"), - Memory: resource.MustParse("2000"), - }, - Monitoring: dbaasv1.MonitoringSpec{ - PMM: &dbaasv1.PMMSpec{}, - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "haproxy", - Image: "something", - Size: 1, - Configuration: "", - TrafficPolicy: "Cluster", - LoadBalancerSourceRanges: nil, - }, - Backup: &dbaasv1.BackupSpec{}, - }, - }, - }, - { - name: "Basic exposed PXC cluster with HAProxy (EKS)", - input: &dbaasv1beta1.CreatePXCClusterRequest{ - Name: "test-pxc-whatever", - Expose: true, - InternetFacing: false, - SourceRanges: []string{}, - Params: &dbaasv1beta1.PXCClusterParams{ - ClusterSize: 1, - Pxc: &dbaasv1beta1.PXCClusterParams_PXC{ - Image: "pxc_image", - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 200, - MemoryBytes: 2000, - }, - DiskSize: 2000, - Configuration: "", - StorageClass: "", - }, - Haproxy: &dbaasv1beta1.PXCClusterParams_HAProxy{ - Image: "something", - }, - }, - }, - clusterType: ClusterTypeEKS, - expected: &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pxc-whatever", - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - }, - Spec: dbaasv1.DatabaseSpec{ - Database: DatabaseTypePXC, - DatabaseImage: "pxc_image", - DatabaseConfig: "", - ClusterSize: 1, - SecretsName: "dbaas-test-pxc-whatever-pxc-secrets", - DBInstance: dbaasv1.DBInstanceSpec{ - DiskSize: resource.MustParse("2000"), - CPU: resource.MustParse("200m"), - Memory: resource.MustParse("2000"), - }, - Monitoring: dbaasv1.MonitoringSpec{ - PMM: &dbaasv1.PMMSpec{}, - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "haproxy", - ExposeType: corev1.ServiceTypeLoadBalancer, - Annotations: map[string]string{ - "service.beta.kubernetes.io/aws-load-balancer-nlb-target-type": "ip", - "service.beta.kubernetes.io/aws-load-balancer-scheme": "internet-facing", - "service.beta.kubernetes.io/aws-load-balancer-target-group-attributes": "preserve_client_ip.enabled=true", - }, - - Image: "something", - Size: 1, - Configuration: "", - TrafficPolicy: "Cluster", - LoadBalancerSourceRanges: nil, - }, - Backup: &dbaasv1.BackupSpec{}, - }, - }, - }, - { - name: "Basic exposed PXC cluster with HAProxy and internet facing", - input: &dbaasv1beta1.CreatePXCClusterRequest{ - Name: "test-pxc-whatever", - Expose: true, - InternetFacing: true, - SourceRanges: []string{}, - Params: &dbaasv1beta1.PXCClusterParams{ - ClusterSize: 1, - Pxc: &dbaasv1beta1.PXCClusterParams_PXC{ - Image: "pxc_image", - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 200, - MemoryBytes: 2000, - }, - DiskSize: 2000, - Configuration: "", - StorageClass: "", - }, - Haproxy: &dbaasv1beta1.PXCClusterParams_HAProxy{ - Image: "something", - }, - }, - }, - clusterType: ClusterTypeEKS, - expected: &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pxc-whatever", - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - }, - Spec: dbaasv1.DatabaseSpec{ - Database: DatabaseTypePXC, - DatabaseImage: "pxc_image", - DatabaseConfig: "", - ClusterSize: 1, - SecretsName: "dbaas-test-pxc-whatever-pxc-secrets", - DBInstance: dbaasv1.DBInstanceSpec{ - DiskSize: resource.MustParse("2000"), - CPU: resource.MustParse("200m"), - Memory: resource.MustParse("2000"), - }, - Monitoring: dbaasv1.MonitoringSpec{ - PMM: &dbaasv1.PMMSpec{}, - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "haproxy", - ExposeType: corev1.ServiceTypeLoadBalancer, - Image: "something", - Size: 1, - Configuration: "", - TrafficPolicy: "Cluster", - LoadBalancerSourceRanges: nil, - Annotations: map[string]string{ - "service.beta.kubernetes.io/aws-load-balancer-nlb-target-type": "ip", - "service.beta.kubernetes.io/aws-load-balancer-scheme": "internet-facing", - "service.beta.kubernetes.io/aws-load-balancer-target-group-attributes": "preserve_client_ip.enabled=true", - "service.beta.kubernetes.io/aws-load-balancer-type": "external", - }, - }, - Backup: &dbaasv1.BackupSpec{}, - }, - }, - }, - { - name: "Basic exposed PXC cluster with HAProxy", - input: &dbaasv1beta1.CreatePXCClusterRequest{ - Name: "test-pxc-whatever", - Expose: true, - InternetFacing: false, - SourceRanges: []string{}, - Params: &dbaasv1beta1.PXCClusterParams{ - ClusterSize: 1, - Pxc: &dbaasv1beta1.PXCClusterParams_PXC{ - Image: "pxc_image", - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 200, - MemoryBytes: 2000, - }, - DiskSize: 2000, - Configuration: "", - StorageClass: "", - }, - Haproxy: &dbaasv1beta1.PXCClusterParams_HAProxy{ - Image: "something", - }, - }, - }, - clusterType: ClusterTypeGeneric, - expected: &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pxc-whatever", - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - }, - Spec: dbaasv1.DatabaseSpec{ - Database: DatabaseTypePXC, - DatabaseImage: "pxc_image", - DatabaseConfig: "", - ClusterSize: 1, - SecretsName: "dbaas-test-pxc-whatever-pxc-secrets", - DBInstance: dbaasv1.DBInstanceSpec{ - DiskSize: resource.MustParse("2000"), - CPU: resource.MustParse("200m"), - Memory: resource.MustParse("2000"), - }, - Monitoring: dbaasv1.MonitoringSpec{ - PMM: &dbaasv1.PMMSpec{}, - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "haproxy", - ExposeType: corev1.ServiceTypeLoadBalancer, - Image: "something", - Size: 1, - Configuration: "", - TrafficPolicy: "Cluster", - LoadBalancerSourceRanges: nil, - Annotations: make(map[string]string), - }, - Backup: &dbaasv1.BackupSpec{}, - }, - }, - }, - } - for _, testCase := range testCases { - tt := testCase - cluster, _, err := DatabaseClusterForPXC(tt.input, tt.clusterType, &models.BackupLocation{Type: models.S3BackupLocationType}) - assert.NoError(t, err, tt.name) - assert.Equal(t, tt.expected, cluster, tt.name) - } -} - -func TestUpdatePatchForPXC(t *testing.T) { - t.Parallel() - storageClass := "gp2" - testCases := []struct { - name string - updateRequest *dbaasv1beta1.UpdatePXCClusterRequest - cluster *dbaasv1.DatabaseCluster - expected *dbaasv1.DatabaseCluster - }{ - { - name: "Empty update does not update anything", - cluster: &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pxc-whatever", - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - }, - Spec: dbaasv1.DatabaseSpec{ - Database: DatabaseTypePXC, - DatabaseImage: "pxc_image", - DatabaseConfig: "", - ClusterSize: 1, - DBInstance: dbaasv1.DBInstanceSpec{ - DiskSize: resource.MustParse("2000"), - CPU: resource.MustParse("200m"), - Memory: resource.MustParse("2000"), - }, - Monitoring: dbaasv1.MonitoringSpec{ - PMM: &dbaasv1.PMMSpec{}, - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "haproxy", - ExposeType: corev1.ServiceTypeClusterIP, - Image: "something", - Size: 1, - Configuration: "", - LoadBalancerSourceRanges: nil, - Annotations: make(map[string]string), - }, - Backup: &dbaasv1.BackupSpec{}, - }, - }, - expected: &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pxc-whatever", - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - }, - Spec: dbaasv1.DatabaseSpec{ - Database: DatabaseTypePXC, - DatabaseImage: "pxc_image", - DatabaseConfig: "", - ClusterSize: 1, - DBInstance: dbaasv1.DBInstanceSpec{ - DiskSize: resource.MustParse("2000"), - CPU: resource.MustParse("200m"), - Memory: resource.MustParse("2000"), - }, - Monitoring: dbaasv1.MonitoringSpec{ - PMM: &dbaasv1.PMMSpec{}, - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "haproxy", - ExposeType: corev1.ServiceTypeClusterIP, - Image: "something", - Size: 1, - Configuration: "", - LoadBalancerSourceRanges: nil, - Annotations: make(map[string]string), - }, - Backup: &dbaasv1.BackupSpec{}, - }, - }, - updateRequest: &dbaasv1beta1.UpdatePXCClusterRequest{ - Params: &dbaasv1beta1.UpdatePXCClusterRequest_UpdatePXCClusterParams{}, - }, - }, - { - name: "Pause cluster", - cluster: &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pxc-whatever", - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - }, - Spec: dbaasv1.DatabaseSpec{ - Database: DatabaseTypePXC, - DatabaseImage: "pxc_image", - DatabaseConfig: "", - ClusterSize: 1, - DBInstance: dbaasv1.DBInstanceSpec{ - DiskSize: resource.MustParse("2000"), - CPU: resource.MustParse("200m"), - Memory: resource.MustParse("2000"), - }, - Monitoring: dbaasv1.MonitoringSpec{ - PMM: &dbaasv1.PMMSpec{}, - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "haproxy", - ExposeType: corev1.ServiceTypeClusterIP, - Image: "something", - Size: 1, - Configuration: "", - LoadBalancerSourceRanges: nil, - Annotations: make(map[string]string), - }, - Backup: &dbaasv1.BackupSpec{}, - }, - }, - expected: &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pxc-whatever", - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - }, - Spec: dbaasv1.DatabaseSpec{ - Database: DatabaseTypePXC, - DatabaseImage: "pxc_image", - DatabaseConfig: "", - ClusterSize: 1, - Pause: true, - DBInstance: dbaasv1.DBInstanceSpec{ - DiskSize: resource.MustParse("2000"), - CPU: resource.MustParse("200m"), - Memory: resource.MustParse("2000"), - }, - Monitoring: dbaasv1.MonitoringSpec{ - PMM: &dbaasv1.PMMSpec{}, - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "haproxy", - ExposeType: corev1.ServiceTypeClusterIP, - Image: "something", - Size: 1, - Configuration: "", - LoadBalancerSourceRanges: nil, - Annotations: make(map[string]string), - }, - Backup: &dbaasv1.BackupSpec{}, - }, - }, - updateRequest: &dbaasv1beta1.UpdatePXCClusterRequest{ - Params: &dbaasv1beta1.UpdatePXCClusterRequest_UpdatePXCClusterParams{ - Suspend: true, - }, - }, - }, - { - name: "Resume cluster", - cluster: &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pxc-whatever", - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - }, - Spec: dbaasv1.DatabaseSpec{ - Database: DatabaseTypePXC, - DatabaseImage: "pxc_image", - Pause: true, - DatabaseConfig: "", - ClusterSize: 1, - DBInstance: dbaasv1.DBInstanceSpec{ - DiskSize: resource.MustParse("2000"), - CPU: resource.MustParse("200m"), - Memory: resource.MustParse("2000"), - }, - Monitoring: dbaasv1.MonitoringSpec{ - PMM: &dbaasv1.PMMSpec{}, - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "haproxy", - ExposeType: corev1.ServiceTypeClusterIP, - Image: "something", - Size: 1, - Configuration: "", - LoadBalancerSourceRanges: nil, - Annotations: make(map[string]string), - }, - Backup: &dbaasv1.BackupSpec{}, - }, - }, - expected: &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pxc-whatever", - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - }, - Spec: dbaasv1.DatabaseSpec{ - Database: DatabaseTypePXC, - DatabaseImage: "pxc_image", - DatabaseConfig: "", - ClusterSize: 1, - DBInstance: dbaasv1.DBInstanceSpec{ - DiskSize: resource.MustParse("2000"), - CPU: resource.MustParse("200m"), - Memory: resource.MustParse("2000"), - }, - Monitoring: dbaasv1.MonitoringSpec{ - PMM: &dbaasv1.PMMSpec{}, - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "haproxy", - ExposeType: corev1.ServiceTypeClusterIP, - Image: "something", - Size: 1, - Configuration: "", - LoadBalancerSourceRanges: nil, - Annotations: make(map[string]string), - }, - Backup: &dbaasv1.BackupSpec{}, - }, - }, - updateRequest: &dbaasv1beta1.UpdatePXCClusterRequest{ - Params: &dbaasv1beta1.UpdatePXCClusterRequest_UpdatePXCClusterParams{ - Resume: true, - }, - }, - }, - { - name: "Update Cluster", - cluster: &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pxc-whatever", - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - }, - Spec: dbaasv1.DatabaseSpec{ - Database: DatabaseTypePXC, - DatabaseImage: "pxc_image", - DatabaseConfig: "", - ClusterSize: 1, - DBInstance: dbaasv1.DBInstanceSpec{ - DiskSize: resource.MustParse("2000"), - CPU: resource.MustParse("200m"), - Memory: resource.MustParse("2000"), - }, - Monitoring: dbaasv1.MonitoringSpec{ - PMM: &dbaasv1.PMMSpec{}, - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "haproxy", - ExposeType: corev1.ServiceTypeClusterIP, - Image: "something", - Size: 1, - Configuration: "", - LoadBalancerSourceRanges: nil, - Annotations: make(map[string]string), - }, - Backup: &dbaasv1.BackupSpec{}, - }, - }, - expected: &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pxc-whatever", - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: dbaasAPI, - Kind: dbaasKind, - }, - Spec: dbaasv1.DatabaseSpec{ - Database: DatabaseTypePXC, - DatabaseImage: "updatedImage", - DatabaseConfig: "", - ClusterSize: 3, - DBInstance: dbaasv1.DBInstanceSpec{ - DiskSize: resource.MustParse("2000"), - CPU: resource.MustParse("300m"), - Memory: resource.MustParse("3000"), - StorageClassName: &storageClass, - }, - Monitoring: dbaasv1.MonitoringSpec{ - PMM: &dbaasv1.PMMSpec{}, - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "haproxy", - ExposeType: corev1.ServiceTypeClusterIP, - Image: "something", - Size: 1, - Configuration: "", - LoadBalancerSourceRanges: nil, - Annotations: make(map[string]string), - Resources: corev1.ResourceRequirements{ - Limits: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("200"), - corev1.ResourceCPU: resource.MustParse("200m"), - }, - }, - }, - Backup: &dbaasv1.BackupSpec{}, - }, - }, - updateRequest: &dbaasv1beta1.UpdatePXCClusterRequest{ - Params: &dbaasv1beta1.UpdatePXCClusterRequest_UpdatePXCClusterParams{ - ClusterSize: 3, - Pxc: &dbaasv1beta1.UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC{ - Image: "updatedImage", - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 300, - MemoryBytes: 3000, - }, - StorageClass: "gp2", - }, - Haproxy: &dbaasv1beta1.UpdatePXCClusterRequest_UpdatePXCClusterParams_HAProxy{ - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 200, - MemoryBytes: 200, - }, - }, - }, - }, - }, - } - - for _, testCase := range testCases { - tt := testCase - err := UpdatePatchForPXC(tt.cluster, tt.updateRequest, ClusterTypeGeneric) - assert.NoError(t, err) - assert.Equal(t, tt.expected, tt.cluster) - } -} diff --git a/managed/services/dbaas/utils/convertors/convertors.go b/managed/services/dbaas/utils/convertors/convertors.go deleted file mode 100644 index a7f3d2f55d..0000000000 --- a/managed/services/dbaas/utils/convertors/convertors.go +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -// Package convertors provides data size convert functinality. -package convertors - -import ( - "math" - "strconv" - "strings" - "unicode" - - "github.com/pkg/errors" -) - -const ( - kiloByte uint64 = 1000 - kibiByte uint64 = 1024 - megaByte uint64 = kiloByte * 1000 - mibiByte uint64 = kibiByte * 1024 - gigaByte uint64 = megaByte * 1000 - gibiByte uint64 = mibiByte * 1024 - teraByte uint64 = gigaByte * 1000 - tebiByte uint64 = gibiByte * 1024 - petaByte uint64 = teraByte * 1000 - pebiByte uint64 = tebiByte * 1024 - exaByte uint64 = petaByte * 1000 - exbiByte uint64 = pebiByte * 1024 -) - -// StrToBytes converts string containing memory as string to number of bytes the string represents. -func StrToBytes(memory string) (uint64, error) { - if len(memory) == 0 { - return 0, nil - } - i := len(memory) - 1 - for i >= 0 && !unicode.IsDigit(rune(memory[i])) { - i-- - } - var suffix string - if i >= 0 { - suffix = memory[i+1:] - } - - // Resources units map for k8s - // - // Supports the following units - // https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory - // - // Support of 'm' unit can be redundant because it's used for CPU limits mostly - suffixMapping := map[string]float64{ - "m": 0.001, - "k": float64(kiloByte), - "Ki": float64(kibiByte), - "M": float64(megaByte), - "Mi": float64(mibiByte), - "G": float64(gigaByte), - "Gi": float64(gibiByte), - "T": float64(teraByte), - "Ti": float64(tebiByte), - "P": float64(petaByte), - "Pi": float64(pebiByte), - "E": float64(exaByte), - "Ei": float64(exbiByte), - "": 1.0, - } - coeficient, ok := suffixMapping[suffix] - if !ok { - return 0, errors.Errorf("suffix '%s' is not supported", suffix) - } - - if suffix != "" { - memory = memory[:i+1] - } - value, err := strconv.ParseFloat(memory, 64) - if err != nil { - return 0, errors.Errorf("given value '%s' is not a number", memory) - } - return uint64(math.Ceil(value * coeficient)), nil -} - -// StrToMilliCPU converts CPU as a string representation to millicpus represented as an integer. -func StrToMilliCPU(cpu string) (uint64, error) { - if cpu == "" { - return 0, nil - } - if strings.HasSuffix(cpu, "m") { - cpu = cpu[:len(cpu)-1] - millis, err := strconv.ParseUint(cpu, 10, 64) - if err != nil { - return 0, err - } - return millis, nil - } - floatCPU, err := strconv.ParseFloat(cpu, 64) - if err != nil { - return 0, err - } - return uint64(floatCPU * 1000), nil -} - -// BytesToStr converts integer of bytes to string. -func BytesToStr(i int64) string { - return strconv.FormatInt(i, 10) -} - -// MilliCPUToStr converts integer of milli CPU to string. -func MilliCPUToStr(i int32) string { - return strconv.FormatInt(int64(i), 10) + "m" -} diff --git a/managed/services/dbaas/utils/convertors/convertors_test.go b/managed/services/dbaas/utils/convertors/convertors_test.go deleted file mode 100644 index d3eefec788..0000000000 --- a/managed/services/dbaas/utils/convertors/convertors_test.go +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package convertors - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestConvertToCPUMillis(t *testing.T) { - t.Parallel() - testCases := []struct { - in string - expectedOut uint64 - errShouldBeNil bool - }{ - {in: "100m", expectedOut: 100, errShouldBeNil: true}, - {in: "1", expectedOut: 1000, errShouldBeNil: true}, - {in: "1.252", expectedOut: 1252, errShouldBeNil: true}, - {in: "0.252", expectedOut: 252, errShouldBeNil: true}, - {in: "0.0", expectedOut: 0, errShouldBeNil: true}, - {in: "0.", expectedOut: 0, errShouldBeNil: true}, - {in: ".0", expectedOut: 0, errShouldBeNil: true}, - {in: ".", expectedOut: 0, errShouldBeNil: false}, - {in: "", expectedOut: 0, errShouldBeNil: true}, - {in: "adf", expectedOut: 0, errShouldBeNil: false}, - } - - for _, test := range testCases { - out, err := StrToMilliCPU(test.in) - assert.Equal(t, test.expectedOut, out, "in=%v, out=%v, err=%v", test.in, out, err) - assert.Equal( - t, test.errShouldBeNil, err == nil, - "in=%v, out=%v, errShouldBeNil=%v: actually err == nil is %v\nerr=%v", - test.in, out, test.errShouldBeNil, err == nil, err) - } -} - -func TestConvertToBytes(t *testing.T) { - t.Parallel() - testCases := []struct { - in string - expectedOut uint64 - errShouldBeNil bool - }{ - {in: "3000m", expectedOut: 3, errShouldBeNil: true}, - {in: "100M", expectedOut: 100 * 1000 * 1000, errShouldBeNil: true}, - {in: "100Mi", expectedOut: 100 * 1024 * 1024, errShouldBeNil: true}, - {in: "100", expectedOut: 100, errShouldBeNil: true}, - {in: "1G", expectedOut: 1000 * 1000 * 1000, errShouldBeNil: true}, - {in: "1Gi", expectedOut: 1024 * 1024 * 1024, errShouldBeNil: true}, - {in: "0.5Gi", expectedOut: 1024 * 1024 * 1024 / 2, errShouldBeNil: true}, - {in: "0.3Gi", expectedOut: 322122548, errShouldBeNil: true}, - {in: "Gi", expectedOut: 0, errShouldBeNil: false}, - {in: "", expectedOut: 0, errShouldBeNil: true}, - {in: "1Z", expectedOut: 0, errShouldBeNil: false}, - {in: "1Ki", expectedOut: 1024, errShouldBeNil: true}, - {in: "1k", expectedOut: 1000, errShouldBeNil: true}, - {in: "1T", expectedOut: 1000 * 1000 * 1000 * 1000, errShouldBeNil: true}, - {in: "1Ti", expectedOut: 1024 * 1024 * 1024 * 1024, errShouldBeNil: true}, - {in: "1P", expectedOut: 1000 * 1000 * 1000 * 1000 * 1000, errShouldBeNil: true}, - {in: "1Pi", expectedOut: 1024 * 1024 * 1024 * 1024 * 1024, errShouldBeNil: true}, - {in: "1E", expectedOut: 1000 * 1000 * 1000 * 1000 * 1000 * 1000, errShouldBeNil: true}, - {in: "1Ei", expectedOut: 1024 * 1024 * 1024 * 1024 * 1024 * 1024, errShouldBeNil: true}, - } - - for _, test := range testCases { - out, err := StrToBytes(test.in) - assert.Equal(t, test.expectedOut, out, "in=%v, out=%v, err=%v", test.in, out, err) - assert.Equal( - t, test.errShouldBeNil, err == nil, - "in=%v, out=%v, errShouldBeNil=%v: actually err == nil is %v\nerr=%v", - test.in, out, test.errShouldBeNil, err == nil, err) - } -} diff --git a/managed/services/management/dbaas/components_service.go b/managed/services/management/dbaas/components_service.go deleted file mode 100644 index e33497aabe..0000000000 --- a/managed/services/management/dbaas/components_service.go +++ /dev/null @@ -1,554 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package dbaas - -import ( - "context" - "fmt" - "os" - "regexp" - "sync" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/client" - goversion "github.com/hashicorp/go-version" - "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "gopkg.in/reform.v1" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/stringset" - pmmversion "github.com/percona/pmm/version" -) - -const ( - psmdbOperatorName = "percona-server-mongodb-operator" - pxcOperatorName = "percona-xtradb-cluster-operator" - defaultNamespace = "default" - // Dev-latest docker image. - devLatest = "perconalab/pmm-client:dev-latest" -) - -// ComponentsService holds unexported fields and public methods to handle Components Service. -type ComponentsService struct { - l *logrus.Entry - db *reform.DB - dbaasClient dbaasClient - // kubeStorage *KubeStorage - versionServiceClient versionService - kubeStorage kubeStorageManager - - dbaasv1beta1.UnimplementedComponentsServer -} - -type installedComponentsVersion struct { - kuberentesClusterName string - pxcOperatorVersion string - psmdbOperatorVersion string -} - -// NewComponentsService creates Components Service. -func NewComponentsService(db *reform.DB, dbaasClient dbaasClient, versionServiceClient versionService, kubeStorage kubeStorageManager) *ComponentsService { - l := logrus.WithField("component", "components_service") - return &ComponentsService{ - l: l, - db: db, - dbaasClient: dbaasClient, - // kubeStorage: NewKubeStorage(db), - versionServiceClient: versionServiceClient, - kubeStorage: kubeStorage, - } -} - -// Enabled returns if service is enabled and can be used. -func (c *ComponentsService) Enabled() bool { - settings, err := models.GetSettings(c.db) - if err != nil { - c.l.WithError(err).Error("can't get settings") - return false - } - return settings.DBaaS.Enabled -} - -// GetPSMDBComponents retrieves all PSMDB components for a specific cluster. -func (c ComponentsService) GetPSMDBComponents(ctx context.Context, req *dbaasv1beta1.GetPSMDBComponentsRequest) (*dbaasv1beta1.GetPSMDBComponentsResponse, error) { - var kubernetesCluster *models.KubernetesCluster - params := componentsParams{ - product: psmdbOperator, - dbVersion: req.DbVersion, - } - if req.KubernetesClusterName != "" { - var err error - kubernetesCluster, err = models.FindKubernetesClusterByName(c.db.Querier, req.KubernetesClusterName) - if err != nil { - return nil, err - } - kubeClient, err := c.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, err - } - psmdbVersion, err := kubeClient.GetPSMDBOperatorVersion(ctx) - if err != nil { - return nil, err - } - - params.productVersion = psmdbVersion - } - - versions, err := c.versions(ctx, params, kubernetesCluster) - if err != nil { - return nil, err - } - return &dbaasv1beta1.GetPSMDBComponentsResponse{Versions: versions}, nil -} - -func (c ComponentsService) GetPXCComponents(ctx context.Context, req *dbaasv1beta1.GetPXCComponentsRequest) (*dbaasv1beta1.GetPXCComponentsResponse, error) { - var kubernetesCluster *models.KubernetesCluster - params := componentsParams{ - product: pxcOperator, - dbVersion: req.DbVersion, - } - if req.KubernetesClusterName != "" { - var err error - kubernetesCluster, err = models.FindKubernetesClusterByName(c.db.Querier, req.KubernetesClusterName) - if err != nil { - return nil, err - } - kubeClient, err := c.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, err - } - pxcVersion, err := kubeClient.GetPXCOperatorVersion(ctx) - if err != nil { - return nil, err - } - - params.productVersion = pxcVersion - } - - versions, err := c.versions(ctx, params, kubernetesCluster) - if err != nil { - return nil, err - } - return &dbaasv1beta1.GetPXCComponentsResponse{Versions: versions}, nil -} - -func (c ComponentsService) ChangePSMDBComponents(_ context.Context, req *dbaasv1beta1.ChangePSMDBComponentsRequest) (*dbaasv1beta1.ChangePSMDBComponentsResponse, error) { - err := c.db.InTransaction(func(tx *reform.TX) error { - kubernetesCluster, e := models.FindKubernetesClusterByName(tx.Querier, req.KubernetesClusterName) - if e != nil { - return e - } - - if req.Mongod != nil { - kubernetesCluster.Mongod, e = setComponent(kubernetesCluster.Mongod, req.Mongod) - if e != nil { - message := fmt.Sprintf("%s, cluster: %s, component: mongod", e.Error(), kubernetesCluster.KubernetesClusterName) - return status.Errorf(codes.InvalidArgument, message) - } - } - - e = tx.Save(kubernetesCluster) - if e != nil { - return e - } - - return nil - }) - if err != nil { - return nil, err - } - - return &dbaasv1beta1.ChangePSMDBComponentsResponse{}, nil -} - -func (c ComponentsService) ChangePXCComponents(ctx context.Context, req *dbaasv1beta1.ChangePXCComponentsRequest) (*dbaasv1beta1.ChangePXCComponentsResponse, error) { - err := c.db.InTransaction(func(tx *reform.TX) error { - kubernetesCluster, e := models.FindKubernetesClusterByName(tx.Querier, req.KubernetesClusterName) - if e != nil { - return e - } - - if req.Pxc != nil { - kubernetesCluster.PXC, e = setComponent(kubernetesCluster.PXC, req.Pxc) - if e != nil { - message := fmt.Sprintf("%s, cluster: %s, component: pxc", e.Error(), kubernetesCluster.KubernetesClusterName) - return status.Errorf(codes.InvalidArgument, message) - } - } - - if req.Proxysql != nil { - kubernetesCluster.ProxySQL, e = setComponent(kubernetesCluster.ProxySQL, req.Proxysql) - if e != nil { - message := fmt.Sprintf("%s, cluster: %s, component: proxySQL", e.Error(), kubernetesCluster.KubernetesClusterName) - return status.Errorf(codes.InvalidArgument, message) - } - } - - if req.Haproxy != nil { - kubernetesCluster.HAProxy, e = setComponent(kubernetesCluster.HAProxy, req.Haproxy) - if e != nil { - message := fmt.Sprintf("%s, cluster: %s, component: HAProxy", e.Error(), kubernetesCluster.KubernetesClusterName) - return status.Errorf(codes.InvalidArgument, message) - } - } - e = tx.Save(kubernetesCluster) - if e != nil { - return e - } - - return nil - }) - if err != nil { - return nil, err - } - - return &dbaasv1beta1.ChangePXCComponentsResponse{}, nil -} - -func (c ComponentsService) installedOperatorsVersion(ctx context.Context, wg *sync.WaitGroup, responseCh chan installedComponentsVersion, kuberentesCluster *models.KubernetesCluster) { //nolint:lll - defer wg.Done() - kubeClient, err := c.kubeStorage.GetOrSetClient(kuberentesCluster.KubernetesClusterName) - if err != nil { - c.l.Errorf("failed to check get kubernetes client: %v", err) - responseCh <- installedComponentsVersion{ - kuberentesClusterName: kuberentesCluster.KubernetesClusterName, - } - return - } - psmdbVersion, err := kubeClient.GetPSMDBOperatorVersion(ctx) - if err != nil { - c.l.Errorf("failed to get psmdb operator version: %v", err) - } - pxcVersion, err := kubeClient.GetPXCOperatorVersion(ctx) - if err != nil { - c.l.Errorf("failed to get pxc operator version: %v", err) - } - - responseCh <- installedComponentsVersion{ - kuberentesClusterName: kuberentesCluster.KubernetesClusterName, - pxcOperatorVersion: psmdbVersion, - psmdbOperatorVersion: pxcVersion, - } -} - -func (c ComponentsService) CheckForOperatorUpdate(ctx context.Context, _ *dbaasv1beta1.CheckForOperatorUpdateRequest) (*dbaasv1beta1.CheckForOperatorUpdateResponse, error) { //nolint:lll - if pmmversion.PMMVersion == "" { - return nil, status.Error(codes.Internal, "failed to get current PMM version") - } - - // List all kuberenetes clusters. - clusters, err := models.FindAllKubernetesClusters(c.db.Querier) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - // And get operators version from all of them. - responseCh := make(chan installedComponentsVersion, len(clusters)) - go func() { - wg := &sync.WaitGroup{} - wg.Add(len(clusters)) - for _, cluster := range clusters { - k8sCluster := cluster - go c.installedOperatorsVersion(ctx, wg, responseCh, k8sCluster) - } - wg.Wait() - close(responseCh) - }() - - resp := &dbaasv1beta1.CheckForOperatorUpdateResponse{ - ClusterToComponents: make(map[string]*dbaasv1beta1.ComponentsUpdateInformation), - } - - for _, cluster := range clusters { - kubeClient, err := c.kubeStorage.GetOrSetClient(cluster.KubernetesClusterName) - if err != nil { - c.l.Errorf("Cannot list the subscriptions for the cluster %q: %s", cluster.KubernetesClusterName, err) - continue - } - - subscriptions, err := kubeClient.ListSubscriptions(ctx, "default") - if err != nil { - c.l.Errorf("Cannot list the subscriptions for the cluster %q: %s", cluster.KubernetesClusterName, err) - continue - } - resp.ClusterToComponents[cluster.KubernetesClusterName] = &dbaasv1beta1.ComponentsUpdateInformation{ - ComponentToUpdateInformation: map[string]*dbaasv1beta1.ComponentUpdateInformation{ - psmdbOperator: {}, - pxcOperator: {}, - }, - } - - for _, item := range subscriptions.Items { - if item.Status.CurrentCSV != item.Status.InstalledCSV { - re := regexp.MustCompile(`v(\d+\.\d+\.\d+)$`) - matches := re.FindStringSubmatch(item.Status.CurrentCSV) - if len(matches) == 2 { - switch item.Spec.Package { - case psmdbOperatorName: - resp.ClusterToComponents[cluster.KubernetesClusterName].ComponentToUpdateInformation[psmdbOperator] = &dbaasv1beta1.ComponentUpdateInformation{ - AvailableVersion: matches[1], - } - case pxcOperatorName: - resp.ClusterToComponents[cluster.KubernetesClusterName].ComponentToUpdateInformation[pxcOperator] = &dbaasv1beta1.ComponentUpdateInformation{ - AvailableVersion: matches[1], - } - } - } - } - } - } - - return resp, nil -} - -func (c ComponentsService) versions(ctx context.Context, params componentsParams, cluster *models.KubernetesCluster) ([]*dbaasv1beta1.OperatorVersion, error) { - components, err := c.versionServiceClient.Matrix(ctx, params) - if err != nil { - return nil, err - } - - var mongod, pxc, proxySQL, haproxy *models.Component - if cluster != nil { - mongod = cluster.Mongod - pxc = cluster.PXC - proxySQL = cluster.ProxySQL - haproxy = cluster.HAProxy - } - - versions := make([]*dbaasv1beta1.OperatorVersion, 0, len(components.Versions)) - mongodMinimalVersion, _ := goversion.NewVersion("4.2.0") - pxcMinimalVersion, _ := goversion.NewVersion("8.0.0") - for _, v := range components.Versions { - respVersion := &dbaasv1beta1.OperatorVersion{ - Product: v.Product, - Operator: v.ProductVersion, - Matrix: &dbaasv1beta1.Matrix{ - Mongod: c.matrix(v.Matrix.Mongod, mongodMinimalVersion, mongod), - Pxc: c.matrix(v.Matrix.Pxc, pxcMinimalVersion, pxc), - Pmm: c.matrix(v.Matrix.Pmm, nil, nil), - Proxysql: c.matrix(v.Matrix.Proxysql, nil, proxySQL), - Haproxy: c.matrix(v.Matrix.Haproxy, nil, haproxy), - Backup: c.matrix(v.Matrix.Backup, nil, nil), - Operator: c.matrix(v.Matrix.Operator, nil, nil), - LogCollector: c.matrix(v.Matrix.LogCollector, nil, nil), - }, - } - versions = append(versions, respVersion) - } - - return versions, nil -} - -func (c ComponentsService) matrix(m map[string]componentVersion, minimalVersion *goversion.Version, kc *models.Component) map[string]*dbaasv1beta1.Component { - result := make(map[string]*dbaasv1beta1.Component) - - var lastVersion string - lastVersionParsed, _ := goversion.NewVersion("0.0.0") - for v, component := range m { - parsedVersion, err := goversion.NewVersion(v) - if err != nil { - c.l.Warnf("couldn't parse version %s: %s", v, err.Error()) - continue - } - if minimalVersion != nil && parsedVersion.LessThan(minimalVersion) { - continue - } - result[v] = &dbaasv1beta1.Component{ - ImagePath: component.ImagePath, - ImageHash: component.ImageHash, - Status: component.Status, - Critical: component.Critical, - } - if lastVersionParsed.LessThan(parsedVersion) && component.Status == "recommended" { - lastVersionParsed = parsedVersion - lastVersion = v - } - } - - defaultVersionSet := false - if kc != nil { - if _, ok := result[kc.DefaultVersion]; ok { - result[kc.DefaultVersion].Default = true - defaultVersionSet = true - } - for _, v := range kc.DisabledVersions { - if _, ok := result[v]; ok { - result[v].Disabled = true - } - } - } - if lastVersion != "" && !defaultVersionSet { - result[lastVersion].Default = true - } - return result -} - -func setComponent(kc *models.Component, rc *dbaasv1beta1.ChangeComponent) (*models.Component, error) { - if kc == nil { - kc = &models.Component{} - } - if rc.DefaultVersion != "" { - kc.DefaultVersion = rc.DefaultVersion - } - - disabledVersions := make(map[string]struct{}) - for _, v := range kc.DisabledVersions { - disabledVersions[v] = struct{}{} - } - for _, v := range rc.Versions { - if v.Enable && v.Disable { - return nil, fmt.Errorf("enable and disable for version %s can't be passed together", v.Version) - } - if v.Enable { - delete(disabledVersions, v.Version) - } - if v.Disable { - disabledVersions[v.Version] = struct{}{} - } - } - if _, ok := disabledVersions[kc.DefaultVersion]; ok { - return nil, fmt.Errorf("default version can't be disabled") - } - kc.DisabledVersions = stringset.ToSlice(disabledVersions) - return kc, nil -} - -func (c ComponentsService) InstallOperator(ctx context.Context, req *dbaasv1beta1.InstallOperatorRequest) (*dbaasv1beta1.InstallOperatorResponse, error) { - kubernetesCluster, err := models.FindKubernetesClusterByName(c.db.Querier, req.KubernetesClusterName) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - kubeClient, err := c.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - var component *models.Component - var installFunc func() error - - switch req.OperatorType { - case pxcOperator: - installFunc = func() error { - return kubeClient.UpgradeOperator(ctx, defaultNamespace, pxcOperatorName) - } - component = kubernetesCluster.PXC - case psmdbOperator: - installFunc = func() error { - return kubeClient.UpgradeOperator(ctx, defaultNamespace, psmdbOperatorName) - } - component = kubernetesCluster.Mongod - default: - return nil, errors.Errorf("%q is not supported operator", req.OperatorType) - } - - if component != nil { - // Default version of database could be unsupported be a new operator version. - supported, err := c.versionServiceClient.IsDatabaseVersionSupportedByOperator(ctx, req.OperatorType, req.Version, component.DefaultVersion) - if err != nil { - return nil, status.Errorf(codes.Internal, "failed to check if default database version is supported by the operator version: %v", err) - } - if !supported { - return nil, status.Errorf(codes.Internal, - "default database version %s is unsupported by the operator version %s, please change default version.", component.DefaultVersion, req.Version) - } - } - - // Install operator. - if err := installFunc(); err != nil { - return nil, status.Errorf(codes.Internal, "failed to install operator: %v", err) - } - - return &dbaasv1beta1.InstallOperatorResponse{Status: dbaasv1beta1.OperatorsStatus_OPERATORS_STATUS_OK}, nil -} - -// DefaultComponent returns the component marked as default in the components list. -func DefaultComponent(m map[string]*dbaasv1beta1.Component) (*dbaasv1beta1.Component, error) { - if len(m) == 0 { - return nil, errNoVersionsFound - } - - for _, component := range m { - if component.Default { - return &dbaasv1beta1.Component{ - ImagePath: component.ImagePath, - ImageHash: component.ImageHash, - Status: component.Status, - Critical: component.Critical, - }, - nil - } - } - - return nil, errors.New("cannot find a default version in the components list") -} - -func getPMMClientImage() string { - pmmClientImage := "perconalab/pmm-client:dev-latest" - - pmmClientImageEnv, ok := os.LookupEnv("PERCONA_TEST_DBAAS_PMM_CLIENT") - if ok { - pmmClientImage = pmmClientImageEnv - return pmmClientImage - } - - if pmmversion.PMMVersion == "" { // No version set, use dev-latest. - return pmmClientImage - } - - v, err := goversion.NewVersion(pmmversion.PMMVersion) //nolint: varnamelen - if err != nil { - return pmmClientImage - } - // if version has a suffix like 1.2.0-dev or 3.4.1-HEAD-something it is an unreleased version. - // Docker image won't exist in the repo so use latest stable. - if v.Core().String() != v.String() { - pmmClientImage = "percona/pmm-client:2" - return pmmClientImage - } - - exists, err := imageExists(context.Background(), pmmClientImage) - // if !exists or there was an error while checking if the image exists, use dev-latest as default. - if !exists || err != nil { - return devLatest - } - - pmmClientImage = "percona/pmm-client:" + v.Core().String() - return pmmClientImage -} - -func imageExists(ctx context.Context, image string) (bool, error) { - cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation()) - if err != nil { - panic(err) - } - defer cli.Close() - - reader, err := cli.ImagePull(ctx, image, types.ImagePullOptions{}) - if err != nil { - if client.IsErrNotFound(err) { - return false, nil - } - - return false, err - } - - reader.Close() - - return true, nil -} diff --git a/managed/services/management/dbaas/components_service_test.go b/managed/services/management/dbaas/components_service_test.go deleted file mode 100644 index 3a8198301c..0000000000 --- a/managed/services/management/dbaas/components_service_test.go +++ /dev/null @@ -1,879 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package dbaas - -import ( - "context" - "fmt" - "testing" - "time" - - "github.com/google/uuid" - goversion "github.com/hashicorp/go-version" - "github.com/operator-framework/api/pkg/operators/v1alpha1" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "gopkg.in/reform.v1" - "gopkg.in/reform.v1/dialects/postgresql" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/testdb" - "github.com/percona/pmm/managed/utils/tests" - "github.com/percona/pmm/utils/logger" - pmmversion "github.com/percona/pmm/version" -) - -const ( - versionServiceURL = "https://check.percona.com/versions/v1" - twoPointEighteen = "2.18.0" -) - -func TestComponentService(t *testing.T) { - const ( - clusterName = "pxcCluster" - kubeConfig = "{}" - ) - - setup := func(t *testing.T) (ctx context.Context, cs dbaasv1beta1.ComponentsServer, dbaasClient *mockDbaasClient, kubeClient *mockKubernetesClient, - kubeStorage *mockKubeStorageManager, - ) { - t.Helper() - - ctx = logger.Set(context.Background(), t.Name()) - uuid.SetRand(&tests.IDReader{}) - - sqlDB := testdb.Open(t, models.SetupFixtures, nil) - db := reform.NewDB(sqlDB, postgresql.Dialect, nil) - - dbaasClient = &mockDbaasClient{} - - kubernetesCluster, err := models.CreateKubernetesCluster(db.Querier, &models.CreateKubernetesClusterParams{ - KubernetesClusterName: clusterName, - KubeConfig: kubeConfig, - }) - require.NoError(t, err) - - t.Cleanup(func() { - uuid.SetRand(nil) - dbaasClient.AssertExpectations(t) - assert.NoError(t, db.Delete(kubernetesCluster)) - require.NoError(t, sqlDB.Close()) - }) - - vsc := NewVersionServiceClient(versionServiceURL) - kubeStorage = &mockKubeStorageManager{} - kubeClient = &mockKubernetesClient{} - kubeClient.On("GetServerVersion").Return(nil, nil) - cs = NewComponentsService(db, dbaasClient, vsc, kubeStorage) - - return - } - - t.Run("PXC", func(t *testing.T) { - t.Run("BasicGet", func(t *testing.T) { - ctx, cs, _, kubeClient, kubeStorageClient := setup(t) - kubeClient.On("GetPXCOperatorVersion", mock.Anything, mock.Anything).Return("1.7.0", nil) - kubeClient.On("GetPSMDBOperatorVersion", mock.Anything, mock.Anything).Return("1.6.0", nil) - kubeStorageClient.On("GetOrSetClient", mock.Anything).Return(kubeClient, nil) - - pxcComponents, err := cs.GetPXCComponents(ctx, &dbaasv1beta1.GetPXCComponentsRequest{ - KubernetesClusterName: clusterName, - }) - require.NoError(t, err) - require.NotNil(t, pxcComponents) - - expected := map[string]*dbaasv1beta1.Component{ - "8.0.19-10.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.19-10.1", ImageHash: "1058ae8eded735ebdf664807aad7187942fc9a1170b3fd0369574cb61206b63a", Status: "available", Critical: false}, - "8.0.20-11.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.20-11.1", ImageHash: "54b1b2f5153b78b05d651034d4603a13e685cbb9b45bfa09a39864fa3f169349", Status: "available", Critical: false}, - "8.0.20-11.2": {ImagePath: "percona/percona-xtradb-cluster:8.0.20-11.2", ImageHash: "feda5612db18da824e971891d6084465aa9cdc9918c18001cd95ba30916da78b", Status: "available", Critical: false}, - "8.0.21-12.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.21-12.1", ImageHash: "d95cf39a58f09759408a00b519fe0d0b19c1b28332ece94349dd5e9cdbda017e", Status: "recommended", Critical: false, Default: true}, - } - require.Equal(t, 1, len(pxcComponents.Versions)) - assert.Equal(t, expected, pxcComponents.Versions[0].Matrix.Pxc) - }) - - t.Run("Change", func(t *testing.T) { - ctx, cs, _, kubeClient, kubeStorageClient := setup(t) - kubeClient.On("GetPXCOperatorVersion", mock.Anything, mock.Anything).Return("1.7.0", nil) - kubeClient.On("GetPSMDBOperatorVersion", mock.Anything, mock.Anything).Return("1.6.0", nil) - kubeStorageClient.On("GetOrSetClient", mock.Anything).Return(kubeClient, nil) - - resp, err := cs.ChangePXCComponents(ctx, &dbaasv1beta1.ChangePXCComponentsRequest{ - KubernetesClusterName: clusterName, - Pxc: &dbaasv1beta1.ChangeComponent{ - DefaultVersion: "8.0.19-10.1", - Versions: []*dbaasv1beta1.ChangeComponent_ComponentVersion{{ - Version: "8.0.20-11.1", - Disable: true, - }, { - Version: "8.0.20-11.2", - Disable: true, - }}, - }, - Proxysql: nil, - }) - require.NoError(t, err) - require.NotNil(t, resp) - - pxcComponents, err := cs.GetPXCComponents(ctx, &dbaasv1beta1.GetPXCComponentsRequest{ - KubernetesClusterName: clusterName, - }) - require.NoError(t, err) - require.NotNil(t, pxcComponents) - - expected := map[string]*dbaasv1beta1.Component{ - "8.0.19-10.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.19-10.1", ImageHash: "1058ae8eded735ebdf664807aad7187942fc9a1170b3fd0369574cb61206b63a", Status: "available", Critical: false, Default: true}, - "8.0.20-11.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.20-11.1", ImageHash: "54b1b2f5153b78b05d651034d4603a13e685cbb9b45bfa09a39864fa3f169349", Status: "available", Critical: false, Disabled: true}, - "8.0.20-11.2": {ImagePath: "percona/percona-xtradb-cluster:8.0.20-11.2", ImageHash: "feda5612db18da824e971891d6084465aa9cdc9918c18001cd95ba30916da78b", Status: "available", Critical: false, Disabled: true}, - "8.0.21-12.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.21-12.1", ImageHash: "d95cf39a58f09759408a00b519fe0d0b19c1b28332ece94349dd5e9cdbda017e", Status: "recommended", Critical: false}, - } - require.Equal(t, 1, len(pxcComponents.Versions)) - assert.Equal(t, expected, pxcComponents.Versions[0].Matrix.Pxc) - - t.Run("Change Again", func(t *testing.T) { - resp, err := cs.ChangePXCComponents(ctx, &dbaasv1beta1.ChangePXCComponentsRequest{ - KubernetesClusterName: clusterName, - Pxc: &dbaasv1beta1.ChangeComponent{ - DefaultVersion: "8.0.20-11.1", - Versions: []*dbaasv1beta1.ChangeComponent_ComponentVersion{{ - Version: "8.0.20-11.1", - Enable: true, - }}, - }, - Proxysql: nil, - }) - require.NoError(t, err) - require.NotNil(t, resp) - - pxcComponents, err := cs.GetPXCComponents(ctx, &dbaasv1beta1.GetPXCComponentsRequest{ - KubernetesClusterName: clusterName, - }) - - require.NoError(t, err) - require.NotNil(t, pxcComponents) - - expected := map[string]*dbaasv1beta1.Component{ - "8.0.19-10.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.19-10.1", ImageHash: "1058ae8eded735ebdf664807aad7187942fc9a1170b3fd0369574cb61206b63a", Status: "available", Critical: false}, - "8.0.20-11.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.20-11.1", ImageHash: "54b1b2f5153b78b05d651034d4603a13e685cbb9b45bfa09a39864fa3f169349", Status: "available", Critical: false, Default: true}, - "8.0.20-11.2": {ImagePath: "percona/percona-xtradb-cluster:8.0.20-11.2", ImageHash: "feda5612db18da824e971891d6084465aa9cdc9918c18001cd95ba30916da78b", Status: "available", Critical: false, Disabled: true}, - "8.0.21-12.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.21-12.1", ImageHash: "d95cf39a58f09759408a00b519fe0d0b19c1b28332ece94349dd5e9cdbda017e", Status: "recommended", Critical: false}, - } - require.Equal(t, 1, len(pxcComponents.Versions)) - assert.Equal(t, expected, pxcComponents.Versions[0].Matrix.Pxc) - }) - }) - - t.Run("Don't let disable and make default same version", func(t *testing.T) { - ctx, cs, _, _, _ := setup(t) - - resp, err := cs.ChangePXCComponents(ctx, &dbaasv1beta1.ChangePXCComponentsRequest{ - KubernetesClusterName: clusterName, - Pxc: &dbaasv1beta1.ChangeComponent{ - DefaultVersion: "8.0.19-10.1", - Versions: []*dbaasv1beta1.ChangeComponent_ComponentVersion{{ - Version: "8.0.19-10.1", - Disable: true, - Enable: false, - }}, - }, - Proxysql: nil, - }) - tests.AssertGRPCError(t, status.New(codes.InvalidArgument, fmt.Sprintf("default version can't be disabled, cluster: %s, component: pxc", clusterName)), err) - require.Nil(t, resp) - }) - - t.Run("enable and disable", func(t *testing.T) { - ctx, cs, _, _, _ := setup(t) - - resp, err := cs.ChangePXCComponents(ctx, &dbaasv1beta1.ChangePXCComponentsRequest{ - KubernetesClusterName: clusterName, - Pxc: nil, - Proxysql: &dbaasv1beta1.ChangeComponent{ - Versions: []*dbaasv1beta1.ChangeComponent_ComponentVersion{{ - Version: "8.0.19-10.1", - Disable: true, - Enable: true, - }}, - }, - }) - tests.AssertGRPCError(t, status.New(codes.InvalidArgument, fmt.Sprintf("enable and disable for version 8.0.19-10.1 can't be passed together, cluster: %s, component: proxySQL", clusterName)), err) - require.Nil(t, resp) - }) - }) - - t.Run("PSMDB", func(t *testing.T) { - t.Run("BasicGet", func(t *testing.T) { - ctx, cs, _, kubeClient, kubeStorageClient := setup(t) - kubeClient.On("GetPXCOperatorVersion", mock.Anything, mock.Anything).Return("1.7.0", nil) - kubeClient.On("GetPSMDBOperatorVersion", mock.Anything, mock.Anything).Return("1.6.0", nil) - kubeStorageClient.On("GetOrSetClient", mock.Anything).Return(kubeClient, nil) - - psmdbComponents, err := cs.GetPSMDBComponents(ctx, &dbaasv1beta1.GetPSMDBComponentsRequest{ - KubernetesClusterName: clusterName, - }) - require.NoError(t, err) - require.NotNil(t, psmdbComponents) - - expected := map[string]*dbaasv1beta1.Component{ - "4.2.7-7": {ImagePath: "percona/percona-server-mongodb:4.2.7-7", ImageHash: "1d8a0859b48a3e9cadf9ad7308ec5aa4b278a64ca32ff5d887156b1b46146b13", Status: "available", Critical: false}, - "4.2.8-8": {ImagePath: "percona/percona-server-mongodb:4.2.8-8", ImageHash: "a66e889d3e986413e41083a9c887f33173da05a41c8bd107cf50eede4588a505", Status: "available", Critical: false}, - "4.2.11-12": {ImagePath: "percona/percona-server-mongodb:4.2.11-12", ImageHash: "1909cb7a6ecea9bf0535b54aa86b9ae74ba2fa303c55cf4a1a54262fb0edbd3c", Status: "recommended", Critical: false}, - "4.4.2-4": {ImagePath: "percona/percona-server-mongodb:4.4.2-4", ImageHash: "991d6049059e5eb1a74981290d829a5fb4ab0554993748fde1e67b2f46f26bf0", Status: "recommended", Critical: false, Default: true}, - } - require.Equal(t, 1, len(psmdbComponents.Versions)) - assert.Equal(t, expected, psmdbComponents.Versions[0].Matrix.Mongod) - }) - - t.Run("Change", func(t *testing.T) { - ctx, cs, _, kubeClient, kubeStorageClient := setup(t) - kubeClient.On("GetPXCOperatorVersion", mock.Anything, mock.Anything).Return("1.7.0", nil) - kubeClient.On("GetPSMDBOperatorVersion", mock.Anything, mock.Anything).Return("1.6.0", nil) - kubeStorageClient.On("GetOrSetClient", mock.Anything).Return(kubeClient, nil) - - resp, err := cs.ChangePSMDBComponents(ctx, &dbaasv1beta1.ChangePSMDBComponentsRequest{ - KubernetesClusterName: clusterName, - Mongod: &dbaasv1beta1.ChangeComponent{ - DefaultVersion: "4.2.8-8", - Versions: []*dbaasv1beta1.ChangeComponent_ComponentVersion{{ - Version: "4.2.7-7", - Disable: true, - }, { - Version: "4.4.2-4", - Disable: true, - }}, - }, - }) - require.NoError(t, err) - require.NotNil(t, resp) - - psmdbComponents, err := cs.GetPSMDBComponents(ctx, &dbaasv1beta1.GetPSMDBComponentsRequest{ - KubernetesClusterName: clusterName, - }) - require.NoError(t, err) - require.NotNil(t, psmdbComponents) - - expected := map[string]*dbaasv1beta1.Component{ - "4.2.7-7": {ImagePath: "percona/percona-server-mongodb:4.2.7-7", ImageHash: "1d8a0859b48a3e9cadf9ad7308ec5aa4b278a64ca32ff5d887156b1b46146b13", Status: "available", Critical: false, Disabled: true}, - "4.2.8-8": {ImagePath: "percona/percona-server-mongodb:4.2.8-8", ImageHash: "a66e889d3e986413e41083a9c887f33173da05a41c8bd107cf50eede4588a505", Status: "available", Critical: false, Default: true}, - "4.2.11-12": {ImagePath: "percona/percona-server-mongodb:4.2.11-12", ImageHash: "1909cb7a6ecea9bf0535b54aa86b9ae74ba2fa303c55cf4a1a54262fb0edbd3c", Status: "recommended", Critical: false}, - "4.4.2-4": {ImagePath: "percona/percona-server-mongodb:4.4.2-4", ImageHash: "991d6049059e5eb1a74981290d829a5fb4ab0554993748fde1e67b2f46f26bf0", Status: "recommended", Critical: false, Disabled: true}, - } - require.Equal(t, 1, len(psmdbComponents.Versions)) - assert.Equal(t, expected, psmdbComponents.Versions[0].Matrix.Mongod) - - t.Run("Change Again", func(t *testing.T) { - resp, err := cs.ChangePSMDBComponents(ctx, &dbaasv1beta1.ChangePSMDBComponentsRequest{ - KubernetesClusterName: clusterName, - Mongod: &dbaasv1beta1.ChangeComponent{ - DefaultVersion: "4.2.11-12", - Versions: []*dbaasv1beta1.ChangeComponent_ComponentVersion{{ - Version: "4.4.2-4", - Enable: true, - }, { - Version: "4.2.8-8", - Disable: true, - }}, - }, - }) - require.NoError(t, err) - require.NotNil(t, resp) - - psmdbComponents, err := cs.GetPSMDBComponents(ctx, &dbaasv1beta1.GetPSMDBComponentsRequest{ - KubernetesClusterName: clusterName, - }) - require.NoError(t, err) - require.NotNil(t, psmdbComponents) - - expected := map[string]*dbaasv1beta1.Component{ - "4.2.7-7": {ImagePath: "percona/percona-server-mongodb:4.2.7-7", ImageHash: "1d8a0859b48a3e9cadf9ad7308ec5aa4b278a64ca32ff5d887156b1b46146b13", Status: "available", Critical: false, Disabled: true}, - "4.2.8-8": {ImagePath: "percona/percona-server-mongodb:4.2.8-8", ImageHash: "a66e889d3e986413e41083a9c887f33173da05a41c8bd107cf50eede4588a505", Status: "available", Critical: false, Disabled: true}, - "4.2.11-12": {ImagePath: "percona/percona-server-mongodb:4.2.11-12", ImageHash: "1909cb7a6ecea9bf0535b54aa86b9ae74ba2fa303c55cf4a1a54262fb0edbd3c", Status: "recommended", Critical: false, Default: true}, - "4.4.2-4": {ImagePath: "percona/percona-server-mongodb:4.4.2-4", ImageHash: "991d6049059e5eb1a74981290d829a5fb4ab0554993748fde1e67b2f46f26bf0", Status: "recommended", Critical: false}, - } - require.Equal(t, 1, len(psmdbComponents.Versions)) - assert.Equal(t, expected, psmdbComponents.Versions[0].Matrix.Mongod) - }) - }) - - t.Run("Don't let disable and make default same version", func(t *testing.T) { - ctx, cs, _, _, _ := setup(t) - - resp, err := cs.ChangePSMDBComponents(ctx, &dbaasv1beta1.ChangePSMDBComponentsRequest{ - KubernetesClusterName: clusterName, - Mongod: &dbaasv1beta1.ChangeComponent{ - DefaultVersion: "4.2.11-12", - Versions: []*dbaasv1beta1.ChangeComponent_ComponentVersion{{ - Version: "4.2.11-12", - Disable: true, - Enable: false, - }}, - }, - }) - tests.AssertGRPCError(t, status.New(codes.InvalidArgument, fmt.Sprintf("default version can't be disabled, cluster: %s, component: mongod", clusterName)), err) - require.Nil(t, resp) - }) - - t.Run("enable and disable", func(t *testing.T) { - ctx, cs, _, _, _ := setup(t) - - resp, err := cs.ChangePSMDBComponents(ctx, &dbaasv1beta1.ChangePSMDBComponentsRequest{ - KubernetesClusterName: clusterName, - Mongod: &dbaasv1beta1.ChangeComponent{ - Versions: []*dbaasv1beta1.ChangeComponent_ComponentVersion{{ - Version: "4.2.11-12", - Disable: true, - Enable: true, - }}, - }, - }) - tests.AssertGRPCError(t, status.New(codes.InvalidArgument, fmt.Sprintf("enable and disable for version 4.2.11-12 can't be passed together, cluster: %s, component: mongod", clusterName)), err) - require.Nil(t, resp) - }) - }) -} - -func TestComponentServiceMatrix(t *testing.T) { - input := map[string]componentVersion{ - "5.7.26-31.37": {ImagePath: "percona/percona-xtradb-cluster:5.7.26-31.37", ImageHash: "9d43d8e435e4aca5c694f726cc736667cb938158635c5f01a0e9412905f1327f", Status: "available", Critical: false}, - "5.7.27-31.39": {ImagePath: "percona/percona-xtradb-cluster:5.7.27-31.39", ImageHash: "7d8eb4d2031c32c6e96451655f359d8e5e8e047dc95bada9a28c41c158876c26", Status: "available", Critical: false}, - "5.7.28-31.41.2": {ImagePath: "percona/percona-xtradb-cluster:5.7.28-31.41.2", ImageHash: "fccd6525aaeedb5e436e9534e2a63aebcf743c043526dd05dba8519ebddc8b30", Status: "available", Critical: true}, - "5.7.29-31.43": {ImagePath: "percona/percona-xtradb-cluster:5.7.29-31.43", ImageHash: "85fb479de073770280ae601cf3ec22dc5c8cca4c8b0dc893b09503767338e6f9", Status: "available", Critical: false}, - "5.7.30-31.43": {ImagePath: "percona/percona-xtradb-cluster:5.7.30-31.43", ImageHash: "b03a060e9261b37288a2153c78f86dcfc53367c36e1bcdcae046dd2d0b0721af", Status: "available", Critical: false}, - "5.7.31-31.45": {ImagePath: "percona/percona-xtradb-cluster:5.7.31-31.45", ImageHash: "3852cef43cc0c6aa791463ba6279e59dcdac3a4fb1a5616c745c1b3c68041dc2", Status: "available", Critical: false}, - "5.7.31-31.45.2": {ImagePath: "percona/percona-xtradb-cluster:5.7.31-31.45.2", ImageHash: "0decf85c7c7afacc438f5fe355dc8320ea7ffc7018ca2cb6bda3ac0c526ae172", Status: "available", Critical: false}, - "5.7.32-31.47": {ImagePath: "percona/percona-xtradb-cluster:5.7.32-31.47", ImageHash: "7b095019ad354c336494248d6080685022e2ed46e3b53fc103b25cd12c95952b", Status: "recommended", Critical: false}, - "8.0.19-10.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.19-10.1", ImageHash: "1058ae8eded735ebdf664807aad7187942fc9a1170b3fd0369574cb61206b63a", Status: "available", Critical: false}, - "8.0.20-11.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.20-11.1", ImageHash: "54b1b2f5153b78b05d651034d4603a13e685cbb9b45bfa09a39864fa3f169349", Status: "available", Critical: false}, - "8.0.20-11.2": {ImagePath: "percona/percona-xtradb-cluster:8.0.20-11.2", ImageHash: "feda5612db18da824e971891d6084465aa9cdc9918c18001cd95ba30916da78b", Status: "available", Critical: false}, - "8.0.21-12.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.21-12.1", ImageHash: "d95cf39a58f09759408a00b519fe0d0b19c1b28332ece94349dd5e9cdbda017e", Status: "recommended", Critical: false}, - } - - t.Run("All", func(t *testing.T) { - cs := &ComponentsService{} - m := cs.matrix(input, nil, nil) - - expected := map[string]*dbaasv1beta1.Component{ - "5.7.26-31.37": {ImagePath: "percona/percona-xtradb-cluster:5.7.26-31.37", ImageHash: "9d43d8e435e4aca5c694f726cc736667cb938158635c5f01a0e9412905f1327f", Status: "available", Critical: false}, - "5.7.27-31.39": {ImagePath: "percona/percona-xtradb-cluster:5.7.27-31.39", ImageHash: "7d8eb4d2031c32c6e96451655f359d8e5e8e047dc95bada9a28c41c158876c26", Status: "available", Critical: false}, - "5.7.28-31.41.2": {ImagePath: "percona/percona-xtradb-cluster:5.7.28-31.41.2", ImageHash: "fccd6525aaeedb5e436e9534e2a63aebcf743c043526dd05dba8519ebddc8b30", Status: "available", Critical: true}, - "5.7.29-31.43": {ImagePath: "percona/percona-xtradb-cluster:5.7.29-31.43", ImageHash: "85fb479de073770280ae601cf3ec22dc5c8cca4c8b0dc893b09503767338e6f9", Status: "available", Critical: false}, - "5.7.30-31.43": {ImagePath: "percona/percona-xtradb-cluster:5.7.30-31.43", ImageHash: "b03a060e9261b37288a2153c78f86dcfc53367c36e1bcdcae046dd2d0b0721af", Status: "available", Critical: false}, - "5.7.31-31.45": {ImagePath: "percona/percona-xtradb-cluster:5.7.31-31.45", ImageHash: "3852cef43cc0c6aa791463ba6279e59dcdac3a4fb1a5616c745c1b3c68041dc2", Status: "available", Critical: false}, - "5.7.31-31.45.2": {ImagePath: "percona/percona-xtradb-cluster:5.7.31-31.45.2", ImageHash: "0decf85c7c7afacc438f5fe355dc8320ea7ffc7018ca2cb6bda3ac0c526ae172", Status: "available", Critical: false}, - "5.7.32-31.47": {ImagePath: "percona/percona-xtradb-cluster:5.7.32-31.47", ImageHash: "7b095019ad354c336494248d6080685022e2ed46e3b53fc103b25cd12c95952b", Status: "recommended", Critical: false}, - "8.0.19-10.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.19-10.1", ImageHash: "1058ae8eded735ebdf664807aad7187942fc9a1170b3fd0369574cb61206b63a", Status: "available", Critical: false}, - "8.0.20-11.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.20-11.1", ImageHash: "54b1b2f5153b78b05d651034d4603a13e685cbb9b45bfa09a39864fa3f169349", Status: "available", Critical: false}, - "8.0.20-11.2": {ImagePath: "percona/percona-xtradb-cluster:8.0.20-11.2", ImageHash: "feda5612db18da824e971891d6084465aa9cdc9918c18001cd95ba30916da78b", Status: "available", Critical: false}, - "8.0.21-12.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.21-12.1", ImageHash: "d95cf39a58f09759408a00b519fe0d0b19c1b28332ece94349dd5e9cdbda017e", Status: "recommended", Critical: false, Default: true}, - } - - assert.Equal(t, expected, m) - }) - - t.Run("Disabled and Default Components", func(t *testing.T) { - cs := &ComponentsService{} - - m := cs.matrix(input, nil, &models.Component{ - DisabledVersions: []string{"8.0.20-11.2", "8.0.20-11.1"}, - DefaultVersion: "8.0.19-10.1", - }) - - expected := map[string]*dbaasv1beta1.Component{ - "5.7.26-31.37": {ImagePath: "percona/percona-xtradb-cluster:5.7.26-31.37", ImageHash: "9d43d8e435e4aca5c694f726cc736667cb938158635c5f01a0e9412905f1327f", Status: "available", Critical: false}, - "5.7.27-31.39": {ImagePath: "percona/percona-xtradb-cluster:5.7.27-31.39", ImageHash: "7d8eb4d2031c32c6e96451655f359d8e5e8e047dc95bada9a28c41c158876c26", Status: "available", Critical: false}, - "5.7.28-31.41.2": {ImagePath: "percona/percona-xtradb-cluster:5.7.28-31.41.2", ImageHash: "fccd6525aaeedb5e436e9534e2a63aebcf743c043526dd05dba8519ebddc8b30", Status: "available", Critical: true}, - "5.7.29-31.43": {ImagePath: "percona/percona-xtradb-cluster:5.7.29-31.43", ImageHash: "85fb479de073770280ae601cf3ec22dc5c8cca4c8b0dc893b09503767338e6f9", Status: "available", Critical: false}, - "5.7.30-31.43": {ImagePath: "percona/percona-xtradb-cluster:5.7.30-31.43", ImageHash: "b03a060e9261b37288a2153c78f86dcfc53367c36e1bcdcae046dd2d0b0721af", Status: "available", Critical: false}, - "5.7.31-31.45": {ImagePath: "percona/percona-xtradb-cluster:5.7.31-31.45", ImageHash: "3852cef43cc0c6aa791463ba6279e59dcdac3a4fb1a5616c745c1b3c68041dc2", Status: "available", Critical: false}, - "5.7.31-31.45.2": {ImagePath: "percona/percona-xtradb-cluster:5.7.31-31.45.2", ImageHash: "0decf85c7c7afacc438f5fe355dc8320ea7ffc7018ca2cb6bda3ac0c526ae172", Status: "available", Critical: false}, - "5.7.32-31.47": {ImagePath: "percona/percona-xtradb-cluster:5.7.32-31.47", ImageHash: "7b095019ad354c336494248d6080685022e2ed46e3b53fc103b25cd12c95952b", Status: "recommended", Critical: false}, - "8.0.19-10.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.19-10.1", ImageHash: "1058ae8eded735ebdf664807aad7187942fc9a1170b3fd0369574cb61206b63a", Status: "available", Critical: false, Default: true}, - "8.0.20-11.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.20-11.1", ImageHash: "54b1b2f5153b78b05d651034d4603a13e685cbb9b45bfa09a39864fa3f169349", Status: "available", Critical: false, Disabled: true}, - "8.0.20-11.2": {ImagePath: "percona/percona-xtradb-cluster:8.0.20-11.2", ImageHash: "feda5612db18da824e971891d6084465aa9cdc9918c18001cd95ba30916da78b", Status: "available", Critical: false, Disabled: true}, - "8.0.21-12.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.21-12.1", ImageHash: "d95cf39a58f09759408a00b519fe0d0b19c1b28332ece94349dd5e9cdbda017e", Status: "recommended", Critical: false}, - } - - assert.Equal(t, expected, m) - }) - - t.Run("Skip unsupported Components", func(t *testing.T) { - cs := &ComponentsService{} - - minimumSupportedVersion, err := goversion.NewVersion("8.0.0") - require.NoError(t, err) - m := cs.matrix(input, minimumSupportedVersion, &models.Component{ - DisabledVersions: []string{"8.0.21-12.1", "8.0.20-11.1"}, - DefaultVersion: "8.0.20-11.2", - }) - - expected := map[string]*dbaasv1beta1.Component{ - "8.0.19-10.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.19-10.1", ImageHash: "1058ae8eded735ebdf664807aad7187942fc9a1170b3fd0369574cb61206b63a", Status: "available", Critical: false}, - "8.0.20-11.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.20-11.1", ImageHash: "54b1b2f5153b78b05d651034d4603a13e685cbb9b45bfa09a39864fa3f169349", Status: "available", Critical: false, Disabled: true}, - "8.0.20-11.2": {ImagePath: "percona/percona-xtradb-cluster:8.0.20-11.2", ImageHash: "feda5612db18da824e971891d6084465aa9cdc9918c18001cd95ba30916da78b", Status: "available", Critical: false, Default: true}, - "8.0.21-12.1": {ImagePath: "percona/percona-xtradb-cluster:8.0.21-12.1", ImageHash: "d95cf39a58f09759408a00b519fe0d0b19c1b28332ece94349dd5e9cdbda017e", Status: "recommended", Critical: false, Disabled: true}, - } - - assert.Equal(t, expected, m) - }) - - t.Run("EmptyMatrix", func(t *testing.T) { - cs := &ComponentsService{} - m := cs.matrix(make(map[string]componentVersion), nil, nil) - assert.Equal(t, make(map[string]*dbaasv1beta1.Component), m) - }) -} - -func TestFilteringOutOfUnsupportedVersions(t *testing.T) { - t.Parallel() - c := &ComponentsService{ - l: logrus.WithField("component", "components_service"), - versionServiceClient: NewVersionServiceClient(versionServiceURL), - } - - t.Run("mongod", func(t *testing.T) { - t.Parallel() - ctx, cancel := context.WithTimeout(context.Background(), time.Second*30) - defer cancel() - - params := componentsParams{ - product: psmdbOperator, - productVersion: onePointSix, - } - versions, err := c.versions(ctx, params, nil) - require.NoError(t, err) - parsedSupportedVersion, err := goversion.NewVersion("4.2.0") - require.NoError(t, err) - for _, v := range versions { - for version := range v.Matrix.Mongod { - parsedVersion, err := goversion.NewVersion(version) - require.NoError(t, err) - assert.Truef(t, parsedVersion.GreaterThanOrEqual(parsedSupportedVersion), "%s is not greater or equal to 4.2.0", version) - } - } - }) - - t.Run("pxc", func(t *testing.T) { - t.Parallel() - ctx, cancel := context.WithTimeout(context.Background(), time.Second*30) - defer cancel() - - params := componentsParams{ - product: pxcOperator, - productVersion: onePointSeven, - } - versions, err := c.versions(ctx, params, nil) - require.NoError(t, err) - parsedSupportedVersion, err := goversion.NewVersion("8.0.0") - require.NoError(t, err) - for _, v := range versions { - for version := range v.Matrix.Pxc { - parsedVersion, err := goversion.NewVersion(version) - require.NoError(t, err) - assert.True(t, parsedVersion.GreaterThanOrEqual(parsedSupportedVersion), "%s is not greater or equal to 8.0.0", version) - } - } - }) -} - -const ( - onePointTen = "1.10.0" - onePointNine = "1.9.0" - onePointEight = "1.8.0" - onePointSeven = "1.7.0" - onePointSix = "1.6.0" - defaultPXCVersion = "5.7.26-31.37" - latestPXCVersion = "8.0.0" - defaultPSMDBVersion = "3.6.18-5.0" - latestPSMDBVersion = "4.5.0" - port = "5497" - clusterName = "installoperator" -) - -func setup(t *testing.T, clusterName string, response *VersionServiceResponse, port string) ( - *reform.Querier, dbaasv1beta1.ComponentsServer, *mockKubernetesClient, - *mockKubeStorageManager, -) { - t.Helper() - - uuid.SetRand(&tests.IDReader{}) - - sqlDB := testdb.Open(t, models.SetupFixtures, nil) - db := reform.NewDB(sqlDB, postgresql.Dialect, nil) - dbaasClient := &mockDbaasClient{} - - kubernetesCluster, err := models.CreateKubernetesCluster(db.Querier, &models.CreateKubernetesClusterParams{ - KubernetesClusterName: clusterName, - KubeConfig: "{}", - }) - require.NoError(t, err) - kubernetesCluster.Mongod = &models.Component{ - DefaultVersion: defaultPSMDBVersion, - } - kubernetesCluster.PXC = &models.Component{ - DefaultVersion: defaultPXCVersion, - } - require.NoError(t, db.Save(kubernetesCluster)) - kubeClient := &mockKubernetesClient{} - - vsc, cleanup := newFakeVersionService(response, port, pxcOperator, psmdbOperator, "pmm-server") - - t.Cleanup(func() { - cleanup(t) - uuid.SetRand(nil) - dbaasClient.AssertExpectations(t) - assert.NoError(t, db.Delete(kubernetesCluster)) - require.NoError(t, sqlDB.Close()) - }) - - kubeStorage := &mockKubeStorageManager{} - - return db.Querier, NewComponentsService(db, dbaasClient, vsc, kubeStorage), kubeClient, kubeStorage -} - -func TestInstallOperator(t *testing.T) { - pmmversion.PMMVersion = "2.19.0" - - response := &VersionServiceResponse{ - Versions: []Version{ - { - Product: pxcOperator, - ProductVersion: onePointSeven, - Matrix: matrix{ - Pxc: map[string]componentVersion{ - defaultPXCVersion: {}, - }, - }, - }, - { - Product: pxcOperator, - ProductVersion: onePointEight, - Matrix: matrix{ - Pxc: map[string]componentVersion{ - latestPXCVersion: {}, - "5.8.0": {}, - }, - }, - }, - { - Product: psmdbOperator, - ProductVersion: onePointSeven, - Matrix: matrix{ - Mongod: map[string]componentVersion{ - defaultPSMDBVersion: {}, - }, - }, - }, - { - Product: psmdbOperator, - ProductVersion: onePointEight, - Matrix: matrix{ - Mongod: map[string]componentVersion{ - latestPSMDBVersion: {}, - "3.7.0": {}, - }, - }, - }, - { - Product: "pmm-server", - ProductVersion: "2.19.0", - Matrix: matrix{ - PXCOperator: map[string]componentVersion{ - onePointEight: {}, - }, - PSMDBOperator: map[string]componentVersion{ - onePointEight: {}, - }, - }, - }, - }, - } - - t.Run("Defaults not supported", func(t *testing.T) { - _, c, kubeClient, kubeStorageClient := setup(t, clusterName, response, "5497") - kubeStorageClient.On("GetOrSetClient", mock.Anything).Return(kubeClient, nil) - kubeClient.On("SetKubeConfig", mock.Anything).Return(nil) - kubeClient.On("InstallOLMOperator", mock.Anything, mock.Anything).Return(nil) - kubeClient.On("InstallOperator", mock.Anything, mock.Anything).Return(nil) - - ctx, cancel := context.WithTimeout(context.TODO(), time.Second*5) - defer cancel() - resp, err := c.InstallOperator(ctx, &dbaasv1beta1.InstallOperatorRequest{ - KubernetesClusterName: clusterName, - OperatorType: pxcOperator, - Version: onePointEight, - }) - require.Error(t, err) - assert.Nil(t, resp) - - resp, err = c.InstallOperator(ctx, &dbaasv1beta1.InstallOperatorRequest{ - KubernetesClusterName: clusterName, - OperatorType: psmdbOperator, - Version: onePointEight, - }) - require.Error(t, err) - assert.Nil(t, resp) - }) - - t.Run("Defaults supported", func(t *testing.T) { - db, c, kubeClient, kubeStorageClient := setup(t, clusterName, response, "5497") - kubeStorageClient.On("GetOrSetClient", mock.Anything).Return(kubeClient, nil) - kubeClient.On("SetKubeConfig", mock.Anything).Return(nil) - kubeClient.On("InstallOperator", mock.Anything, mock.Anything).Return(nil) - kubeClient.On("UpgradeOperator", mock.Anything, mock.Anything, mock.Anything).Return(nil) - - ctx, cancel := context.WithTimeout(context.TODO(), time.Second*5) - defer cancel() - response.Versions[1].Matrix.Pxc[defaultPXCVersion] = componentVersion{} - response.Versions[3].Matrix.Mongod[defaultPSMDBVersion] = componentVersion{} - - kubernetesCluster, err := models.FindKubernetesClusterByName(db, clusterName) - require.NoError(t, err) - kubernetesCluster.Mongod.DefaultVersion = defaultPSMDBVersion - kubernetesCluster.PXC.DefaultVersion = defaultPXCVersion - require.NoError(t, db.Save(kubernetesCluster)) - - resp, err := c.InstallOperator(ctx, &dbaasv1beta1.InstallOperatorRequest{ - KubernetesClusterName: clusterName, - OperatorType: pxcOperator, - Version: onePointEight, - }) - require.NoError(t, err) - assert.Equal(t, dbaasv1beta1.OperatorsStatus_OPERATORS_STATUS_OK, resp.Status) - - resp, err = c.InstallOperator(ctx, &dbaasv1beta1.InstallOperatorRequest{ - KubernetesClusterName: clusterName, - OperatorType: psmdbOperator, - Version: onePointEight, - }) - require.NoError(t, err) - assert.Equal(t, dbaasv1beta1.OperatorsStatus_OPERATORS_STATUS_OK, resp.Status) - }) -} - -func TestCheckForOperatorUpdate(t *testing.T) { - response := &VersionServiceResponse{ - Versions: []Version{ - { - ProductVersion: onePointSix, - Product: pxcOperator, - }, - { - ProductVersion: onePointSeven, - Product: pxcOperator, - }, - { - ProductVersion: onePointEight, - Product: pxcOperator, - }, - - { - ProductVersion: onePointSix, - Product: psmdbOperator, - }, - { - ProductVersion: onePointSeven, - Product: psmdbOperator, - }, - { - ProductVersion: onePointEight, - Product: psmdbOperator, - }, - - { - ProductVersion: twoPointEighteen, - Product: "pmm-server", - Matrix: matrix{ - PSMDBOperator: map[string]componentVersion{ - onePointEight: {Status: "recommended"}, - onePointSeven: {}, - }, - PXCOperator: map[string]componentVersion{ - onePointEight: {Status: "recommended"}, - onePointSeven: {}, - }, - }, - }, - }, - } - - pmmversion.PMMVersion = twoPointEighteen - ctx := context.Background() - t.Run("Update available", func(t *testing.T) { - clusterName := "update-available" - _, cs, kubeClient, kubeStorageClient := setup(t, clusterName, response, "9873") - kubeStorageClient.On("GetOrSetClient", mock.Anything).Return(kubeClient, nil) - kubeClient.On("GetPXCOperatorVersion", mock.Anything, mock.Anything).Return("1.7.0", nil) - kubeClient.On("GetPSMDBOperatorVersion", mock.Anything, mock.Anything).Return("1.6.0", nil) - - mockSubscriptions := &v1alpha1.SubscriptionList{ - Items: []v1alpha1.Subscription{ - { - ObjectMeta: metav1.ObjectMeta{ - Namespace: "space-x", - Name: "psmdb-operator", - }, - Spec: &v1alpha1.SubscriptionSpec{ - Package: "percona-server-mongodb-operator", - CatalogSource: "src", - Channel: "nat-geo", - }, - Status: v1alpha1.SubscriptionStatus{ - CurrentCSV: "percona-server-mongodb-operator-v1.8.0", - InstalledCSV: "percona-server-mongodb-operator-v1.2.2", - }, - }, - { - ObjectMeta: metav1.ObjectMeta{ - Namespace: "space-x", - Name: "pxc-operator", - }, - Spec: &v1alpha1.SubscriptionSpec{ - Package: "percona-xtradb-cluster-operator", - CatalogSource: "src", - Channel: "nat-geo", - }, - Status: v1alpha1.SubscriptionStatus{ - CurrentCSV: "percona-xtradb-cluster-operator-v1.8.0", - InstalledCSV: "percona-xtradb-cluster-operator-v1.2.2", - }, - }, - }, - } - kubeClient.On("ListSubscriptions", mock.Anything, mock.Anything).WaitUntil(time.After(time.Second)).Return(mockSubscriptions, nil) - kubeClient.On("SetKubeConfig", mock.Anything).Return(nil) - resp, err := cs.CheckForOperatorUpdate(ctx, &dbaasv1beta1.CheckForOperatorUpdateRequest{}) - require.NoError(t, err) - cluster := resp.ClusterToComponents[clusterName] - require.NotNil(t, cluster) - require.NotNil(t, cluster.ComponentToUpdateInformation) - require.NotNil(t, cluster.ComponentToUpdateInformation[psmdbOperator]) - require.NotNil(t, cluster.ComponentToUpdateInformation[pxcOperator]) - assert.Equal(t, onePointEight, cluster.ComponentToUpdateInformation[psmdbOperator].AvailableVersion) - assert.Equal(t, onePointEight, cluster.ComponentToUpdateInformation[pxcOperator].AvailableVersion) - }) - t.Run("Update NOT available", func(t *testing.T) { - clusterName := "update-not-available" - _, cs, kubeClient, kubeStorageClient := setup(t, clusterName, response, "7895") - kubeStorageClient.On("GetOrSetClient", mock.Anything).Return(kubeClient, nil) - kubeClient.On("GetPXCOperatorVersion", mock.Anything, mock.Anything).Return("1.7.0", nil) - kubeClient.On("GetPSMDBOperatorVersion", mock.Anything, mock.Anything).Return("1.6.0", nil) - - mockSubscriptions := &v1alpha1.SubscriptionList{ - Items: []v1alpha1.Subscription{ - { - ObjectMeta: metav1.ObjectMeta{ - Namespace: "space-x", - Name: "psmdb-operator", - }, - Spec: &v1alpha1.SubscriptionSpec{ - Package: "percona-server-mongodb-operator", - CatalogSource: "src", - Channel: "nat-geo", - }, - Status: v1alpha1.SubscriptionStatus{ - CurrentCSV: "percona-server-mongodb-operator-v1.8.0", - InstalledCSV: "percona-server-mongodb-operator-v1.8.0", - }, - }, - { - ObjectMeta: metav1.ObjectMeta{ - Namespace: "space-x", - Name: "pxc-operator", - }, - Spec: &v1alpha1.SubscriptionSpec{ - Package: "percona-xtradb-cluster-operator", - CatalogSource: "src", - Channel: "nat-geo", - }, - Status: v1alpha1.SubscriptionStatus{ - CurrentCSV: "percona-xtradb-cluster-operator-v1.8.0", - InstalledCSV: "percona-xtradb-cluster-operator-v1.8.0", - }, - }, - }, - } - kubeClient.On("ListSubscriptions", mock.Anything, mock.Anything).WaitUntil(time.After(time.Second)).Return(mockSubscriptions, nil) - kubeClient.On("SetKubeConfig", mock.Anything).Return(nil) - - resp, err := cs.CheckForOperatorUpdate(ctx, &dbaasv1beta1.CheckForOperatorUpdateRequest{}) - require.NoError(t, err) - cluster := resp.ClusterToComponents[clusterName] - require.NotNil(t, cluster) - require.NotNil(t, cluster.ComponentToUpdateInformation) - require.NotNil(t, cluster.ComponentToUpdateInformation[psmdbOperator]) - require.NotNil(t, cluster.ComponentToUpdateInformation[pxcOperator]) - assert.Equal(t, "", cluster.ComponentToUpdateInformation[psmdbOperator].AvailableVersion) - assert.Equal(t, "", cluster.ComponentToUpdateInformation[pxcOperator].AvailableVersion) - }) - t.Run("User's operators version is ahead of version service", func(t *testing.T) { - clusterName := "update-available-pmm-update" - _, cs, kubeClient, kubeStorageClient := setup(t, clusterName, response, "5863") - kubeStorageClient.On("GetOrSetClient", mock.Anything).Return(kubeClient, nil) - kubeClient.On("GetPXCOperatorVersion", mock.Anything, mock.Anything).Return("1.7.0", nil) - kubeClient.On("GetPSMDBOperatorVersion", mock.Anything, mock.Anything).Return("1.6.0", nil) - mockSubscriptions := &v1alpha1.SubscriptionList{ - Items: []v1alpha1.Subscription{ - { - ObjectMeta: metav1.ObjectMeta{ - Namespace: "space-x", - Name: "psmdb-operator", - }, - Spec: &v1alpha1.SubscriptionSpec{ - Package: "percona-server-mongodb-operator", - CatalogSource: "src", - Channel: "nat-geo", - }, - Status: v1alpha1.SubscriptionStatus{ - CurrentCSV: "percona-server-mongodb-operator-v1.8.0", - InstalledCSV: "percona-server-mongodb-operator-v1.8.0", - }, - }, - { - ObjectMeta: metav1.ObjectMeta{ - Namespace: "space-x", - Name: "pxc-operator", - }, - Spec: &v1alpha1.SubscriptionSpec{ - Package: "percona-xtradb-cluster-operator", - CatalogSource: "src", - Channel: "nat-geo", - }, - Status: v1alpha1.SubscriptionStatus{ - CurrentCSV: "percona-xtradb-cluster-operator-v1.8.0", - InstalledCSV: "percona-xtradb-cluster-operator-v1.8.0", - }, - }, - }, - } - kubeClient.On("ListSubscriptions", mock.Anything, mock.Anything).WaitUntil(time.After(time.Second)).Return(mockSubscriptions, nil) - kubeClient.On("SetKubeConfig", mock.Anything).Return(nil) - resp, err := cs.CheckForOperatorUpdate(ctx, &dbaasv1beta1.CheckForOperatorUpdateRequest{}) - require.NoError(t, err) - cluster := resp.ClusterToComponents[clusterName] - require.NotNil(t, cluster) - require.NotNil(t, cluster.ComponentToUpdateInformation) - require.NotNil(t, cluster.ComponentToUpdateInformation[psmdbOperator]) - require.NotNil(t, cluster.ComponentToUpdateInformation[pxcOperator]) - assert.Equal(t, "", cluster.ComponentToUpdateInformation[psmdbOperator].AvailableVersion) - assert.Equal(t, "", cluster.ComponentToUpdateInformation[pxcOperator].AvailableVersion) - }) -} diff --git a/managed/services/management/dbaas/db_cluster_service.go b/managed/services/management/dbaas/db_cluster_service.go deleted file mode 100644 index fd42534e5e..0000000000 --- a/managed/services/management/dbaas/db_cluster_service.go +++ /dev/null @@ -1,484 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package dbaas - -import ( - "context" - "fmt" - "strconv" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/s3" - dbaasv1 "github.com/percona/dbaas-operator/api/v1" - "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "gopkg.in/reform.v1" - corev1 "k8s.io/api/core/v1" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/services/dbaas/kubernetes" -) - -const ( - dbTemplateKindAnnotationKey = "dbaas.percona.com/dbtemplate-kind" - dbTemplateNameAnnotationKey = "dbaas.percona.com/dbtemplate-name" -) - -// DBClusterService holds unexported field and public methods to handle DB Clusters. -type DBClusterService struct { - db *reform.DB - l *logrus.Entry - grafanaClient grafanaClient - kubeStorage *KubeStorage - versionServiceClient *VersionServiceClient - - dbaasv1beta1.UnimplementedDBClustersServer -} - -// NewDBClusterService creates DB Clusters Service. -func NewDBClusterService( //nolint:ireturn - db *reform.DB, - grafanaClient grafanaClient, - versionServiceClient *VersionServiceClient, -) dbaasv1beta1.DBClustersServer { - l := logrus.WithField("component", "dbaas_db_cluster") - return &DBClusterService{ - db: db, - l: l, - grafanaClient: grafanaClient, - kubeStorage: NewKubeStorage(db), - versionServiceClient: versionServiceClient, - } -} - -// ListDBClusters returns a list of all DB clusters. -func (s DBClusterService) ListDBClusters(ctx context.Context, req *dbaasv1beta1.ListDBClustersRequest) (*dbaasv1beta1.ListDBClustersResponse, error) { - kubeClient, err := s.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, err - } - dbClusters, err := kubeClient.ListDatabaseClusters(ctx) - if err != nil { - // return nil, errors.Wrap(err, "failed listing database clusters") - dbClusters = &dbaasv1.DatabaseClusterList{Items: []dbaasv1.DatabaseCluster{}} - } - psmdbOperatorVersion, err := kubeClient.GetPSMDBOperatorVersion(ctx) - if err != nil { - s.l.Errorf("failed determining version of psmdb operator: %v", err) - } - - pxcOperatorVersion, err := kubeClient.GetPXCOperatorVersion(ctx) - if err != nil { - s.l.Errorf("failed determining version of pxc operator: %v", err) - } - psmdbClusters := []*dbaasv1beta1.PSMDBCluster{} - pxcClusters := []*dbaasv1beta1.PXCCluster{} - - for _, cluster := range dbClusters.Items { - switch cluster.Spec.Database { - case kubernetes.DatabaseTypePXC: - c, err := s.getPXCCluster(ctx, cluster, pxcOperatorVersion) - if err != nil { - s.l.Errorf("failed getting PXC cluster: %v", err) - } - pxcClusters = append(pxcClusters, c) - case kubernetes.DatabaseTypePSMDB: - c, err := s.getPSMDBCluster(ctx, cluster, psmdbOperatorVersion) - if err != nil { - s.l.Errorf("failed getting PSMDB cluster: %v", err) - } - psmdbClusters = append(psmdbClusters, c) - default: - s.l.Errorf("unsupported database type %s", cluster.Spec.Database) - } - } - - return &dbaasv1beta1.ListDBClustersResponse{ - PxcClusters: pxcClusters, - PsmdbClusters: psmdbClusters, - }, nil -} - -func (s DBClusterService) getClusterResource(instance dbaasv1.DBInstanceSpec) (diskSize int64, memory int64, cpu int, err error) { //nolint:nonamedreturns - disk, ok := (&instance.DiskSize).AsInt64() - if ok { - diskSize = disk - } - mem, ok := (&instance.Memory).AsInt64() - if ok { - memory = mem - } - cpuResource := (&instance.CPU).String() - var cpuMillis int64 - if strings.HasSuffix(cpuResource, "m") { - cpuResource = cpuResource[:len(cpuResource)-1] - cpuMillis, err = strconv.ParseInt(cpuResource, 10, 64) - if err != nil { - return - } - } - cpu = int(cpuMillis) - var floatCPU float64 - if cpuMillis == 0 { - floatCPU, err = strconv.ParseFloat(cpuResource, 64) - if err != nil { - return - } - cpu = int(floatCPU * 1000) - } - return -} - -func (s DBClusterService) getPXCCluster(ctx context.Context, cluster dbaasv1.DatabaseCluster, operatorVersion string) (*dbaasv1beta1.PXCCluster, error) { - lbType, internetFacing := cluster.Spec.LoadBalancer.Annotations["service.beta.kubernetes.io/aws-load-balancer-type"] - diskSize, memory, cpu, err := s.getClusterResource(cluster.Spec.DBInstance) - if err != nil { - return nil, err - } - c := &dbaasv1beta1.PXCCluster{ - Name: cluster.Name, - Params: &dbaasv1beta1.PXCClusterParams{ - ClusterSize: cluster.Spec.ClusterSize, - Pxc: &dbaasv1beta1.PXCClusterParams_PXC{ - DiskSize: diskSize, - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: int32(cpu), - MemoryBytes: memory, - }, - Configuration: cluster.Spec.DatabaseConfig, - }, - }, - State: dbClusterStates()[cluster.Status.State], - Exposed: cluster.Spec.LoadBalancer.ExposeType == corev1.ServiceTypeNodePort || cluster.Spec.LoadBalancer.ExposeType == corev1.ServiceTypeLoadBalancer, - InternetFacing: internetFacing || lbType == "external", - SourceRanges: cluster.Spec.LoadBalancer.LoadBalancerSourceRanges, - Operation: &dbaasv1beta1.RunningOperation{ - TotalSteps: cluster.Status.Size, - FinishedSteps: cluster.Status.Ready, - Message: cluster.Status.Message, - }, - } - if cluster.Spec.DBInstance.StorageClassName != nil { - c.Params.Pxc.StorageClass = *cluster.Spec.DBInstance.StorageClassName - } - if cluster.Spec.LoadBalancer.Type == "proxysql" { - compute, err := s.getComputeResources(cluster.Spec.LoadBalancer.Resources.Requests) - if err != nil { - s.l.Errorf("could not parse resources for proxysql %v", err) - } - c.Params.Proxysql = &dbaasv1beta1.PXCClusterParams_ProxySQL{ - ComputeResources: compute, - Image: cluster.Spec.LoadBalancer.Image, - } - } - if cluster.Spec.LoadBalancer.Type == "haproxy" { - compute, err := s.getComputeResources(cluster.Spec.LoadBalancer.Resources.Requests) - if err != nil { - s.l.Errorf("could not parse resources for proxysql %v", err) - } - c.Params.Haproxy = &dbaasv1beta1.PXCClusterParams_HAProxy{ - ComputeResources: compute, - Image: cluster.Spec.LoadBalancer.Image, - } - } - imageAndTag := strings.Split(cluster.Spec.DatabaseImage, ":") - if len(imageAndTag) != 2 { - return nil, errors.Errorf("failed to parse Xtradb Cluster version out of %q", cluster.Spec.DatabaseImage) - } - currentDBVersion := imageAndTag[1] - - nextVersionImage, err := s.versionServiceClient.GetNextDatabaseImage(ctx, pxcOperator, operatorVersion, currentDBVersion) - if err != nil { - return nil, err - } - c.AvailableImage = nextVersionImage - c.InstalledImage = cluster.Spec.DatabaseImage - - if cluster.ObjectMeta.Annotations != nil { - templateName, templateNameExists := cluster.ObjectMeta.Annotations[dbTemplateNameAnnotationKey] - templateKind, templateKindExists := cluster.ObjectMeta.Annotations[dbTemplateKindAnnotationKey] - if templateNameExists && templateKindExists { - c.Template = &dbaasv1beta1.Template{ - Name: templateName, - Kind: templateKind, - } - } - } - - return c, nil -} - -func (s DBClusterService) getComputeResources(resources corev1.ResourceList) (*dbaasv1beta1.ComputeResources, error) { - compute := &dbaasv1beta1.ComputeResources{} - cpuLimit, ok := resources[corev1.ResourceCPU] - if ok { - cpu := (&cpuLimit).String() - if strings.HasSuffix(cpu, "m") { - cpu = cpu[:len(cpu)-1] - millis, err := strconv.ParseUint(cpu, 10, 64) - if err != nil { - return compute, err - } - compute.CpuM = int32(millis) - } - if compute.CpuM == 0 { - floatCPU, err := strconv.ParseFloat(cpu, 64) - if err != nil { - return compute, err - } - compute.CpuM = int32(floatCPU * 1000) - } - } - memLimit, ok := resources[corev1.ResourceMemory] - if ok { - mem, ok := (&memLimit).AsInt64() - if ok { - compute.MemoryBytes = mem - } - } - return compute, nil -} - -func (s DBClusterService) getPSMDBCluster(ctx context.Context, cluster dbaasv1.DatabaseCluster, operatorVersion string) (*dbaasv1beta1.PSMDBCluster, error) { - diskSize, memory, cpu, err := s.getClusterResource(cluster.Spec.DBInstance) - if err != nil { - return nil, err - } - lbType, internetFacing := cluster.Spec.LoadBalancer.Annotations["service.beta.kubernetes.io/aws-load-balancer-type"] - c := &dbaasv1beta1.PSMDBCluster{ - Name: cluster.Name, - Params: &dbaasv1beta1.PSMDBClusterParams{ - ClusterSize: cluster.Spec.ClusterSize, - Replicaset: &dbaasv1beta1.PSMDBClusterParams_ReplicaSet{ - DiskSize: diskSize, - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: int32(cpu), - MemoryBytes: memory, - }, - Configuration: cluster.Spec.DatabaseConfig, - }, - }, - State: dbClusterStates()[cluster.Status.State], - Exposed: cluster.Spec.LoadBalancer.ExposeType == corev1.ServiceTypeNodePort || cluster.Spec.LoadBalancer.ExposeType == corev1.ServiceTypeLoadBalancer, - InternetFacing: internetFacing || lbType == "external", - SourceRanges: cluster.Spec.LoadBalancer.LoadBalancerSourceRanges, - Operation: &dbaasv1beta1.RunningOperation{ - TotalSteps: cluster.Status.Size, - FinishedSteps: cluster.Status.Ready, - // TODO: Add messages - Message: "", - }, - } - if cluster.Spec.DBInstance.StorageClassName != nil { - c.Params.Replicaset.StorageClass = *cluster.Spec.DBInstance.StorageClassName - } - imageAndTag := strings.Split(cluster.Spec.DatabaseImage, ":") - if len(imageAndTag) != 2 { - return nil, errors.Errorf("failed to parse PSMDB version out of %q", cluster.Spec.DatabaseImage) - } - currentDBVersion := imageAndTag[1] - - nextVersionImage, err := s.versionServiceClient.GetNextDatabaseImage(ctx, psmdbOperator, operatorVersion, currentDBVersion) - if err != nil { - return nil, err - } - c.AvailableImage = nextVersionImage - c.InstalledImage = cluster.Spec.DatabaseImage - - if cluster.ObjectMeta.Annotations != nil { - templateName, templateNameExists := cluster.ObjectMeta.Annotations[dbTemplateNameAnnotationKey] - templateKind, templateKindExists := cluster.ObjectMeta.Annotations[dbTemplateKindAnnotationKey] - if templateNameExists && templateKindExists { - c.Template = &dbaasv1beta1.Template{ - Name: templateName, - Kind: templateKind, - } - } - } - - return c, nil -} - -func (s DBClusterService) GetDBCluster(ctx context.Context, req *dbaasv1beta1.GetDBClusterRequest) (*dbaasv1beta1.GetDBClusterResponse, error) { - kubeClient, err := s.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, err - } - dbCluster, err := kubeClient.GetDatabaseCluster(ctx, req.Name) - if err != nil { - return nil, errors.Wrap(err, "failed getting the database cluster") - } - psmdbOperatorVersion, err := kubeClient.GetPSMDBOperatorVersion(ctx) - if err != nil { - return nil, errors.Wrap(err, "failed getting psmdb operator version") - } - - pxcOperatorVersion, err := kubeClient.GetPXCOperatorVersion(ctx) - if err != nil { - return nil, errors.Wrap(err, "failed getting pxc operator version") - } - resp := &dbaasv1beta1.GetDBClusterResponse{} - if dbCluster.Spec.Database == kubernetes.DatabaseTypePXC && pxcOperatorVersion != "" { - c, err := s.getPXCCluster(ctx, *dbCluster, pxcOperatorVersion) - if err != nil { - return nil, errors.Wrap(err, "failed getting PXC cluster") - } - resp.PxcCluster = c - } - if dbCluster.Spec.Database == kubernetes.DatabaseTypePSMDB && psmdbOperatorVersion != "" { - c, err := s.getPSMDBCluster(ctx, *dbCluster, psmdbOperatorVersion) - if err != nil { - return nil, errors.Wrap(err, "failed getting PSMDB cluster") - } - resp.PsmdbCluster = c - } - return resp, nil -} - -// RestartDBCluster restarts DB cluster by given name and type. -func (s DBClusterService) RestartDBCluster(ctx context.Context, req *dbaasv1beta1.RestartDBClusterRequest) (*dbaasv1beta1.RestartDBClusterResponse, error) { - kubeClient, err := s.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, err - } - err = kubeClient.RestartDatabaseCluster(ctx, req.Name) - if err != nil { - return nil, err - } - - return &dbaasv1beta1.RestartDBClusterResponse{}, nil -} - -// DeleteDBCluster deletes DB cluster by given name and type. -func (s DBClusterService) DeleteDBCluster(ctx context.Context, req *dbaasv1beta1.DeleteDBClusterRequest) (*dbaasv1beta1.DeleteDBClusterResponse, error) { - kubeClient, err := s.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, err - } - err = kubeClient.DeleteDatabaseCluster(ctx, req.Name) - if err != nil { - return nil, err - } - - var clusterType string - switch req.ClusterType { - case dbaasv1beta1.DBClusterType_DB_CLUSTER_TYPE_PXC: - clusterType = string(kubernetes.DatabaseTypePXC) - case dbaasv1beta1.DBClusterType_DB_CLUSTER_TYPE_PSMDB: - clusterType = string(kubernetes.DatabaseTypePSMDB) - default: - return nil, status.Error(codes.InvalidArgument, "unexpected DB cluster type") - } - - err = s.grafanaClient.DeleteAPIKeysWithPrefix(ctx, fmt.Sprintf("%s-%s-%s", clusterType, req.KubernetesClusterName, req.Name)) - if err != nil { - // ignore if API Key is not deleted. - s.l.Warnf("Couldn't delete API key: %s", err) - } - - return &dbaasv1beta1.DeleteDBClusterResponse{}, nil -} - -// ListS3Backups returns list of backup artifacts stored on s3 -func (s DBClusterService) ListS3Backups(ctx context.Context, req *dbaasv1beta1.ListS3BackupsRequest) (*dbaasv1beta1.ListS3BackupsResponse, error) { - if req == nil || (req != nil && req.LocationId == "") { - return nil, errors.New("location_id cannot be empty") - } - backupLocation, err := models.FindBackupLocationByID(s.db.Querier, req.LocationId) - if err != nil { - return nil, err - } - if backupLocation.Type != models.S3BackupLocationType { - return nil, errors.New("only s3 compatible storages are supported") - } - sess, err := session.NewSession(&aws.Config{ - Region: aws.String(backupLocation.S3Config.BucketRegion), - Credentials: credentials.NewStaticCredentials( - backupLocation.S3Config.AccessKey, - backupLocation.S3Config.SecretKey, - ""), - }) - if err != nil { - return nil, err - } - s3Client := s3.New(sess) - var items []*dbaasv1beta1.S3Item - obj, err := s3Client.ListObjects(&s3.ListObjectsInput{ - Bucket: aws.String(backupLocation.S3Config.BucketName), - Delimiter: aws.String("/"), - }) - if err != nil { - return nil, err - } - keyMap := make(map[string]struct{}) - for _, item := range obj.Contents { - if *item.Key == ".pmb.init" { - continue - } - parts := strings.Split(*item.Key, "Z_") - if len(parts) == 2 { - if _, ok := keyMap[parts[0]]; !ok { - items = append(items, &dbaasv1beta1.S3Item{ - Key: fmt.Sprintf("s3://%s/%s", backupLocation.S3Config.BucketName, fmt.Sprintf("%sZ", parts[0])), - }) - keyMap[parts[0]] = struct{}{} - } - } - parts = strings.Split(*item.Key, ".md5") - if len(parts) == 2 { - items = append(items, &dbaasv1beta1.S3Item{ - Key: fmt.Sprintf("s3://%s/%s", backupLocation.S3Config.BucketName, parts[0]), - }) - } - } - return &dbaasv1beta1.ListS3BackupsResponse{Backups: items}, nil -} - -// ListSecrets returns list of secret names to the end user -func (s DBClusterService) ListSecrets(ctx context.Context, req *dbaasv1beta1.ListSecretsRequest) (*dbaasv1beta1.ListSecretsResponse, error) { - kubeClient, err := s.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, err - } - secretsList, err := kubeClient.ListSecrets(ctx) - if err != nil { - return nil, errors.Wrap(err, "failed listing database clusters") - } - secrets := make([]*dbaasv1beta1.Secret, 0, len(secretsList.Items)) - for _, secret := range secretsList.Items { - secrets = append(secrets, &dbaasv1beta1.Secret{ - Name: secret.Name, - }) - } - return &dbaasv1beta1.ListSecretsResponse{Secrets: secrets}, nil -} - -func dbClusterStates() map[dbaasv1.AppState]dbaasv1beta1.DBClusterState { - return map[dbaasv1.AppState]dbaasv1beta1.DBClusterState{ - dbaasv1.AppStateUnknown: dbaasv1beta1.DBClusterState_DB_CLUSTER_STATE_INVALID, - dbaasv1.AppStateInit: dbaasv1beta1.DBClusterState_DB_CLUSTER_STATE_CHANGING, - dbaasv1.AppStateReady: dbaasv1beta1.DBClusterState_DB_CLUSTER_STATE_READY, - dbaasv1.AppStateError: dbaasv1beta1.DBClusterState_DB_CLUSTER_STATE_FAILED, - dbaasv1.AppStateStopping: dbaasv1beta1.DBClusterState_DB_CLUSTER_STATE_CHANGING, - dbaasv1.AppStatePaused: dbaasv1beta1.DBClusterState_DB_CLUSTER_STATE_PAUSED, - } -} diff --git a/managed/services/management/dbaas/db_cluster_service_test.go b/managed/services/management/dbaas/db_cluster_service_test.go deleted file mode 100644 index 8afa320443..0000000000 --- a/managed/services/management/dbaas/db_cluster_service_test.go +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package dbaas - -import ( - "context" - "fmt" - "testing" - - "github.com/google/uuid" - controllerv1beta1 "github.com/percona-platform/dbaas-api/gen/controller" - dbaasv1 "github.com/percona/dbaas-operator/api/v1" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "gopkg.in/reform.v1" - "gopkg.in/reform.v1/dialects/postgresql" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/utils/testdb" - "github.com/percona/pmm/managed/utils/tests" - "github.com/percona/pmm/utils/logger" -) - -const dbKubeconfigTest = ` -{ - "apiVersion": "v1", - "kind": "Config", - "users": [ - { - "name": "percona-xtradb-cluster-operator", - "user": { - "token": "some-token" - } - } - ], - "clusters": [ - { - "cluster": { - "certificate-authority-data": "some-certificate-authority-data", - "server": "https://192.168.0.42:8443" - }, - "name": "self-hosted-cluster" - } - ], - "contexts": [ - { - "context": { - "cluster": "self-hosted-cluster", - "user": "percona-xtradb-cluster-operator" - }, - "name": "svcs-acct-context" - } - ], - "current-context": "svcs-acct-context" -} -` - -const ( - dbKubernetesClusterNameTest = "test-k8s-db-cluster-name" - version230 = "2.30.0" -) - -func TestDBClusterService(t *testing.T) { - setup := func(t *testing.T) (ctx context.Context, db *reform.DB, dbaasClient *mockDbaasClient, grafanaClient *mockGrafanaClient, kubernetesClient *mockKubernetesClient, teardown func(t *testing.T)) { - t.Helper() - - ctx = logger.Set(context.Background(), t.Name()) - uuid.SetRand(&tests.IDReader{}) - - sqlDB := testdb.Open(t, models.SetupFixtures, nil) - db = reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) - dbaasClient = &mockDbaasClient{} - grafanaClient = &mockGrafanaClient{} - kubernetesClient = &mockKubernetesClient{} - - teardown = func(t *testing.T) { - t.Helper() - uuid.SetRand(nil) - dbaasClient.AssertExpectations(t) - } - - return - } - - ctx, db, dbaasClient, grafanaClient, kubeClient, teardown := setup(t) - defer teardown(t) - - versionService := NewVersionServiceClient(versionServiceURL) - - ks := NewKubernetesServer(db, dbaasClient, versionService, grafanaClient) - kubeClient.On("GetPSMDBOperatorVersion", mock.Anything, mock.Anything).Return("1.11.0", nil) - kubeClient.On("GetPXCOperatorVersion", mock.Anything, mock.Anything).Return("1.11.0", nil) - kubeClient.On("SetKubeConfig", mock.Anything).Return(nil) - kubeClient.On("InstallOLMOperator", mock.Anything, mock.Anything).Return(nil) - kubeClient.On("InstallOperator", mock.Anything, mock.Anything).Return(nil) - - grafanaClient.On("CreateAdminAPIKey", mock.Anything, mock.Anything).Return(int64(123456), "api-key", nil) - - dbaasClient.On("StartMonitoring", mock.Anything, mock.Anything).Return(&controllerv1beta1.StartMonitoringResponse{}, nil) - kubeClient.On("GetServerVersion").Return(nil, nil) - clients := map[string]kubernetesClient{ - dbKubernetesClusterNameTest: kubeClient, - } - - s := ks.(*kubernetesServer) - s.kubeStorage.clients = clients - ks = s - registerKubernetesClusterResponse, err := ks.RegisterKubernetesCluster(ctx, &dbaasv1beta1.RegisterKubernetesClusterRequest{ - KubernetesClusterName: dbKubernetesClusterNameTest, - KubeAuth: &dbaasv1beta1.KubeAuth{Kubeconfig: dbKubeconfigTest}, - }) - require.NoError(t, err) - assert.NotNil(t, registerKubernetesClusterResponse) - t.Run("BasicListPXCClusters", func(t *testing.T) { - cs := NewDBClusterService(db, grafanaClient, versionService) - s := cs.(*DBClusterService) - s.kubeStorage.clients = clients - mockK8sResp := []dbaasv1.DatabaseCluster{ - { - ObjectMeta: metav1.ObjectMeta{ - Name: "first-pxc-test", - }, - Spec: dbaasv1.DatabaseSpec{ - Database: "pxc", - DatabaseImage: "percona/percona-xtradb-cluster:8.0.27-18.1", - ClusterSize: 5, - DBInstance: dbaasv1.DBInstanceSpec{ - CPU: resource.MustParse("3m"), - Memory: resource.MustParse("256"), - DiskSize: resource.MustParse("1073741824"), - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "proxysql", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("2m"), - corev1.ResourceMemory: resource.MustParse("124"), - }, - }, - }, - }, - Status: dbaasv1.DatabaseClusterStatus{ - Ready: 15, - Size: 15, - }, - }, - { - ObjectMeta: metav1.ObjectMeta{ - Name: "first-psmdb-test", - }, - Spec: dbaasv1.DatabaseSpec{ - Database: "psmdb", - DatabaseImage: "percona/percona-server-mongodb:4.4.5-7", - ClusterSize: 5, - DBInstance: dbaasv1.DBInstanceSpec{ - CPU: resource.MustParse("3m"), - Memory: resource.MustParse("256"), - DiskSize: resource.MustParse("1073741824"), - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "mongos", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("2m"), - corev1.ResourceMemory: resource.MustParse("124"), - }, - }, - }, - }, - Status: dbaasv1.DatabaseClusterStatus{ - Ready: 10, - Size: 10, - }, - }, - } - - kubeClient.On("ListDatabaseClusters", ctx, mock.Anything).Return(&dbaasv1.DatabaseClusterList{Items: mockK8sResp}, nil) - - resp, err := s.ListDBClusters(ctx, &dbaasv1beta1.ListDBClustersRequest{KubernetesClusterName: dbKubernetesClusterNameTest}) - assert.NoError(t, err) - assert.Len(t, resp.PxcClusters, 1) - require.NotNil(t, resp.PxcClusters[0]) - assert.Equal(t, resp.PxcClusters[0].Name, "first-pxc-test") - assert.Equal(t, int32(5), resp.PxcClusters[0].Params.ClusterSize) - assert.Equal(t, int32(3), resp.PxcClusters[0].Params.Pxc.ComputeResources.CpuM) - assert.Equal(t, int64(256), resp.PxcClusters[0].Params.Pxc.ComputeResources.MemoryBytes) - assert.Equal(t, int32(2), resp.PxcClusters[0].Params.Proxysql.ComputeResources.CpuM) - assert.Equal(t, int64(124), resp.PxcClusters[0].Params.Proxysql.ComputeResources.MemoryBytes) - assert.Equal(t, int32(15), resp.PxcClusters[0].Operation.TotalSteps) - assert.Equal(t, int32(15), resp.PxcClusters[0].Operation.FinishedSteps) - - assert.Len(t, resp.PsmdbClusters, 1) - require.NotNil(t, resp.PsmdbClusters[0]) - assert.Equal(t, resp.PsmdbClusters[0].Name, "first-psmdb-test") - assert.Equal(t, int32(5), resp.PsmdbClusters[0].Params.ClusterSize) - assert.Equal(t, int32(3), resp.PsmdbClusters[0].Params.Replicaset.ComputeResources.CpuM) - assert.Equal(t, int64(256), resp.PsmdbClusters[0].Params.Replicaset.ComputeResources.MemoryBytes) - assert.Equal(t, int32(10), resp.PsmdbClusters[0].Operation.TotalSteps) - assert.Equal(t, int32(10), resp.PsmdbClusters[0].Operation.FinishedSteps) - }) - - t.Run("BasicRestartPXCCluster", func(t *testing.T) { - cs := NewDBClusterService(db, grafanaClient, versionService) - s := cs.(*DBClusterService) - s.kubeStorage.clients = clients - - kubeClient.On("RestartDatabaseCluster", ctx, "third-pxc-test").Return(nil) - - in := dbaasv1beta1.RestartDBClusterRequest{ - KubernetesClusterName: dbKubernetesClusterNameTest, - Name: "third-pxc-test", - ClusterType: dbaasv1beta1.DBClusterType_DB_CLUSTER_TYPE_PXC, - } - - _, err := s.RestartDBCluster(ctx, &in) - assert.NoError(t, err) - }) - - t.Run("BasicRestartPSMDBCluster", func(t *testing.T) { - cs := NewDBClusterService(db, grafanaClient, versionService) - s := cs.(*DBClusterService) - s.kubeStorage.clients = clients - - kubeClient.On("RestartDatabaseCluster", ctx, "third-psmdb-test").Return(nil) - - in := dbaasv1beta1.RestartDBClusterRequest{ - KubernetesClusterName: dbKubernetesClusterNameTest, - Name: "third-psmdb-test", - ClusterType: dbaasv1beta1.DBClusterType_DB_CLUSTER_TYPE_PSMDB, - } - - _, err := s.RestartDBCluster(ctx, &in) - assert.NoError(t, err) - }) - - t.Run("BasicDeletePXCCluster", func(t *testing.T) { - cs := NewDBClusterService(db, grafanaClient, versionService) - s := cs.(*DBClusterService) - s.kubeStorage.clients = clients - dbClusterName := "delete-pxc-test" - - kubeClient.On("DeleteDatabaseCluster", ctx, dbClusterName).Return(nil) - grafanaClient.On("DeleteAPIKeysWithPrefix", ctx, fmt.Sprintf("pxc-%s-%s", dbKubernetesClusterNameTest, dbClusterName)).Return(nil) - - in := dbaasv1beta1.DeleteDBClusterRequest{ - KubernetesClusterName: dbKubernetesClusterNameTest, - Name: dbClusterName, - ClusterType: dbaasv1beta1.DBClusterType_DB_CLUSTER_TYPE_PXC, - } - - _, err := s.DeleteDBCluster(ctx, &in) - assert.NoError(t, err) - }) - - t.Run("BasicDeletePSMDBCluster", func(t *testing.T) { - cs := NewDBClusterService(db, grafanaClient, versionService) - s := cs.(*DBClusterService) - s.kubeStorage.clients = clients - dbClusterName := "delete-psmdb-test" - kubeClient.On("DeleteDatabaseCluster", ctx, dbClusterName).Return(nil) - - grafanaClient.On("DeleteAPIKeysWithPrefix", ctx, fmt.Sprintf("psmdb-%s-%s", dbKubernetesClusterNameTest, dbClusterName)).Return(nil) - - in := dbaasv1beta1.DeleteDBClusterRequest{ - KubernetesClusterName: dbKubernetesClusterNameTest, - Name: dbClusterName, - ClusterType: dbaasv1beta1.DBClusterType_DB_CLUSTER_TYPE_PSMDB, - } - - _, err := s.DeleteDBCluster(ctx, &in) - assert.NoError(t, err) - }) - t.Run("GetComputeResource", func(t *testing.T) { - cs := NewDBClusterService(db, grafanaClient, versionService) - s := cs.(*DBClusterService) - compute, err := s.getComputeResources(corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("1000m"), - corev1.ResourceMemory: resource.MustParse("1G"), - }) - assert.NoError(t, err) - assert.Equal(t, &dbaasv1beta1.ComputeResources{ - CpuM: 1000, - MemoryBytes: 1000000000, - }, compute) - }) -} diff --git a/managed/services/management/dbaas/dbaas_initializer.go b/managed/services/management/dbaas/dbaas_initializer.go deleted file mode 100644 index 155570e388..0000000000 --- a/managed/services/management/dbaas/dbaas_initializer.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package dbaas - -import ( - "context" - "sync" - "time" - - dbaascontrollerv1beta1 "github.com/percona-platform/dbaas-api/gen/controller" - "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "gopkg.in/reform.v1" - "k8s.io/client-go/rest" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - "github.com/percona/pmm/managed/models" -) - -// Initializer initializes dbaas feature -type Initializer struct { - db *reform.DB - l *logrus.Entry - - dbaasClient dbaasClient - kubernetesServer dbaasv1beta1.KubernetesServer - - enabled bool - cancel func() - m sync.Mutex -} - -const ( - defaultClusterName = "default-pmm-cluster" - pxcSecretNameTmpl = "dbaas-%s-pxc-secrets" //nolint:gosec - psmdbSecretNameTmpl = "dbaas-%s-psmdb-secrets" //nolint:gosec -) - -var errClusterExists = errors.New("cluster already exists") - -// NewInitializer returns initialized Initializer structure -func NewInitializer(db *reform.DB, client dbaasClient) *Initializer { - l := logrus.WithField("component", "dbaas_initializer") - return &Initializer{ - db: db, - l: l, - dbaasClient: client, - } -} - -// RegisterKubernetesServer sets the Kubernetes server instance. -func (in *Initializer) RegisterKubernetesServer(k dbaasv1beta1.KubernetesServer) { - in.kubernetesServer = k -} - -// Update updates current dbaas settings -func (in *Initializer) Update(ctx context.Context) error { - settings, err := models.GetSettings(in.db) - if err != nil { - in.l.Errorf("Failed to get settings: %+v.", err) - return err - } - if settings.DBaaS.Enabled { - return in.Enable(ctx) - } - return in.Disable(ctx) -} - -// Enable enables dbaas feature and connects to dbaas-controller -func (in *Initializer) Enable(ctx context.Context) error { - in.m.Lock() - defer in.m.Unlock() - if in.enabled { - return nil - } - timeoutCtx, cancel := context.WithTimeout(ctx, 20*time.Second) - defer cancel() - err := in.dbaasClient.Connect(timeoutCtx) - if err != nil { - return err - } - ctx, in.cancel = context.WithCancel(ctx) - - in.enabled = true - return in.registerInCluster(ctx) -} - -// registerIncluster automatically adds k8s cluster to dbaas when PMM is running inside k8s cluster -func (in *Initializer) registerInCluster(ctx context.Context) error { - kubeConfig, err := in.dbaasClient.GetKubeConfig(ctx, &dbaascontrollerv1beta1.GetKubeconfigRequest{}) - switch { - case err == nil: - // If err is not equal to nil, dont' register cluster and fail silently - err := in.db.InTransaction(func(t *reform.TX) error { - cluster, err := models.FindKubernetesClusterByName(t.Querier, defaultClusterName) - if err != nil { - in.l.Errorf("failed finding cluster: %v", err) - return nil - } - if cluster != nil { - return errClusterExists - } - return nil - }) - if err != nil { - if errors.Is(err, errClusterExists) { - return nil - } - return err - } - if len(kubeConfig.Kubeconfig) != 0 { - req := &dbaasv1beta1.RegisterKubernetesClusterRequest{ - KubernetesClusterName: defaultClusterName, - KubeAuth: &dbaasv1beta1.KubeAuth{ - Kubeconfig: kubeConfig.Kubeconfig, - }, - } - _, err = in.kubernetesServer.RegisterKubernetesCluster(ctx, req) - if err != nil { - return err - } - in.l.Info("Cluster is successfully initialized") - } - case errors.Is(err, rest.ErrNotInCluster): - in.l.Info("PMM is running outside a kubernetes cluster") - default: - in.l.Errorf("failed getting kubeconfig inside cluster: %v", err) - } - return nil -} - -// Disable disconnects from dbaas-controller and disabled dbaas feature -func (in *Initializer) Disable(_ context.Context) error { - in.m.Lock() - defer in.m.Unlock() - if !in.enabled { // Don't disable if already disabled - return nil - } - if in.cancel != nil { - in.cancel() - } - err := in.dbaasClient.Disconnect() - if err != nil { - return err - } - in.enabled = false - return nil -} diff --git a/managed/services/management/dbaas/deps.go b/managed/services/management/dbaas/deps.go deleted file mode 100644 index 3f9be6d5f5..0000000000 --- a/managed/services/management/dbaas/deps.go +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -// Package dbaas contains all APIs related to DBaaS. -// -//nolint:lll -package dbaas - -import ( - "context" - - goversion "github.com/hashicorp/go-version" - olmalpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" - controllerv1beta1 "github.com/percona-platform/dbaas-api/gen/controller" - dbaasv1 "github.com/percona/dbaas-operator/api/v1" - "google.golang.org/grpc" - corev1 "k8s.io/api/core/v1" - storagev1 "k8s.io/api/storage/v1" - "k8s.io/apimachinery/pkg/version" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - "github.com/percona/pmm/managed/services/dbaas/kubernetes" -) - -//go:generate ../../../../bin/mockery --name=dbaasClient --case=snake --inpackage --testonly -//go:generate ../../../../bin/mockery --name=versionService --case=snake --inpackage --testonly -//go:generate ../../../../bin/mockery --name=grafanaClient --case=snake --inpackage --testonly -//go:generate ../../../../bin/mockery --name=componentsService --case=snake --inpackage --testonly -//go:generate ../../../../bin/mockery --name=kubernetesClient --case=snake --inpackage --testonly -//go:generate ../../../../bin/mockery --name=kubeStorageManager --case=snake --inpackage --testonly - -type dbaasClient interface { - // Connect connects the client to dbaas-controller API. - Connect(ctx context.Context) error - // Disconnect disconnects the client from dbaas-controller API. - Disconnect() error - // GetLogs gets logs out of cluster containers and events out of pods. - GetLogs(ctx context.Context, in *controllerv1beta1.GetLogsRequest, opts ...grpc.CallOption) (*controllerv1beta1.GetLogsResponse, error) - // GetResources returns all and available resources of a Kubernetes cluster. - GetResources(ctx context.Context, in *controllerv1beta1.GetResourcesRequest, opts ...grpc.CallOption) (*controllerv1beta1.GetResourcesResponse, error) - InstallPXCOperator(ctx context.Context, in *controllerv1beta1.InstallPXCOperatorRequest, opts ...grpc.CallOption) (*controllerv1beta1.InstallPXCOperatorResponse, error) - // InstallPSMDBOperator installs kubernetes psmdb operator. - InstallPSMDBOperator(ctx context.Context, in *controllerv1beta1.InstallPSMDBOperatorRequest, opts ...grpc.CallOption) (*controllerv1beta1.InstallPSMDBOperatorResponse, error) - // StartMonitoring sets up victoria metrics operator to monitor kubernetes cluster. - StartMonitoring(ctx context.Context, in *controllerv1beta1.StartMonitoringRequest, opts ...grpc.CallOption) (*controllerv1beta1.StartMonitoringResponse, error) - // StopMonitoring removes victoria metrics operator from the cluster. - StopMonitoring(ctx context.Context, in *controllerv1beta1.StopMonitoringRequest, opts ...grpc.CallOption) (*controllerv1beta1.StopMonitoringResponse, error) - // GetKubeConfig gets inluster config and converts it to kubeConfig - GetKubeConfig(ctx context.Context, in *controllerv1beta1.GetKubeconfigRequest, opts ...grpc.CallOption) (*controllerv1beta1.GetKubeconfigResponse, error) -} - -type versionService interface { - // Matrix calls version service with given params and returns components matrix. - Matrix(ctx context.Context, params componentsParams) (*VersionServiceResponse, error) - // GetNextDatabaseImage returns image of the dabase version that is a direct successor of currently installed version. - GetNextDatabaseImage(ctx context.Context, operatorType, operatorVersion, installedDBVersion string) (string, error) - // GetVersionServiceURL version service used by version service client. - GetVersionServiceURL() string - // IsDatabaseVersionSupportedByOperator returns false and err when request to version service fails. Otherwise returns boolen telling - // if given database version is supported by given operator version, error is nil in that case. - IsDatabaseVersionSupportedByOperator(ctx context.Context, operatorType, operatorVersion, databaseVersion string) (bool, error) - // SupportedOperatorVersionsList returns list of operators versions supported by certain PMM version. - SupportedOperatorVersionsList(ctx context.Context, pmmVersion string) (map[string][]string, error) - // LatestOperatorVersion returns latest operators versions available based on given params. - LatestOperatorVersion(ctx context.Context, pmmVersion string) (latestPXCOperatorVersion, latestPSMDBOperatorVersion *goversion.Version, err error) - // NextOperatorVersion returns operator versions that is a direct successor of currently installed one. - // Compatibility with PMM is not taken into account. - NextOperatorVersion(ctx context.Context, operatorType, installedVersion string) (nextOperatorVersion *goversion.Version, err error) -} - -// grafanaClient is a subset of methods of grafana.Client used by this package. -// We use it instead of real type for testing and to avoid dependency cycle. -type grafanaClient interface { - CreateAdminAPIKey(ctx context.Context, name string) (int64, string, error) - DeleteAPIKeysWithPrefix(ctx context.Context, name string) error - DeleteAPIKeyByID(ctx context.Context, id int64) error -} - -type componentsService interface { - GetPSMDBComponents(context.Context, *dbaasv1beta1.GetPSMDBComponentsRequest) (*dbaasv1beta1.GetPSMDBComponentsResponse, error) - GetPXCComponents(context.Context, *dbaasv1beta1.GetPXCComponentsRequest) (*dbaasv1beta1.GetPXCComponentsResponse, error) - ChangePSMDBComponents(context.Context, *dbaasv1beta1.ChangePSMDBComponentsRequest) (*dbaasv1beta1.ChangePSMDBComponentsResponse, error) - ChangePXCComponents(context.Context, *dbaasv1beta1.ChangePXCComponentsRequest) (*dbaasv1beta1.ChangePXCComponentsResponse, error) - CheckForOperatorUpdate(context.Context, *dbaasv1beta1.CheckForOperatorUpdateRequest) (*dbaasv1beta1.CheckForOperatorUpdateResponse, error) - InstallOperator(context.Context, *dbaasv1beta1.InstallOperatorRequest) (*dbaasv1beta1.InstallOperatorResponse, error) -} - -type kubernetesClient interface { //nolint:interfacebloat - SetKubeconfig(string) error - ListDatabaseClusters(context.Context) (*dbaasv1.DatabaseClusterList, error) - GetDatabaseCluster(context.Context, string) (*dbaasv1.DatabaseCluster, error) - RestartDatabaseCluster(context.Context, string) error - PatchDatabaseCluster(*dbaasv1.DatabaseCluster) error - CreateDatabaseCluster(*dbaasv1.DatabaseCluster) error - DeleteDatabaseCluster(context.Context, string) error - GetDefaultStorageClassName(context.Context) (string, error) - GetPXCOperatorVersion(context.Context) (string, error) - GetPSMDBOperatorVersion(context.Context) (string, error) - GetSecret(context.Context, string) (*corev1.Secret, error) - GetClusterType(context.Context) (kubernetes.ClusterType, error) - CreatePMMSecret(string, map[string][]byte) error - GetAllClusterResources(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) (uint64, uint64, uint64, error) - GetConsumedCPUAndMemory(context.Context, string) (uint64, uint64, error) - GetConsumedDiskBytes(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) (uint64, error) - GetPersistentVolumes(ctx context.Context) (*corev1.PersistentVolumeList, error) - GetStorageClasses(ctx context.Context) (*storagev1.StorageClassList, error) - CreateRestore(*dbaasv1.DatabaseClusterRestore) error - ListSecrets(context.Context) (*corev1.SecretList, error) - // InstallOLMOperator installs the OLM in the Kubernetes cluster. - InstallOLMOperator(ctx context.Context) error - // InstallOperator installs an operator via OLM. - InstallOperator(ctx context.Context, req kubernetes.InstallOperatorRequest) error - // ListSubscriptions all the subscriptions in the namespace. - ListSubscriptions(ctx context.Context, namespace string) (*olmalpha1.SubscriptionList, error) - // UpgradeOperator upgrades an operator to the next available version. - UpgradeOperator(ctx context.Context, namespace, name string) error - // GetServerVersion returns server version - GetServerVersion() (*version.Info, error) - ListTemplates(ctx context.Context, engine, namespace string) ([]*dbaasv1beta1.Template, error) -} - -type kubeStorageManager interface { - GetOrSetClient(name string) (kubernetesClient, error) - DeleteClient(name string) error -} diff --git a/managed/services/management/dbaas/kube_clients.go b/managed/services/management/dbaas/kube_clients.go deleted file mode 100644 index 305cf55c7e..0000000000 --- a/managed/services/management/dbaas/kube_clients.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package dbaas - -import ( - "sync" - - "github.com/pkg/errors" - "gopkg.in/reform.v1" - - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/services/dbaas/kubernetes" -) - -// KubeStorage stores kuberenetes clients for DBaaS -type KubeStorage struct { - mu sync.Mutex - db *reform.DB - clients map[string]kubernetesClient -} - -var ErrDatabaseNotSet = errors.New("Database connection not set") - -// NewKubeStorage returns a created KubeStorage -func NewKubeStorage(db *reform.DB) *KubeStorage { - return &KubeStorage{ - db: db, - clients: make(map[string]kubernetesClient), - } -} - -// GetOrSetClient gets client from map or sets a new client to the map -func (k *KubeStorage) GetOrSetClient(name string) (kubernetesClient, error) { //nolint:ireturn - k.mu.Lock() - defer k.mu.Unlock() - kubeClient, ok := k.clients[name] - if ok { - _, err := kubeClient.GetServerVersion() - return kubeClient, err - } - - if k.db == nil { - return nil, ErrDatabaseNotSet - } - - kubernetesCluster, err := models.FindKubernetesClusterByName(k.db.Querier, name) - if err != nil { - return nil, err - } - kubeClient, err = kubernetes.New(kubernetesCluster.KubeConfig) - if err != nil { - return nil, err - } - k.clients[name] = kubeClient - return kubeClient, nil -} - -// DeleteClient deletes client from storage -func (k *KubeStorage) DeleteClient(name string) error { - k.mu.Lock() - defer k.mu.Unlock() - delete(k.clients, name) - return models.RemoveKubernetesCluster(k.db.Querier, name) -} diff --git a/managed/services/management/dbaas/kubeconfig_test.go b/managed/services/management/dbaas/kubeconfig_test.go deleted file mode 100644 index 670ae780f3..0000000000 --- a/managed/services/management/dbaas/kubeconfig_test.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package dbaas - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "gopkg.in/yaml.v3" -) - -func TestMaskSecrets(t *testing.T) { - t.Parallel() - kubeConfig := &kubectlConfig{} - err := yaml.Unmarshal([]byte(awsIAMAuthenticatorKubeconfigTransformed), kubeConfig) - require.NoError(t, err) - safeConfig, err := kubeConfig.maskSecrets() - require.NoError(t, err) - assert.Equal(t, "", safeConfig.Users[0].User.Exec.Env[1].Value) - assert.Equal(t, "", safeConfig.Users[0].User.Exec.Env[2].Value) -} diff --git a/managed/services/management/dbaas/kubernetes_server.go b/managed/services/management/dbaas/kubernetes_server.go deleted file mode 100644 index 5a72cb79e5..0000000000 --- a/managed/services/management/dbaas/kubernetes_server.go +++ /dev/null @@ -1,695 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package dbaas - -import ( - "context" - "fmt" - "math/rand" - "os" - "regexp" - "strconv" - "strings" - "sync" - - "github.com/operator-framework/api/pkg/operators/v1alpha1" - dbaascontrollerv1beta1 "github.com/percona-platform/dbaas-api/gen/controller" - "github.com/percona/promconfig" - "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "gopkg.in/reform.v1" - "gopkg.in/yaml.v3" - corev1 "k8s.io/api/core/v1" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/services/dbaas/kubernetes" - pmmversion "github.com/percona/pmm/version" -) - -var ( - operatorIsForbiddenRegexp = regexp.MustCompile(`.*\.percona\.com is forbidden`) - resourceDoesntExistsRegexp = regexp.MustCompile(`the server doesn't have a resource type "(PerconaXtraDBCluster|PerconaServerMongoDB)"`) - errKubeconfigIsEmpty = errors.New("kubeconfig is empty") - errMissingRequiredKubeconfigEnvVar = errors.New("required environment variable is not defined in kubeconfig") - - flagClusterName = "--cluster-name" - flagRegion = "--region" - flagRole = "--role-arn" - kubeconfigFlagsConversionMap = map[string]string{flagClusterName: "-i", flagRegion: "--region", flagRole: "-r"} - kubeconfigFlagsList = []string{flagClusterName, flagRegion, flagRole} -) - -type kubernetesServer struct { - l *logrus.Entry - db *reform.DB - dbaasClient dbaasClient - versionService versionService - grafanaClient grafanaClient - kubeStorage *KubeStorage - - dbaasv1beta1.UnimplementedKubernetesServer -} - -// NewKubernetesServer creates Kubernetes Server. -func NewKubernetesServer(db *reform.DB, dbaasClient dbaasClient, versionService versionService, //nolint:ireturn - grafanaClient grafanaClient, -) dbaasv1beta1.KubernetesServer { - l := logrus.WithField("component", "kubernetes_server") - return &kubernetesServer{ - l: l, - db: db, - dbaasClient: dbaasClient, - versionService: versionService, - grafanaClient: grafanaClient, - kubeStorage: NewKubeStorage(db), - } -} - -// Enabled returns if service is enabled and can be used. -func (k *kubernetesServer) Enabled() bool { - settings, err := models.GetSettings(k.db) - if err != nil { - k.l.WithError(err).Error("can't get settings") - return false - } - return settings.DBaaS.Enabled -} - -// convertToOperatorStatus exists mainly to provide an appropriate status when installed operator is unsupported. -// Dbaas-controller does not have a clue what's supported, so we have to do it here. -func (k kubernetesServer) convertToOperatorStatus(versionsList []string, operatorVersion string) dbaasv1beta1.OperatorsStatus { - if operatorVersion == "" { - return dbaasv1beta1.OperatorsStatus_OPERATORS_STATUS_NOT_INSTALLED - } - for _, version := range versionsList { - if version == operatorVersion { - return dbaasv1beta1.OperatorsStatus_OPERATORS_STATUS_OK - } - } - - allowUnsupportedOperators := os.Getenv("DBAAS_ALLOW_UNSUPPORTED_OPERATORS") - if boolValue, _ := strconv.ParseBool(allowUnsupportedOperators); boolValue { - return dbaasv1beta1.OperatorsStatus_OPERATORS_STATUS_OK - } - - return dbaasv1beta1.OperatorsStatus_OPERATORS_STATUS_UNSUPPORTED -} - -// ListKubernetesClusters returns a list of all registered Kubernetes clusters. -func (k kubernetesServer) ListKubernetesClusters(ctx context.Context, _ *dbaasv1beta1.ListKubernetesClustersRequest) (*dbaasv1beta1.ListKubernetesClustersResponse, error) { //nolint:lll - kubernetesClusters, err := models.FindAllKubernetesClusters(k.db.Querier) - if err != nil { - return nil, err - } - if len(kubernetesClusters) == 0 { - return &dbaasv1beta1.ListKubernetesClustersResponse{}, nil - } - - operatorsVersions, err := k.versionService.SupportedOperatorVersionsList(ctx, pmmversion.PMMVersion) - if err != nil { - return nil, err - } - - var wg sync.WaitGroup - clusters := make([]*dbaasv1beta1.ListKubernetesClustersResponse_Cluster, len(kubernetesClusters)) - for i, cluster := range kubernetesClusters { - i := i - cluster := cluster - wg.Add(1) - go func(cluster *models.KubernetesCluster) { - defer wg.Done() - clusters[i] = &dbaasv1beta1.ListKubernetesClustersResponse_Cluster{ - KubernetesClusterName: cluster.KubernetesClusterName, - Operators: &dbaasv1beta1.Operators{ - Pxc: &dbaasv1beta1.Operator{}, - Psmdb: &dbaasv1beta1.Operator{}, - Dbaas: &dbaasv1beta1.Operator{}, - }, - } - kubeClient, err := k.kubeStorage.GetOrSetClient(cluster.KubernetesClusterName) - if err != nil { - clusters[i].Status = dbaasv1beta1.KubernetesClusterStatus_KUBERNETES_CLUSTER_STATUS_UNAVAILABLE - return - } - - clusters[i].Status = dbaasv1beta1.KubernetesClusterStatus_KUBERNETES_CLUSTER_STATUS_OK - if !cluster.IsReady { - clusters[i].Status = dbaasv1beta1.KubernetesClusterStatus_KUBERNETES_CLUSTER_STATUS_PROVISIONING - } - pxcVersion, err := kubeClient.GetPXCOperatorVersion(ctx) - if err != nil { - k.l.Errorf("couldn't get pxc operator version: %s", err) - } - psmdbVersion, err := kubeClient.GetPSMDBOperatorVersion(ctx) - if err != nil { - k.l.Errorf("couldn't get psmdb operator version: %s", err) - } - - clusters[i].Operators.Pxc.Status = k.convertToOperatorStatus(operatorsVersions[pxcOperator], pxcVersion) - clusters[i].Operators.Psmdb.Status = k.convertToOperatorStatus(operatorsVersions[psmdbOperator], psmdbVersion) - - clusters[i].Operators.Pxc.Version = pxcVersion - clusters[i].Operators.Psmdb.Version = psmdbVersion - - // FIXME: Uncomment it when FE will be ready - // kubeClient, err := kubernetes.New(cluster.KubeConfig) - // if err != nil { - // return - // } - // version, err := kubeClient.GetDBaaSOperatorVersion(ctx) - // if err != nil { - // return - // } - // clusters[i].Operators.Dbaas.Version = version - // clusters[i].Operators.Dbaas.Status = dbaasv1beta1.OperatorsStatus_OPERATORS_STATUS_OK - }(cluster) - } - wg.Wait() - return &dbaasv1beta1.ListKubernetesClustersResponse{KubernetesClusters: clusters}, nil -} - -type envVar struct { - Name string `yaml:"name"` - Value string `yaml:"value"` -} - -type kubectlUserExec struct { - APIVersion string `yaml:"apiVersion,omitempty"` - Args []string `yaml:"args,omitempty"` - Command string `yaml:"command,omitempty"` - Env []envVar `yaml:"env,omitempty"` - ProvideClusterInfo bool `yaml:"provideClusterInfo"` -} - -type kubectlUser struct { - ClientCertificateData string `yaml:"client-certificate-data,omitempty"` - ClientKeyData string `yaml:"client-key-data,omitempty"` - Exec kubectlUserExec `yaml:"exec,omitempty"` -} - -type kubectlUserWithName struct { - Name string `yaml:"name,omitempty"` - User *kubectlUser `yaml:"user,omitempty"` -} - -type kubectlConfig struct { - Kind string `yaml:"kind,omitempty"` - APIVersion string `yaml:"apiVersion,omitempty"` - CurrentContext string `yaml:"current-context,omitempty"` - Clusters []interface{} `yaml:"clusters,omitempty"` - Contexts []interface{} `yaml:"contexts,omitempty"` - Preferences map[string]interface{} `yaml:"preferences"` - Users []*kubectlUserWithName `yaml:"users,omitempty"` -} - -func (k *kubectlConfig) maskSecrets() (*kubectlConfig, error) { - nk, ok := promconfig.Copy(k).(*kubectlConfig) - if !ok { - return nil, errors.New("failed to copy config") - } - - for i, user := range nk.Users { - for j, env := range user.User.Exec.Env { - if env.Name == "AWS_ACCESS_KEY_ID" || env.Name == "AWS_SECRET_ACCESS_KEY" { - nk.Users[i].User.Exec.Env[j].Value = "" - } - } - } - return nk, nil -} - -func getFlagValue(args []string, flagName string) string { - for i, arg := range args { - if arg == flagName && i+1 < len(args) { - return args[i+1] - } - } - return "" -} - -func getKubeconfigUserExecEnvValue(envs []envVar, variableName string) string { - for _, env := range envs { - if name := env.Name; name == variableName { - return env.Value - } - } - return "" -} - -// replaceAWSAuthIfPresent replaces use of aws binary with aws-iam-authenticator if use of aws binary is found. -// If such use is not found, it returns passed kubeconfig without any change. -func replaceAWSAuthIfPresent(kubeconfig string, keyID, key string) (string, error) { - if strings.TrimSpace(kubeconfig) == "" { - return "", errKubeconfigIsEmpty - } - var config kubectlConfig - err := yaml.Unmarshal([]byte(kubeconfig), &config) - if err != nil { - return "", err - } - var changed bool - for _, user := range config.Users { - if user.User.Exec.Command == "aws" { - user.User.Exec.Command = "aws-iam-authenticator" - // check and set flags - converted := []string{"token"} - for _, oldFlag := range kubeconfigFlagsList { - if flag := getFlagValue(user.User.Exec.Args, oldFlag); flag != "" { - converted = append(converted, kubeconfigFlagsConversionMap[oldFlag], flag) - } - } - user.User.Exec.Args = converted - changed = true - } - - // check and set authentication environment variables - for _, envVar := range []envVar{{"AWS_ACCESS_KEY_ID", keyID}, {"AWS_SECRET_ACCESS_KEY", key}} { - if value := getKubeconfigUserExecEnvValue(user.User.Exec.Env, envVar.Name); value == "" && envVar.Value != "" { - user.User.Exec.Env = append(user.User.Exec.Env, envVar) - changed = true - } - } - } - if !changed { - return kubeconfig, nil - } - c, err := yaml.Marshal(config) - return string(c), err -} - -// RegisterKubernetesCluster registers an existing Kubernetes cluster in PMM. -func (k kubernetesServer) RegisterKubernetesCluster(ctx context.Context, req *dbaasv1beta1.RegisterKubernetesClusterRequest) (*dbaasv1beta1.RegisterKubernetesClusterResponse, error) { //nolint:lll - var err error - req.KubeAuth.Kubeconfig, err = replaceAWSAuthIfPresent(req.KubeAuth.Kubeconfig, req.AwsAccessKeyId, req.AwsSecretAccessKey) - if err != nil { - if errors.Is(err, errKubeconfigIsEmpty) { - return nil, status.Error(codes.InvalidArgument, "Kubeconfig can't be empty") - } else if errors.Is(err, errMissingRequiredKubeconfigEnvVar) { - return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("Failed to transform kubeconfig to work with aws-iam-authenticator: %s", err)) - } - k.l.Errorf("Replacing `aws` with `aim-authenticator` failed: %s", err) - return nil, status.Error(codes.Internal, "Internal server error") - } - - err = k.db.InTransaction(func(t *reform.TX) error { - _, err := models.CreateKubernetesCluster(t.Querier, &models.CreateKubernetesClusterParams{ - KubernetesClusterName: req.KubernetesClusterName, - KubeConfig: req.KubeAuth.Kubeconfig, - }) - return err - }) - if err != nil { - return nil, err - } - kubeClient, err := k.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, err - } - - operatorsToInstall := make(map[string]bool) - operatorsToInstall["olm"] = true - operatorsToInstall["vm"] = true - operatorsToInstall["dbaas"] = true - if pxcVersion, err := kubeClient.GetPXCOperatorVersion(ctx); pxcVersion == "" || err != nil { - operatorsToInstall["pxc"] = true - } - if psmdbVersion, err := kubeClient.GetPSMDBOperatorVersion(ctx); psmdbVersion == "" || err != nil { - operatorsToInstall["psmdb"] = true - } - settings, err := models.GetSettings(k.db.Querier) - if err != nil { - return nil, errors.Wrap(err, "cannot get PMM settings to start Victoria Metrics") - } - var apiKeyID int64 - var apiKey string - apiKeyName := fmt.Sprintf("pmm-vmagent-%s-%d", req.KubernetesClusterName, rand.Int63()) //nolint:gosec - apiKeyID, apiKey, err = k.grafanaClient.CreateAdminAPIKey(ctx, apiKeyName) - if err != nil { - return nil, errors.Wrap(err, "cannot create Grafana admin API key") - } - - go k.setupMonitoring( //nolint:contextcheck - context.TODO(), - operatorsToInstall, - req.KubernetesClusterName, - req.KubeAuth.Kubeconfig, - settings.PMMPublicAddress, - apiKey, - apiKeyID) - - return &dbaasv1beta1.RegisterKubernetesClusterResponse{}, nil -} - -func (k kubernetesServer) setupMonitoring(ctx context.Context, operatorsToInstall map[string]bool, clusterName, kubeConfig, pmmPublicAddress string, - apiKey string, apiKeyID int64, -) { - kubeClient, err := k.kubeStorage.GetOrSetClient(clusterName) - if err != nil { - return - } - errs := k.installDefaultOperators(operatorsToInstall, kubeClient) //nolint:contextcheck - if errs["vm"] != nil { - k.l.Errorf("cannot install vm operator: %s", errs["vm"]) - return - } - - err = k.startMonitoring(ctx, pmmPublicAddress, apiKey, apiKeyID, kubeConfig) - if err != nil { - k.l.Errorf("cannot start monitoring the clusdter: %s", err) - } - - err = models.ChangeKubernetesClusterToReady(k.db.Querier, clusterName) - if err != nil { - k.l.Errorf("couldn't update kubernetes cluster state: %s", err) - } -} - -func (k kubernetesServer) startMonitoring(ctx context.Context, pmmPublicAddress string, apiKey string, - apiKeyID int64, kubeConfig string, -) error { - pmmParams := &dbaascontrollerv1beta1.PMMParams{ - PublicAddress: fmt.Sprintf("https://%s", pmmPublicAddress), - Login: "api_key", - Password: apiKey, - } - - _, err := k.dbaasClient.StartMonitoring(ctx, &dbaascontrollerv1beta1.StartMonitoringRequest{ - KubeAuth: &dbaascontrollerv1beta1.KubeAuth{ - Kubeconfig: kubeConfig, - }, - Pmm: pmmParams, - }) - if err != nil { - e := k.grafanaClient.DeleteAPIKeyByID(ctx, apiKeyID) - if e != nil { - k.l.Warnf("couldn't delete created API Key %v: %s", apiKeyID, e) - } - k.l.Errorf("couldn't start monitoring of the kubernetes cluster: %s", err) - return errors.Wrap(err, "couldn't start monitoring of the kubernetes cluster") - } - - return nil -} - -func (k kubernetesServer) installDefaultOperators(operatorsToInstall map[string]bool, kubeClient kubernetesClient) map[string]error { - ctx := context.TODO() - - retval := make(map[string]error) - - if _, ok := operatorsToInstall["olm"]; ok { - err := kubeClient.InstallOLMOperator(ctx) - if err != nil { - retval["olm"] = err - k.l.Errorf("cannot install OLM operator to register the Kubernetes cluster: %s", err) - } - } - - namespace := "default" - catalogSourceNamespace := "olm" - operatorGroup := "percona-operators-group" - catalogSource := "percona-dbaas-catalog" - - if _, ok := operatorsToInstall["vm"]; ok { - channel, ok := os.LookupEnv("DBAAS_VM_OP_CHANNEL") - if !ok || channel == "" { - channel = "stable-v0" - } - operatorName := "victoriametrics-operator" - params := kubernetes.InstallOperatorRequest{ - Namespace: namespace, - Name: operatorName, - OperatorGroup: operatorGroup, - CatalogSource: catalogSource, - CatalogSourceNamespace: catalogSourceNamespace, - Channel: channel, - InstallPlanApproval: v1alpha1.ApprovalManual, - } - - if err := kubeClient.InstallOperator(ctx, params); err != nil { - retval["vm"] = err - k.l.Errorf("cannot instal PXC operator in the new cluster: %s", err) - } - } - - if _, ok := operatorsToInstall["pxc"]; ok { - channel, ok := os.LookupEnv("DBAAS_PXC_OP_CHANNEL") - if !ok || channel == "" { - channel = "stable-v1" - } - operatorName := "percona-xtradb-cluster-operator" - params := kubernetes.InstallOperatorRequest{ - Namespace: namespace, - Name: operatorName, - OperatorGroup: operatorGroup, - CatalogSource: catalogSource, - CatalogSourceNamespace: catalogSourceNamespace, - Channel: channel, - InstallPlanApproval: v1alpha1.ApprovalManual, - } - - if err := kubeClient.InstallOperator(ctx, params); err != nil { - retval["pxc"] = err - k.l.Errorf("cannot instal PXC operator in the new cluster: %s", err) - } - } - - if _, ok := operatorsToInstall["psmdb"]; ok { - operatorName := "percona-server-mongodb-operator" - channel, ok := os.LookupEnv("DBAAS_PSMDB_OP_CHANNEL") - if !ok || channel == "" { - channel = "stable-v1" - } - params := kubernetes.InstallOperatorRequest{ - Namespace: namespace, - Name: operatorName, - OperatorGroup: operatorGroup, - CatalogSource: catalogSource, - CatalogSourceNamespace: catalogSourceNamespace, - Channel: channel, - InstallPlanApproval: v1alpha1.ApprovalManual, - } - - if err := kubeClient.InstallOperator(ctx, params); err != nil { - retval["psmdb"] = err - k.l.Errorf("cannot instal PXC operator in the new cluster: %s", err) - } - } - - if _, ok := operatorsToInstall["dbaas"]; ok { - operatorName := "dbaas-operator" - channel, ok := os.LookupEnv("DBAAS_DBAAS_OP_CHANNEL") - if !ok || channel == "" { - channel = "stable-v0" - } - params := kubernetes.InstallOperatorRequest{ - Namespace: namespace, - Name: operatorName, - OperatorGroup: operatorGroup, - CatalogSource: "percona-dbaas-catalog", - CatalogSourceNamespace: catalogSourceNamespace, - Channel: channel, - InstallPlanApproval: v1alpha1.ApprovalManual, - } - - if err := kubeClient.InstallOperator(ctx, params); err != nil { - retval["vm"] = err - k.l.Errorf("cannot instal PXC operator in the new cluster: %s", err) - } - } - - return retval -} - -// UnregisterKubernetesCluster removes a registered Kubernetes cluster from PMM. -func (k kubernetesServer) UnregisterKubernetesCluster(ctx context.Context, req *dbaasv1beta1.UnregisterKubernetesClusterRequest) (*dbaasv1beta1.UnregisterKubernetesClusterResponse, error) { //nolint:lll - err := k.db.InTransaction(func(t *reform.TX) error { - kubernetesCluster, err := models.FindKubernetesClusterByName(t.Querier, req.KubernetesClusterName) - if err != nil { - return err - } - - _, err = k.dbaasClient.StopMonitoring(ctx, &dbaascontrollerv1beta1.StopMonitoringRequest{ - KubeAuth: &dbaascontrollerv1beta1.KubeAuth{ - Kubeconfig: kubernetesCluster.KubeConfig, - }, - }) - - if err != nil { - k.l.Warnf("cannot stop monitoring: %s", err) - } - if req.Force { - return models.RemoveKubernetesCluster(t.Querier, req.KubernetesClusterName) - } - - kubeClient, err := k.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return err - } - - out, err := kubeClient.ListDatabaseClusters(ctx) - - switch { - case err != nil && accessError(err): - k.l.Warn(err) - case err != nil: - return err - case len(out.Items) != 0: - return status.Errorf(codes.FailedPrecondition, "Kubernetes cluster %s has database clusters", req.KubernetesClusterName) - } - - return models.RemoveKubernetesCluster(t.Querier, req.KubernetesClusterName) - }) - if err != nil { - return nil, err - } - - return &dbaasv1beta1.UnregisterKubernetesClusterResponse{}, nil -} - -// GetKubernetesCluster return KubeAuth with Kubernetes config. -func (k kubernetesServer) GetKubernetesCluster(_ context.Context, req *dbaasv1beta1.GetKubernetesClusterRequest) (*dbaasv1beta1.GetKubernetesClusterResponse, error) { - kubernetesCluster, err := models.FindKubernetesClusterByName(k.db.Querier, req.KubernetesClusterName) - if err != nil { - return nil, err - } - config := &kubectlConfig{} - err = yaml.Unmarshal([]byte(kubernetesCluster.KubeConfig), config) - if err != nil { - return nil, err - } - safeKubeConfig, err := config.maskSecrets() - if err != nil { - return nil, err - } - kubeConfig, err := yaml.Marshal(safeKubeConfig) - if err != nil { - return nil, err - } - - return &dbaasv1beta1.GetKubernetesClusterResponse{ - KubeAuth: &dbaasv1beta1.KubeAuth{ - Kubeconfig: string(kubeConfig), - }, - }, nil -} - -func accessError(err error) bool { - if err == nil { - return false - } - accessErrors := []*regexp.Regexp{ - operatorIsForbiddenRegexp, - resourceDoesntExistsRegexp, - } - - for _, regex := range accessErrors { - if regex.MatchString(err.Error()) { - logrus.Warn(err.Error()) - return true - } - } - return false -} - -// GetResources returns all and available resources of a Kubernetes cluster. -func (k kubernetesServer) GetResources(ctx context.Context, req *dbaasv1beta1.GetResourcesRequest) (*dbaasv1beta1.GetResourcesResponse, error) { - kubeClient, err := k.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, err - } - - // Get cluster type - clusterType, err := kubeClient.GetClusterType(ctx) - if err != nil { - return nil, err - } - - var volumes *corev1.PersistentVolumeList - if clusterType == kubernetes.ClusterTypeEKS { - volumes, err = kubeClient.GetPersistentVolumes(ctx) - if err != nil { - return nil, err - } - } - allCPUMillis, allMemoryBytes, allDiskBytes, err := kubeClient.GetAllClusterResources(ctx, clusterType, volumes) - if err != nil { - return nil, err - } - - consumedCPUMillis, consumedMemoryBytes, err := kubeClient.GetConsumedCPUAndMemory(ctx, "") - if err != nil { - return nil, err - } - - consumedDiskBytes, err := kubeClient.GetConsumedDiskBytes(ctx, clusterType, volumes) - if err != nil { - return nil, err - } - - availableCPUMillis := allCPUMillis - consumedCPUMillis - // handle underflow - if availableCPUMillis > allCPUMillis { - availableCPUMillis = 0 - } - availableMemoryBytes := allMemoryBytes - consumedMemoryBytes - // handle underflow - if availableMemoryBytes > allMemoryBytes { - availableMemoryBytes = 0 - } - availableDiskBytes := allDiskBytes - consumedDiskBytes - // handle underflow - if availableDiskBytes > allDiskBytes { - availableDiskBytes = 0 - } - - return &dbaasv1beta1.GetResourcesResponse{ - All: &dbaasv1beta1.Resources{ - CpuM: allCPUMillis, - MemoryBytes: allMemoryBytes, - DiskSize: allDiskBytes, - }, - Available: &dbaasv1beta1.Resources{ - CpuM: availableCPUMillis, - MemoryBytes: availableMemoryBytes, - DiskSize: availableDiskBytes, - }, - }, nil -} - -// ListStorageClasses returns the names of all storage classes available in a Kubernetes cluster. -func (k kubernetesServer) ListStorageClasses(ctx context.Context, req *dbaasv1beta1.ListStorageClassesRequest) (*dbaasv1beta1.ListStorageClassesResponse, error) { - kubeClient, err := k.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, err - } - - storageClasses, err := kubeClient.GetStorageClasses(ctx) - if err != nil { - return nil, err - } - - storageClassesNames := make([]string, 0, len(storageClasses.Items)) - for _, storageClass := range storageClasses.Items { - storageClassesNames = append(storageClassesNames, storageClass.Name) - } - - return &dbaasv1beta1.ListStorageClassesResponse{ - StorageClasses: storageClassesNames, - }, nil -} diff --git a/managed/services/management/dbaas/kubernetes_server_test.go b/managed/services/management/dbaas/kubernetes_server_test.go deleted file mode 100644 index 5794a27d41..0000000000 --- a/managed/services/management/dbaas/kubernetes_server_test.go +++ /dev/null @@ -1,750 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package dbaas - -import ( - "context" - "testing" - "time" - - "github.com/google/uuid" - goversion "github.com/hashicorp/go-version" - controllerv1beta1 "github.com/percona-platform/dbaas-api/gen/controller" - dbaasv1 "github.com/percona/dbaas-operator/api/v1" - "github.com/pkg/errors" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "gopkg.in/reform.v1" - "gopkg.in/reform.v1/dialects/postgresql" - corev1 "k8s.io/api/core/v1" - storagev1 "k8s.io/api/storage/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/services/dbaas/kubernetes" - "github.com/percona/pmm/managed/utils/testdb" - "github.com/percona/pmm/managed/utils/tests" - "github.com/percona/pmm/utils/logger" - pmmversion "github.com/percona/pmm/version" -) - -func TestKubernetesServer(t *testing.T) { - setup := func(t *testing.T) (ctx context.Context, ks dbaasv1beta1.KubernetesServer, dbaasClient *mockDbaasClient, - kubeClient *mockKubernetesClient, grafanaClient *mockGrafanaClient, - versionService *mockVersionService, teardown func(t *testing.T), - ) { - t.Helper() - - ctx = logger.Set(context.Background(), t.Name()) - uuid.SetRand(&tests.IDReader{}) - - sqlDB := testdb.Open(t, models.SetupFixtures, nil) - // To enable verbose queries output use: - // db = reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) - db := reform.NewDB(sqlDB, postgresql.Dialect, nil) - dbaasClient = &mockDbaasClient{} - kubeClient = &mockKubernetesClient{} - grafanaClient = &mockGrafanaClient{} - - teardown = func(t *testing.T) { - t.Helper() - uuid.SetRand(nil) - dbaasClient.AssertExpectations(t) - require.NoError(t, sqlDB.Close()) - } - // versionService = NewVersionServiceClient("https://check-dev.percona.com/versions/v1") - versionService = &mockVersionService{} - ks = NewKubernetesServer(db, dbaasClient, versionService, grafanaClient) - s := ks.(*kubernetesServer) - clients := map[string]kubernetesClient{ - clusterName: kubeClient, - } - s.kubeStorage.clients = clients - ks = s - return - } - - // This is for local testing. When running local tests, if pmmversion.PMMVersion is empty - // these lines in kubernetes_server.go will throw an error and tests won't finish. - // - // pmmVersion, err := goversion.NewVersion(pmmversion.PMMVersion) - // if err != nil { - // return nil, status.Error(codes.Internal, err.Error()) - // } - // - if pmmversion.PMMVersion == "" { - pmmversion.PMMVersion = version230 - } - - t.Run("Basic", func(t *testing.T) { - ctx, ks, dbaasClient, kubeClient, grafanaClient, versionService, teardown := setup(t) - kubeClient.On("SetKubeconfig", mock.Anything).Return(nil) - kubeClient.On("SetKubeconfig", mock.Anything).Return(nil) - defer teardown(t) - - v1120, _ := goversion.NewVersion("1.12.0") - versionService.On("LatestOperatorVersion", mock.Anything, mock.Anything).Return(v1120, v1120, nil) - - clusters, err := ks.ListKubernetesClusters(ctx, &dbaasv1beta1.ListKubernetesClustersRequest{}) - require.NoError(t, err) - require.Empty(t, clusters.KubernetesClusters) - - kubeconfig := "preferences: {}\n" - - grafanaClient.On("CreateAdminAPIKey", mock.Anything, mock.Anything).Return(int64(123456), "api-key", nil) - kubeClient.On("InstallOLMOperator", mock.Anything, mock.Anything).Return(nil) - kubeClient.On("InstallOperator", mock.Anything, mock.Anything).Return(nil) - kubeClient.On("GetPSMDBOperatorVersion", mock.Anything, mock.Anything).Return(onePointEight, nil) - kubeClient.On("GetPXCOperatorVersion", mock.Anything, mock.Anything).Return("", nil) - kubeClient.On("GetServerVersion").Return(nil, nil) - dbaasClient.On("StartMonitoring", mock.Anything, mock.Anything).WaitUntil(time.After(time.Second)).Return(&controllerv1beta1.StartMonitoringResponse{}, nil) - - kubernetesClusterName := "test-cluster" - clients := map[string]kubernetesClient{ - kubernetesClusterName: kubeClient, - } - s := ks.(*kubernetesServer) - s.kubeStorage.clients = clients - ks = s - registerKubernetesClusterResponse, err := ks.RegisterKubernetesCluster(ctx, &dbaasv1beta1.RegisterKubernetesClusterRequest{ - KubernetesClusterName: kubernetesClusterName, - KubeAuth: &dbaasv1beta1.KubeAuth{Kubeconfig: kubeconfig}, - }) - require.NoError(t, err) - assert.NotNil(t, registerKubernetesClusterResponse) - - getClusterResponse, err := ks.GetKubernetesCluster(ctx, &dbaasv1beta1.GetKubernetesClusterRequest{ - KubernetesClusterName: kubernetesClusterName, - }) - require.NoError(t, err) - assert.NotNil(t, getClusterResponse) - assert.NotNil(t, getClusterResponse.KubeAuth) - assert.Equal(t, kubeconfig, getClusterResponse.KubeAuth.Kubeconfig) - - supportedOperatorVersions := map[string][]string{ - "pxc-operator": { - "1.10.0", - "1.11.0", - "1.9.0", - }, - "psmdb-operator": { - "1.11.0", - "1.12.0", - "1.10.0", - }, - } - versionService.On("SupportedOperatorVersionsList", mock.Anything, mock.Anything).Return(supportedOperatorVersions, nil) - - clusters, err = ks.ListKubernetesClusters(ctx, &dbaasv1beta1.ListKubernetesClustersRequest{}) - assert.NoError(t, err) - assert.Equal(t, 1, len(clusters.KubernetesClusters)) - expected := []*dbaasv1beta1.ListKubernetesClustersResponse_Cluster{ - { - KubernetesClusterName: kubernetesClusterName, - Operators: &dbaasv1beta1.Operators{ - Pxc: &dbaasv1beta1.Operator{Status: dbaasv1beta1.OperatorsStatus_OPERATORS_STATUS_NOT_INSTALLED}, - Psmdb: &dbaasv1beta1.Operator{Version: onePointEight, Status: dbaasv1beta1.OperatorsStatus_OPERATORS_STATUS_UNSUPPORTED}, - Dbaas: &dbaasv1beta1.Operator{Version: "", Status: dbaasv1beta1.OperatorsStatus_OPERATORS_STATUS_INVALID}, - }, - Status: dbaasv1beta1.KubernetesClusterStatus_KUBERNETES_CLUSTER_STATUS_OK, - }, - } - - // These 2 lines below will fail if you don't run the entire test suit since they depend on previous tests to set the values. - assert.Equal(t, expected[0].Operators, clusters.KubernetesClusters[0].Operators) - assert.Equal(t, expected[0].KubernetesClusterName, clusters.KubernetesClusters[0].KubernetesClusterName) - assert.True( - t, - clusters.KubernetesClusters[0].Status == dbaasv1beta1.KubernetesClusterStatus_KUBERNETES_CLUSTER_STATUS_OK || - clusters.KubernetesClusters[0].Status == dbaasv1beta1.KubernetesClusterStatus_KUBERNETES_CLUSTER_STATUS_PROVISIONING, - ) - mockK8sResp := []dbaasv1.DatabaseCluster{ - { - ObjectMeta: metav1.ObjectMeta{ - Name: "first-pxc-test", - }, - Spec: dbaasv1.DatabaseSpec{ - Database: "pxc", - DatabaseImage: "percona/percona-xtradb-cluster:8.0.27-18.1", - ClusterSize: 5, - DBInstance: dbaasv1.DBInstanceSpec{ - CPU: resource.MustParse("3m"), - Memory: resource.MustParse("256"), - DiskSize: resource.MustParse("1073741824"), - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "proxysql", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("2m"), - corev1.ResourceMemory: resource.MustParse("124"), - }, - }, - }, - }, - Status: dbaasv1.DatabaseClusterStatus{ - Ready: 15, - Size: 15, - }, - }, - } - - dbaasClient.On("StopMonitoring", mock.Anything, mock.Anything).Return(&controllerv1beta1.StopMonitoringResponse{}, nil) - listDatabaseMock := kubeClient.On("ListDatabaseClusters", ctx) - listDatabaseMock.Return(&dbaasv1.DatabaseClusterList{Items: mockK8sResp}, nil) - - _, err = ks.UnregisterKubernetesCluster(ctx, &dbaasv1beta1.UnregisterKubernetesClusterRequest{ - KubernetesClusterName: kubernetesClusterName, - }) - tests.AssertGRPCError(t, status.Newf(codes.FailedPrecondition, "Kubernetes cluster %s has database clusters", kubernetesClusterName), err) - - mockK8sResp = []dbaasv1.DatabaseCluster{ - { - ObjectMeta: metav1.ObjectMeta{ - Name: "first-psmdb-test", - }, - Spec: dbaasv1.DatabaseSpec{ - Database: "psmdb", - DatabaseImage: "percona/percona-server-mongodb:4.4.5-7", - ClusterSize: 5, - DBInstance: dbaasv1.DBInstanceSpec{ - CPU: resource.MustParse("3m"), - Memory: resource.MustParse("256"), - DiskSize: resource.MustParse("1073741824"), - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "mongos", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("2m"), - corev1.ResourceMemory: resource.MustParse("124"), - }, - }, - }, - }, - Status: dbaasv1.DatabaseClusterStatus{ - Ready: 10, - Size: 10, - }, - }, - } - listDatabaseMock.Return(&dbaasv1.DatabaseClusterList{Items: mockK8sResp}, nil) - tests.AssertGRPCError(t, status.Newf(codes.FailedPrecondition, "Kubernetes cluster %s has database clusters", kubernetesClusterName), err) - mockK8sResp = []dbaasv1.DatabaseCluster{} - - listDatabaseMock.Return(&dbaasv1.DatabaseClusterList{Items: mockK8sResp}, nil) - unregisterKubernetesClusterResponse, err := ks.UnregisterKubernetesCluster(ctx, &dbaasv1beta1.UnregisterKubernetesClusterRequest{ - KubernetesClusterName: kubernetesClusterName, - }) - require.NoError(t, err) - assert.NotNil(t, unregisterKubernetesClusterResponse) - - clusters, err = ks.ListKubernetesClusters(ctx, &dbaasv1beta1.ListKubernetesClustersRequest{}) - assert.NoError(t, err) - assert.Empty(t, clusters.KubernetesClusters) - - // Let goroutines to finish their tasks - // TODO: @gen1us2k find a better solution to prevent datarace. - time.Sleep(3 * time.Second) - }) -} - -func TestGetResources(t *testing.T) { - const ( - clusterName = "test-cluster" - kubeConfig = `apiVersion: v1 -kind: Config -clusters: -- cluster: - server: https://localhost:6443 - name: local -contexts: -- context: - cluster: local - user: local - name: local -current-context: local` - ) - setup := func(t *testing.T) (ks dbaasv1beta1.KubernetesServer, kubeClient *mockKubernetesClient, teardown func(t *testing.T)) { - t.Helper() - - uuid.SetRand(&tests.IDReader{}) - - sqlDB := testdb.Open(t, models.SetupFixtures, nil) - db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) - dbaasClient := &mockDbaasClient{} - kubeClient = &mockKubernetesClient{} - grafanaClient := &mockGrafanaClient{} - - kubernetesCluster, err := models.CreateKubernetesCluster(db.Querier, &models.CreateKubernetesClusterParams{ - KubernetesClusterName: clusterName, - KubeConfig: kubeConfig, - }) - require.NoError(t, err) - - teardown = func(t *testing.T) { - t.Helper() - uuid.SetRand(nil) - dbaasClient.AssertExpectations(t) - assert.NoError(t, db.Delete(kubernetesCluster)) - require.NoError(t, sqlDB.Close()) - } - versionService := NewVersionServiceClient("https://check-dev.percona.com/versions/v1") - ks = NewKubernetesServer(db, dbaasClient, versionService, grafanaClient) - s := ks.(*kubernetesServer) - kubeClient.On("GetServerVersion").Return(nil, nil) - clients := map[string]kubernetesClient{ - clusterName: kubeClient, - } - s.kubeStorage.clients = clients - ks = s - return - } - t.Run("GetResources", func(t *testing.T) { - ks, kubeClient, teardown := setup(t) - defer teardown(t) - - kubeClient.On("GetClusterType", mock.Anything).Return(kubernetes.ClusterTypeMinikube, nil) - kubeClient.On("GetAllClusterResources", mock.Anything, kubernetes.ClusterTypeMinikube, mock.Anything).Return(uint64(100), uint64(200), uint64(300), nil) - kubeClient.On("GetConsumedCPUAndMemory", mock.Anything, "").Return(uint64(50), uint64(100), nil) - kubeClient.On("GetConsumedDiskBytes", mock.Anything, kubernetes.ClusterTypeMinikube, mock.Anything).Return(uint64(150), nil) - - resp, err := ks.GetResources(context.Background(), &dbaasv1beta1.GetResourcesRequest{ - KubernetesClusterName: "test-cluster", - }) - assert.Nil(t, err) - assert.Equal(t, &dbaasv1beta1.GetResourcesResponse{ - All: &dbaasv1beta1.Resources{ - CpuM: 100, - MemoryBytes: 200, - DiskSize: 300, - }, - Available: &dbaasv1beta1.Resources{ - CpuM: 50, - MemoryBytes: 100, - DiskSize: 150, - }, - }, resp) - }) - - t.Run("GetResources invalid cluster name", func(t *testing.T) { - ks, _, teardown := setup(t) - defer teardown(t) - - _, err := ks.GetResources(context.Background(), &dbaasv1beta1.GetResourcesRequest{ - KubernetesClusterName: "invalid-cluster", - }) - assert.NotNil(t, err) - }) - - t.Run("GetResources GetClusterType error", func(t *testing.T) { - ks, kubeClient, teardown := setup(t) - defer teardown(t) - - kubeClient.On("GetClusterType", mock.Anything).Return(kubernetes.ClusterTypeUnknown, errors.New("error")) - kubeClient.On("GetServerVersion").Return(nil, nil) - - _, err := ks.GetResources(context.Background(), &dbaasv1beta1.GetResourcesRequest{ - KubernetesClusterName: "test-cluster", - }) - assert.NotNil(t, err) - }) - - t.Run("GetResources GetAllClusterResources error", func(t *testing.T) { - ks, kubeClient, teardown := setup(t) - defer teardown(t) - - kubeClient.On("GetClusterType", mock.Anything).Return(kubernetes.ClusterTypeMinikube, nil) - - kubeClient.On("GetAllClusterResources", mock.Anything, kubernetes.ClusterTypeMinikube, mock.Anything).Return(uint64(0), uint64(0), uint64(0), errors.New("error")) - - _, err := ks.GetResources(context.Background(), &dbaasv1beta1.GetResourcesRequest{ - KubernetesClusterName: "test-cluster", - }) - assert.NotNil(t, err) - }) - - t.Run("GetResources GetConsumedCPUAndMemory error", func(t *testing.T) { - ks, kubeClient, teardown := setup(t) - defer teardown(t) - - kubeClient.On("GetClusterType", mock.Anything).Return(kubernetes.ClusterTypeMinikube, nil) - kubeClient.On("GetAllClusterResources", mock.Anything, kubernetes.ClusterTypeMinikube, mock.Anything).Return(uint64(100), uint64(200), uint64(300), nil) - - kubeClient.On("GetConsumedCPUAndMemory", mock.Anything, "").Return(uint64(0), uint64(0), errors.New("error")) - - _, err := ks.GetResources(context.Background(), &dbaasv1beta1.GetResourcesRequest{ - KubernetesClusterName: "test-cluster", - }) - assert.NotNil(t, err) - }) - - t.Run("GetResources GetConsumedDiskBytes error", func(t *testing.T) { - ks, kubeClient, teardown := setup(t) - defer teardown(t) - - kubeClient.On("GetClusterType", mock.Anything).Return(kubernetes.ClusterTypeMinikube, nil) - kubeClient.On("GetAllClusterResources", mock.Anything, kubernetes.ClusterTypeMinikube, mock.Anything).Return(uint64(100), uint64(200), uint64(300), nil) - kubeClient.On("GetConsumedCPUAndMemory", mock.Anything, "").Return(uint64(50), uint64(100), nil) - - kubeClient.On("GetConsumedDiskBytes", mock.Anything, kubernetes.ClusterTypeMinikube, mock.Anything).Return(uint64(0), errors.New("error")) - - _, err := ks.GetResources(context.Background(), &dbaasv1beta1.GetResourcesRequest{ - KubernetesClusterName: "test-cluster", - }) - assert.NotNil(t, err) - }) -} - -func TestListStorageClasses(t *testing.T) { - const ( - clusterName = "test-cluster" - kubeConfig = `apiVersion: v1 -kind: Config -clusters: -- cluster: - server: https://localhost:6443 - name: local -contexts: -- context: - cluster: local - user: local - name: local -current-context: local` - ) - setup := func(t *testing.T) (ks dbaasv1beta1.KubernetesServer, kubeClient *mockKubernetesClient, teardown func(t *testing.T)) { - t.Helper() - - uuid.SetRand(&tests.IDReader{}) - - sqlDB := testdb.Open(t, models.SetupFixtures, nil) - db := reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) - dbaasClient := &mockDbaasClient{} - kubeClient = &mockKubernetesClient{} - grafanaClient := &mockGrafanaClient{} - - kubernetesCluster, err := models.CreateKubernetesCluster(db.Querier, &models.CreateKubernetesClusterParams{ - KubernetesClusterName: clusterName, - KubeConfig: kubeConfig, - }) - require.NoError(t, err) - - teardown = func(t *testing.T) { - t.Helper() - uuid.SetRand(nil) - dbaasClient.AssertExpectations(t) - assert.NoError(t, db.Delete(kubernetesCluster)) - require.NoError(t, sqlDB.Close()) - } - versionService := NewVersionServiceClient("https://check-dev.percona.com/versions/v1") - ks = NewKubernetesServer(db, dbaasClient, versionService, grafanaClient) - s := ks.(*kubernetesServer) - clients := map[string]kubernetesClient{ - clusterName: kubeClient, - } - s.kubeStorage.clients = clients - ks = s - return - } - t.Run("ListStorageClasses", func(t *testing.T) { - ks, kubeClient, teardown := setup(t) - defer teardown(t) - - kubeClient.On("SetKubeconfig", mock.Anything, mock.Anything).Return(nil) - kubeClient.On("GetStorageClasses", mock.Anything).Return(&storagev1.StorageClassList{ - Items: []storagev1.StorageClass{ - { - ObjectMeta: metav1.ObjectMeta{ - Name: "local-storage", - }, - }, - { - ObjectMeta: metav1.ObjectMeta{ - Name: "standard", - }, - }, - }, - }, nil) - kubeClient.On("GetServerVersion").Return(nil, nil) - resp, err := ks.ListStorageClasses(context.Background(), &dbaasv1beta1.ListStorageClassesRequest{ - KubernetesClusterName: "test-cluster", - }) - assert.Nil(t, err) - assert.Equal(t, &dbaasv1beta1.ListStorageClassesResponse{ - StorageClasses: []string{ - "local-storage", - "standard", - }, - }, resp) - }) - - t.Run("ListStorageClasses invalid cluster name", func(t *testing.T) { - ks, _, teardown := setup(t) - defer teardown(t) - - _, err := ks.ListStorageClasses(context.Background(), &dbaasv1beta1.ListStorageClassesRequest{ - KubernetesClusterName: "invalid-cluster", - }) - assert.NotNil(t, err) - }) - - t.Run("ListStorageClasses GetStorageClasses error", func(t *testing.T) { - ks, kubeClient, teardown := setup(t) - defer teardown(t) - - kubeClient.On("SetKubeconfig", mock.Anything, mock.Anything).Return(nil) - kubeClient.On("GetServerVersion").Return(nil, nil) - - kubeClient.On("GetStorageClasses", mock.Anything).Return(nil, errors.New("error")) - - _, err := ks.ListStorageClasses(context.Background(), &dbaasv1beta1.ListStorageClassesRequest{ - KubernetesClusterName: "test-cluster", - }) - assert.NotNil(t, err) - }) -} - -func TestGetFlagValue(t *testing.T) { - t.Parallel() - testCases := []struct { - args []string - flagName string - expectedValue string - }{ - { - args: []string{"token", "--foo", "bar"}, - flagName: "--foo", - expectedValue: "bar", - }, - { - args: []string{"token", "--foo", "bar"}, - flagName: "--bar", - expectedValue: "", - }, - { - args: []string{"token", "--foo"}, - flagName: "--foo", - expectedValue: "", - }, - } - for _, tt := range testCases { - value := getFlagValue(tt.args, tt.flagName) - assert.Equal(t, tt.expectedValue, value) - } -} - -const awsIAMAuthenticatorKubeconfig = `kind: Config -apiVersion: v1 -current-context: arn:aws:eks:zone-2:123465545:cluster/cluster -clusters: - - cluster: - certificate-authority-data: base64data - name: arn:aws:eks:zone-2:123465545:cluster/cluster - server: https://DDDDD.bla.zone-2.eks.amazonaws.com -contexts: - - context: - cluster: arn:aws:eks:zone-2:123465545:cluster/cluster - name: arn:aws:eks:zone-2:123465545:cluster/cluster - user: arn:aws:eks:zone-2:123465545:cluster/cluster -preferences: {} -users: - - name: arn:aws:eks:zone-2:123465545:cluster/cluster - user: - exec: - apiVersion: client.authentication.k8s.io/v1alpha1 - args: - - token - - -i - - test-cluster1 - - --region - - zone-2 - command: aws-iam-authenticator - env: - - name: AWS_STS_REGIONAL_ENDPOINTS - value: regional - provideClusterInfo: false -` - -const awsIAMAuthenticatorKubeconfigTransformed = `kind: Config -apiVersion: v1 -current-context: arn:aws:eks:zone-2:123465545:cluster/cluster -clusters: - - cluster: - certificate-authority-data: base64data - name: arn:aws:eks:zone-2:123465545:cluster/cluster - server: https://DDDDD.bla.zone-2.eks.amazonaws.com -contexts: - - context: - cluster: arn:aws:eks:zone-2:123465545:cluster/cluster - name: arn:aws:eks:zone-2:123465545:cluster/cluster - user: arn:aws:eks:zone-2:123465545:cluster/cluster -preferences: {} -users: - - name: arn:aws:eks:zone-2:123465545:cluster/cluster - user: - exec: - apiVersion: client.authentication.k8s.io/v1alpha1 - args: - - token - - -i - - test-cluster1 - - --region - - zone-2 - command: aws-iam-authenticator - env: - - name: AWS_STS_REGIONAL_ENDPOINTS - value: regional - - name: AWS_ACCESS_KEY_ID - value: keyID - - name: AWS_SECRET_ACCESS_KEY - value: key - provideClusterInfo: false -` - -const awsKubeconfig = `apiVersion: v1 -clusters: -- cluster: - certificate-authority-data: base64data - name: arn:aws:eks:zone-2:123465545:cluster/cluster - server: https://DDDDD.bla.zone-2.eks.amazonaws.com -contexts: -- context: - cluster: arn:aws:eks:zone-2:123465545:cluster/cluster - name: arn:aws:eks:zone-2:123465545:cluster/cluster - user: arn:aws:eks:zone-2:123465545:cluster/cluster -current-context: "arn:aws:eks:zone-2:123465545:cluster/cluster" -kind: Config -preferences: {} -users: -- name: arn:aws:eks:zone-2:123465545:cluster/cluster - user: - exec: - apiVersion: client.authentication.k8s.io/v1alpha1 - args: - - eks - - get-token - - --cluster-name - - test-cluster1 - - --region - - zone-2 - command: aws - env: - - name: AWS_STS_REGIONAL_ENDPOINTS - value: regional - provideClusterInfo: false -` - -const awsKubeconfigWithKeys = `apiVersion: v1 -clusters: -- cluster: - certificate-authority-data: base64data - name: arn:aws:eks:zone-2:123465545:cluster/cluster - server: https://DDDDD.bla.zone-2.eks.amazonaws.com -contexts: -- context: - cluster: arn:aws:eks:zone-2:123465545:cluster/cluster - name: arn:aws:eks:zone-2:123465545:cluster/cluster - user: arn:aws:eks:zone-2:123465545:cluster/cluster -current-context: "arn:aws:eks:zone-2:123465545:cluster/cluster" -kind: Config -preferences: {} -users: -- name: arn:aws:eks:zone-2:123465545:cluster/cluster - user: - exec: - apiVersion: client.authentication.k8s.io/v1alpha1 - args: - - eks - - get-token - - --cluster-name - - test-cluster1 - - --region - - zone-2 - command: aws - env: - - name: AWS_STS_REGIONAL_ENDPOINTS - value: regional - - name: AWS_ACCESS_KEY_ID - value: keyID - - name: AWS_SECRET_ACCESS_KEY - value: key - provideClusterInfo: false -` - -func TestUseIAMAuthenticator(t *testing.T) { //nolint:tparallel - t.Parallel() - testCases := []struct { - name string - kubeconfig string - expectedError error - expectedTransform string - keyID string - key string - }{ - { - name: "transform aws to aws-iam-authenticator with keys", - kubeconfig: awsKubeconfig, - expectedTransform: awsIAMAuthenticatorKubeconfigTransformed, - expectedError: nil, - keyID: "keyID", - key: "key", - }, - { - name: "transform aws with keys to aws-iam-authenticator", - kubeconfig: awsKubeconfigWithKeys, - expectedTransform: awsIAMAuthenticatorKubeconfigTransformed, - expectedError: nil, - }, - { - name: "transform aws to aws-iam-authenticator without keys", - kubeconfig: awsKubeconfig, - expectedTransform: awsIAMAuthenticatorKubeconfig, - expectedError: nil, - }, - { - name: "add environment variables to aws-iam-authenticator", - kubeconfig: awsIAMAuthenticatorKubeconfig, - expectedTransform: awsIAMAuthenticatorKubeconfigTransformed, - expectedError: nil, - keyID: "keyID", - key: "key", - }, - { - name: "return error if kubeconfig is empty", - kubeconfig: " ", - expectedTransform: "", - expectedError: errKubeconfigIsEmpty, - }, - { - name: "don't transform aws-iam-authenticator with keys", - kubeconfig: awsIAMAuthenticatorKubeconfigTransformed, - expectedTransform: awsIAMAuthenticatorKubeconfigTransformed, - expectedError: nil, - }, - } - for i, tt := range testCases { - t.Run(tt.name, func(t *testing.T) { - value, err := replaceAWSAuthIfPresent(tt.kubeconfig, tt.keyID, tt.key) - assert.ErrorIsf(t, err, tt.expectedError, "Errors don't match in the test case number %d.", i) - assert.Equalf(t, tt.expectedTransform, value, "Given and expected kubeconfigs don't match in the test case number %d.", i) - }) - } -} diff --git a/managed/services/management/dbaas/logs_service.go b/managed/services/management/dbaas/logs_service.go deleted file mode 100644 index 0609f58d7a..0000000000 --- a/managed/services/management/dbaas/logs_service.go +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package dbaas - -import ( - "context" - - "github.com/sirupsen/logrus" - "gopkg.in/reform.v1" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/services/dbaas/kubernetes" -) - -// overallLinesLimit defines how many last lines of logs we should return upon -// calling the getClusterLogs method. -const overallLinesLimit = 1000 - -// LogsService implements dbaasv1beta1.LogsAPIServer methods. -type LogsService struct { - l *logrus.Entry - db *reform.DB - - dbaasv1beta1.UnimplementedLogsAPIServer -} - -type tuple struct { - statuses []corev1.ContainerStatus - containers []corev1.Container -} - -// NewLogsService creates new LogsService. -func NewLogsService(db *reform.DB) dbaasv1beta1.LogsAPIServer { //nolint:ireturn - l := logrus.WithField("component", "logs_api") - return &LogsService{db: db, l: l} -} - -// Enabled returns if service is enabled and can be used. -func (s *LogsService) Enabled() bool { - settings, err := models.GetSettings(s.db) - if err != nil { - s.l.WithError(err).Error("can't get settings") - return false - } - return settings.DBaaS.Enabled -} - -// GetLogs returns container's logs of a database cluster and its pods events. -func (s LogsService) GetLogs(ctx context.Context, in *dbaasv1beta1.GetLogsRequest) (*dbaasv1beta1.GetLogsResponse, error) { - kubernetesCluster, err := models.FindKubernetesClusterByName(s.db.Querier, in.KubernetesClusterName) - if err != nil { - return nil, err - } - - kClient, err := kubernetes.New(kubernetesCluster.KubeConfig) - if err != nil { - // return nil, status.Error(codes.Internal, "Cannot initialize K8s kClient: "+err.Error()) - return nil, err - } - - labelSelector := &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "app.kubernetes.io/instance": in.ClusterName, - }, - } - - pods, err := kClient.GetPods(ctx, "", labelSelector) - if err != nil { - return nil, err - } - - // Every pod has at least one contaier, set cap to that value. - response := make([]*dbaasv1beta1.Logs, 0, len(pods.Items)) - for _, pod := range pods.Items { - tuples := []tuple{ - { - statuses: pod.Status.ContainerStatuses, - containers: pod.Spec.Containers, - }, - { - statuses: pod.Status.InitContainerStatuses, - containers: pod.Spec.InitContainers, - }, - } - // Get all logs from all regular containers and all init containers. - for _, t := range tuples { - for _, container := range t.containers { - logs, err := kClient.GetLogs( - ctx, t.statuses, pod.Name, container.Name) - if err != nil { - return nil, err - } - - response = append(response, &dbaasv1beta1.Logs{ - Pod: pod.Name, - Container: container.Name, - Logs: logs, - }) - } - } - - // Get pod's events. - events, err := kClient.GetEvents(ctx, pod.Name) - if err != nil { - return nil, err - } - - response = append(response, &dbaasv1beta1.Logs{ - Pod: pod.Name, - Container: "", - Logs: events, - }) - } - - // Limit number of overall log lines. - limitLines(response, overallLinesLimit) - - return &dbaasv1beta1.GetLogsResponse{ - Logs: response, - }, nil -} - -// limitLines limits each entry's logs lines count in the way the overall sum of -// all log lines is equal to given limit. -func limitLines(logs []*dbaasv1beta1.Logs, limit int) { - counts := make([]int, len(logs)) - lastSum := -1 - var newSum int - for newSum < limit && newSum > lastSum { - lastSum = newSum - for i, item := range logs { - if counts[i] < len(item.Logs) { - counts[i]++ - newSum++ - if newSum == limit { - break - } - } - } - } - - // Do the actual slicing. - for i, item := range logs { - logs[i].Logs = item.Logs[len(item.Logs)-counts[i]:] - } -} diff --git a/managed/services/management/dbaas/mock_components_service_test.go b/managed/services/management/dbaas/mock_components_service_test.go deleted file mode 100644 index 7e61ec0790..0000000000 --- a/managed/services/management/dbaas/mock_components_service_test.go +++ /dev/null @@ -1,187 +0,0 @@ -// Code generated by mockery v2.33.0. DO NOT EDIT. - -package dbaas - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" -) - -// mockComponentsService is an autogenerated mock type for the componentsService type -type mockComponentsService struct { - mock.Mock -} - -// ChangePSMDBComponents provides a mock function with given fields: _a0, _a1 -func (_m *mockComponentsService) ChangePSMDBComponents(_a0 context.Context, _a1 *dbaasv1beta1.ChangePSMDBComponentsRequest) (*dbaasv1beta1.ChangePSMDBComponentsResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *dbaasv1beta1.ChangePSMDBComponentsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.ChangePSMDBComponentsRequest) (*dbaasv1beta1.ChangePSMDBComponentsResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.ChangePSMDBComponentsRequest) *dbaasv1beta1.ChangePSMDBComponentsResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*dbaasv1beta1.ChangePSMDBComponentsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *dbaasv1beta1.ChangePSMDBComponentsRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ChangePXCComponents provides a mock function with given fields: _a0, _a1 -func (_m *mockComponentsService) ChangePXCComponents(_a0 context.Context, _a1 *dbaasv1beta1.ChangePXCComponentsRequest) (*dbaasv1beta1.ChangePXCComponentsResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *dbaasv1beta1.ChangePXCComponentsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.ChangePXCComponentsRequest) (*dbaasv1beta1.ChangePXCComponentsResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.ChangePXCComponentsRequest) *dbaasv1beta1.ChangePXCComponentsResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*dbaasv1beta1.ChangePXCComponentsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *dbaasv1beta1.ChangePXCComponentsRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// CheckForOperatorUpdate provides a mock function with given fields: _a0, _a1 -func (_m *mockComponentsService) CheckForOperatorUpdate(_a0 context.Context, _a1 *dbaasv1beta1.CheckForOperatorUpdateRequest) (*dbaasv1beta1.CheckForOperatorUpdateResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *dbaasv1beta1.CheckForOperatorUpdateResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.CheckForOperatorUpdateRequest) (*dbaasv1beta1.CheckForOperatorUpdateResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.CheckForOperatorUpdateRequest) *dbaasv1beta1.CheckForOperatorUpdateResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*dbaasv1beta1.CheckForOperatorUpdateResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *dbaasv1beta1.CheckForOperatorUpdateRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetPSMDBComponents provides a mock function with given fields: _a0, _a1 -func (_m *mockComponentsService) GetPSMDBComponents(_a0 context.Context, _a1 *dbaasv1beta1.GetPSMDBComponentsRequest) (*dbaasv1beta1.GetPSMDBComponentsResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *dbaasv1beta1.GetPSMDBComponentsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.GetPSMDBComponentsRequest) (*dbaasv1beta1.GetPSMDBComponentsResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.GetPSMDBComponentsRequest) *dbaasv1beta1.GetPSMDBComponentsResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*dbaasv1beta1.GetPSMDBComponentsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *dbaasv1beta1.GetPSMDBComponentsRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetPXCComponents provides a mock function with given fields: _a0, _a1 -func (_m *mockComponentsService) GetPXCComponents(_a0 context.Context, _a1 *dbaasv1beta1.GetPXCComponentsRequest) (*dbaasv1beta1.GetPXCComponentsResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *dbaasv1beta1.GetPXCComponentsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.GetPXCComponentsRequest) (*dbaasv1beta1.GetPXCComponentsResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.GetPXCComponentsRequest) *dbaasv1beta1.GetPXCComponentsResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*dbaasv1beta1.GetPXCComponentsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *dbaasv1beta1.GetPXCComponentsRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// InstallOperator provides a mock function with given fields: _a0, _a1 -func (_m *mockComponentsService) InstallOperator(_a0 context.Context, _a1 *dbaasv1beta1.InstallOperatorRequest) (*dbaasv1beta1.InstallOperatorResponse, error) { - ret := _m.Called(_a0, _a1) - - var r0 *dbaasv1beta1.InstallOperatorResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.InstallOperatorRequest) (*dbaasv1beta1.InstallOperatorResponse, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.InstallOperatorRequest) *dbaasv1beta1.InstallOperatorResponse); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*dbaasv1beta1.InstallOperatorResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *dbaasv1beta1.InstallOperatorRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// newMockComponentsService creates a new instance of mockComponentsService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockComponentsService(t interface { - mock.TestingT - Cleanup(func()) -}, -) *mockComponentsService { - mock := &mockComponentsService{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/managed/services/management/dbaas/mock_dbaas_client_test.go b/managed/services/management/dbaas/mock_dbaas_client_test.go deleted file mode 100644 index 56055f83e4..0000000000 --- a/managed/services/management/dbaas/mock_dbaas_client_test.go +++ /dev/null @@ -1,290 +0,0 @@ -// Code generated by mockery v2.33.0. DO NOT EDIT. - -package dbaas - -import ( - context "context" - - controllerv1beta1 "github.com/percona-platform/dbaas-api/gen/controller" - mock "github.com/stretchr/testify/mock" - grpc "google.golang.org/grpc" -) - -// mockDbaasClient is an autogenerated mock type for the dbaasClient type -type mockDbaasClient struct { - mock.Mock -} - -// Connect provides a mock function with given fields: ctx -func (_m *mockDbaasClient) Connect(ctx context.Context) error { - ret := _m.Called(ctx) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(ctx) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Disconnect provides a mock function with given fields: -func (_m *mockDbaasClient) Disconnect() error { - ret := _m.Called() - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// GetKubeConfig provides a mock function with given fields: ctx, in, opts -func (_m *mockDbaasClient) GetKubeConfig(ctx context.Context, in *controllerv1beta1.GetKubeconfigRequest, opts ...grpc.CallOption) (*controllerv1beta1.GetKubeconfigResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *controllerv1beta1.GetKubeconfigResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.GetKubeconfigRequest, ...grpc.CallOption) (*controllerv1beta1.GetKubeconfigResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.GetKubeconfigRequest, ...grpc.CallOption) *controllerv1beta1.GetKubeconfigResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*controllerv1beta1.GetKubeconfigResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *controllerv1beta1.GetKubeconfigRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetLogs provides a mock function with given fields: ctx, in, opts -func (_m *mockDbaasClient) GetLogs(ctx context.Context, in *controllerv1beta1.GetLogsRequest, opts ...grpc.CallOption) (*controllerv1beta1.GetLogsResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *controllerv1beta1.GetLogsResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.GetLogsRequest, ...grpc.CallOption) (*controllerv1beta1.GetLogsResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.GetLogsRequest, ...grpc.CallOption) *controllerv1beta1.GetLogsResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*controllerv1beta1.GetLogsResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *controllerv1beta1.GetLogsRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetResources provides a mock function with given fields: ctx, in, opts -func (_m *mockDbaasClient) GetResources(ctx context.Context, in *controllerv1beta1.GetResourcesRequest, opts ...grpc.CallOption) (*controllerv1beta1.GetResourcesResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *controllerv1beta1.GetResourcesResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.GetResourcesRequest, ...grpc.CallOption) (*controllerv1beta1.GetResourcesResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.GetResourcesRequest, ...grpc.CallOption) *controllerv1beta1.GetResourcesResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*controllerv1beta1.GetResourcesResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *controllerv1beta1.GetResourcesRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// InstallPSMDBOperator provides a mock function with given fields: ctx, in, opts -func (_m *mockDbaasClient) InstallPSMDBOperator(ctx context.Context, in *controllerv1beta1.InstallPSMDBOperatorRequest, opts ...grpc.CallOption) (*controllerv1beta1.InstallPSMDBOperatorResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *controllerv1beta1.InstallPSMDBOperatorResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.InstallPSMDBOperatorRequest, ...grpc.CallOption) (*controllerv1beta1.InstallPSMDBOperatorResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.InstallPSMDBOperatorRequest, ...grpc.CallOption) *controllerv1beta1.InstallPSMDBOperatorResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*controllerv1beta1.InstallPSMDBOperatorResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *controllerv1beta1.InstallPSMDBOperatorRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// InstallPXCOperator provides a mock function with given fields: ctx, in, opts -func (_m *mockDbaasClient) InstallPXCOperator(ctx context.Context, in *controllerv1beta1.InstallPXCOperatorRequest, opts ...grpc.CallOption) (*controllerv1beta1.InstallPXCOperatorResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *controllerv1beta1.InstallPXCOperatorResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.InstallPXCOperatorRequest, ...grpc.CallOption) (*controllerv1beta1.InstallPXCOperatorResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.InstallPXCOperatorRequest, ...grpc.CallOption) *controllerv1beta1.InstallPXCOperatorResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*controllerv1beta1.InstallPXCOperatorResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *controllerv1beta1.InstallPXCOperatorRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// StartMonitoring provides a mock function with given fields: ctx, in, opts -func (_m *mockDbaasClient) StartMonitoring(ctx context.Context, in *controllerv1beta1.StartMonitoringRequest, opts ...grpc.CallOption) (*controllerv1beta1.StartMonitoringResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *controllerv1beta1.StartMonitoringResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.StartMonitoringRequest, ...grpc.CallOption) (*controllerv1beta1.StartMonitoringResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.StartMonitoringRequest, ...grpc.CallOption) *controllerv1beta1.StartMonitoringResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*controllerv1beta1.StartMonitoringResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *controllerv1beta1.StartMonitoringRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// StopMonitoring provides a mock function with given fields: ctx, in, opts -func (_m *mockDbaasClient) StopMonitoring(ctx context.Context, in *controllerv1beta1.StopMonitoringRequest, opts ...grpc.CallOption) (*controllerv1beta1.StopMonitoringResponse, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, in) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - var r0 *controllerv1beta1.StopMonitoringResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.StopMonitoringRequest, ...grpc.CallOption) (*controllerv1beta1.StopMonitoringResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.StopMonitoringRequest, ...grpc.CallOption) *controllerv1beta1.StopMonitoringResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*controllerv1beta1.StopMonitoringResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *controllerv1beta1.StopMonitoringRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// newMockDbaasClient creates a new instance of mockDbaasClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockDbaasClient(t interface { - mock.TestingT - Cleanup(func()) -}, -) *mockDbaasClient { - mock := &mockDbaasClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/managed/services/management/dbaas/mock_grafana_client_test.go b/managed/services/management/dbaas/mock_grafana_client_test.go deleted file mode 100644 index e6c5cc9565..0000000000 --- a/managed/services/management/dbaas/mock_grafana_client_test.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by mockery v2.33.0. DO NOT EDIT. - -package dbaas - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" -) - -// mockGrafanaClient is an autogenerated mock type for the grafanaClient type -type mockGrafanaClient struct { - mock.Mock -} - -// CreateAdminAPIKey provides a mock function with given fields: ctx, name -func (_m *mockGrafanaClient) CreateAdminAPIKey(ctx context.Context, name string) (int64, string, error) { - ret := _m.Called(ctx, name) - - var r0 int64 - var r1 string - var r2 error - if rf, ok := ret.Get(0).(func(context.Context, string) (int64, string, error)); ok { - return rf(ctx, name) - } - if rf, ok := ret.Get(0).(func(context.Context, string) int64); ok { - r0 = rf(ctx, name) - } else { - r0 = ret.Get(0).(int64) - } - - if rf, ok := ret.Get(1).(func(context.Context, string) string); ok { - r1 = rf(ctx, name) - } else { - r1 = ret.Get(1).(string) - } - - if rf, ok := ret.Get(2).(func(context.Context, string) error); ok { - r2 = rf(ctx, name) - } else { - r2 = ret.Error(2) - } - - return r0, r1, r2 -} - -// DeleteAPIKeyByID provides a mock function with given fields: ctx, id -func (_m *mockGrafanaClient) DeleteAPIKeyByID(ctx context.Context, id int64) error { - ret := _m.Called(ctx, id) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, int64) error); ok { - r0 = rf(ctx, id) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// DeleteAPIKeysWithPrefix provides a mock function with given fields: ctx, name -func (_m *mockGrafanaClient) DeleteAPIKeysWithPrefix(ctx context.Context, name string) error { - ret := _m.Called(ctx, name) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, name) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// newMockGrafanaClient creates a new instance of mockGrafanaClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockGrafanaClient(t interface { - mock.TestingT - Cleanup(func()) -}, -) *mockGrafanaClient { - mock := &mockGrafanaClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/managed/services/management/dbaas/mock_kube_storage_manager_test.go b/managed/services/management/dbaas/mock_kube_storage_manager_test.go deleted file mode 100644 index 45cf143e0c..0000000000 --- a/managed/services/management/dbaas/mock_kube_storage_manager_test.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by mockery v2.33.0. DO NOT EDIT. - -package dbaas - -import mock "github.com/stretchr/testify/mock" - -// mockKubeStorageManager is an autogenerated mock type for the kubeStorageManager type -type mockKubeStorageManager struct { - mock.Mock -} - -// DeleteClient provides a mock function with given fields: name -func (_m *mockKubeStorageManager) DeleteClient(name string) error { - ret := _m.Called(name) - - var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(name) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// GetOrSetClient provides a mock function with given fields: name -func (_m *mockKubeStorageManager) GetOrSetClient(name string) (kubernetesClient, error) { - ret := _m.Called(name) - - var r0 kubernetesClient - var r1 error - if rf, ok := ret.Get(0).(func(string) (kubernetesClient, error)); ok { - return rf(name) - } - if rf, ok := ret.Get(0).(func(string) kubernetesClient); ok { - r0 = rf(name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(kubernetesClient) - } - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// newMockKubeStorageManager creates a new instance of mockKubeStorageManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockKubeStorageManager(t interface { - mock.TestingT - Cleanup(func()) -}, -) *mockKubeStorageManager { - mock := &mockKubeStorageManager{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/managed/services/management/dbaas/mock_kubernetes_client_test.go b/managed/services/management/dbaas/mock_kubernetes_client_test.go deleted file mode 100644 index c4b9e38d31..0000000000 --- a/managed/services/management/dbaas/mock_kubernetes_client_test.go +++ /dev/null @@ -1,600 +0,0 @@ -// Code generated by mockery v2.33.0. DO NOT EDIT. - -package dbaas - -import ( - context "context" - - v1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" - v1 "github.com/percona/dbaas-operator/api/v1" - mock "github.com/stretchr/testify/mock" - corev1 "k8s.io/api/core/v1" - storagev1 "k8s.io/api/storage/v1" - version "k8s.io/apimachinery/pkg/version" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - kubernetes "github.com/percona/pmm/managed/services/dbaas/kubernetes" -) - -// mockKubernetesClient is an autogenerated mock type for the kubernetesClient type -type mockKubernetesClient struct { - mock.Mock -} - -// CreateDatabaseCluster provides a mock function with given fields: _a0 -func (_m *mockKubernetesClient) CreateDatabaseCluster(_a0 *v1.DatabaseCluster) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(*v1.DatabaseCluster) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// CreatePMMSecret provides a mock function with given fields: _a0, _a1 -func (_m *mockKubernetesClient) CreatePMMSecret(_a0 string, _a1 map[string][]byte) error { - ret := _m.Called(_a0, _a1) - - var r0 error - if rf, ok := ret.Get(0).(func(string, map[string][]byte) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// CreateRestore provides a mock function with given fields: _a0 -func (_m *mockKubernetesClient) CreateRestore(_a0 *v1.DatabaseClusterRestore) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(*v1.DatabaseClusterRestore) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// DeleteDatabaseCluster provides a mock function with given fields: _a0, _a1 -func (_m *mockKubernetesClient) DeleteDatabaseCluster(_a0 context.Context, _a1 string) error { - ret := _m.Called(_a0, _a1) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// GetAllClusterResources provides a mock function with given fields: _a0, _a1, _a2 -func (_m *mockKubernetesClient) GetAllClusterResources(_a0 context.Context, _a1 kubernetes.ClusterType, _a2 *corev1.PersistentVolumeList) (uint64, uint64, uint64, error) { - ret := _m.Called(_a0, _a1, _a2) - - var r0 uint64 - var r1 uint64 - var r2 uint64 - var r3 error - if rf, ok := ret.Get(0).(func(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) (uint64, uint64, uint64, error)); ok { - return rf(_a0, _a1, _a2) - } - if rf, ok := ret.Get(0).(func(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) uint64); ok { - r0 = rf(_a0, _a1, _a2) - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) uint64); ok { - r1 = rf(_a0, _a1, _a2) - } else { - r1 = ret.Get(1).(uint64) - } - - if rf, ok := ret.Get(2).(func(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) uint64); ok { - r2 = rf(_a0, _a1, _a2) - } else { - r2 = ret.Get(2).(uint64) - } - - if rf, ok := ret.Get(3).(func(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) error); ok { - r3 = rf(_a0, _a1, _a2) - } else { - r3 = ret.Error(3) - } - - return r0, r1, r2, r3 -} - -// GetClusterType provides a mock function with given fields: _a0 -func (_m *mockKubernetesClient) GetClusterType(_a0 context.Context) (kubernetes.ClusterType, error) { - ret := _m.Called(_a0) - - var r0 kubernetes.ClusterType - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (kubernetes.ClusterType, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(context.Context) kubernetes.ClusterType); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(kubernetes.ClusterType) - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetConsumedCPUAndMemory provides a mock function with given fields: _a0, _a1 -func (_m *mockKubernetesClient) GetConsumedCPUAndMemory(_a0 context.Context, _a1 string) (uint64, uint64, error) { - ret := _m.Called(_a0, _a1) - - var r0 uint64 - var r1 uint64 - var r2 error - if rf, ok := ret.Get(0).(func(context.Context, string) (uint64, uint64, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, string) uint64); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func(context.Context, string) uint64); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Get(1).(uint64) - } - - if rf, ok := ret.Get(2).(func(context.Context, string) error); ok { - r2 = rf(_a0, _a1) - } else { - r2 = ret.Error(2) - } - - return r0, r1, r2 -} - -// GetConsumedDiskBytes provides a mock function with given fields: _a0, _a1, _a2 -func (_m *mockKubernetesClient) GetConsumedDiskBytes(_a0 context.Context, _a1 kubernetes.ClusterType, _a2 *corev1.PersistentVolumeList) (uint64, error) { - ret := _m.Called(_a0, _a1, _a2) - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) (uint64, error)); ok { - return rf(_a0, _a1, _a2) - } - if rf, ok := ret.Get(0).(func(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) uint64); ok { - r0 = rf(_a0, _a1, _a2) - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) error); ok { - r1 = rf(_a0, _a1, _a2) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetDatabaseCluster provides a mock function with given fields: _a0, _a1 -func (_m *mockKubernetesClient) GetDatabaseCluster(_a0 context.Context, _a1 string) (*v1.DatabaseCluster, error) { - ret := _m.Called(_a0, _a1) - - var r0 *v1.DatabaseCluster - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*v1.DatabaseCluster, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *v1.DatabaseCluster); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.DatabaseCluster) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetDefaultStorageClassName provides a mock function with given fields: _a0 -func (_m *mockKubernetesClient) GetDefaultStorageClassName(_a0 context.Context) (string, error) { - ret := _m.Called(_a0) - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (string, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(context.Context) string); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetPSMDBOperatorVersion provides a mock function with given fields: _a0 -func (_m *mockKubernetesClient) GetPSMDBOperatorVersion(_a0 context.Context) (string, error) { - ret := _m.Called(_a0) - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (string, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(context.Context) string); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetPXCOperatorVersion provides a mock function with given fields: _a0 -func (_m *mockKubernetesClient) GetPXCOperatorVersion(_a0 context.Context) (string, error) { - ret := _m.Called(_a0) - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (string, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(context.Context) string); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetPersistentVolumes provides a mock function with given fields: ctx -func (_m *mockKubernetesClient) GetPersistentVolumes(ctx context.Context) (*corev1.PersistentVolumeList, error) { - ret := _m.Called(ctx) - - var r0 *corev1.PersistentVolumeList - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*corev1.PersistentVolumeList, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *corev1.PersistentVolumeList); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*corev1.PersistentVolumeList) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetSecret provides a mock function with given fields: _a0, _a1 -func (_m *mockKubernetesClient) GetSecret(_a0 context.Context, _a1 string) (*corev1.Secret, error) { - ret := _m.Called(_a0, _a1) - - var r0 *corev1.Secret - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*corev1.Secret, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *corev1.Secret); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*corev1.Secret) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetServerVersion provides a mock function with given fields: -func (_m *mockKubernetesClient) GetServerVersion() (*version.Info, error) { - ret := _m.Called() - - var r0 *version.Info - var r1 error - if rf, ok := ret.Get(0).(func() (*version.Info, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() *version.Info); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*version.Info) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetStorageClasses provides a mock function with given fields: ctx -func (_m *mockKubernetesClient) GetStorageClasses(ctx context.Context) (*storagev1.StorageClassList, error) { - ret := _m.Called(ctx) - - var r0 *storagev1.StorageClassList - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*storagev1.StorageClassList, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) *storagev1.StorageClassList); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*storagev1.StorageClassList) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// InstallOLMOperator provides a mock function with given fields: ctx -func (_m *mockKubernetesClient) InstallOLMOperator(ctx context.Context) error { - ret := _m.Called(ctx) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(ctx) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// InstallOperator provides a mock function with given fields: ctx, req -func (_m *mockKubernetesClient) InstallOperator(ctx context.Context, req kubernetes.InstallOperatorRequest) error { - ret := _m.Called(ctx, req) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, kubernetes.InstallOperatorRequest) error); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ListDatabaseClusters provides a mock function with given fields: _a0 -func (_m *mockKubernetesClient) ListDatabaseClusters(_a0 context.Context) (*v1.DatabaseClusterList, error) { - ret := _m.Called(_a0) - - var r0 *v1.DatabaseClusterList - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*v1.DatabaseClusterList, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(context.Context) *v1.DatabaseClusterList); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.DatabaseClusterList) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ListSecrets provides a mock function with given fields: _a0 -func (_m *mockKubernetesClient) ListSecrets(_a0 context.Context) (*corev1.SecretList, error) { - ret := _m.Called(_a0) - - var r0 *corev1.SecretList - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*corev1.SecretList, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(context.Context) *corev1.SecretList); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*corev1.SecretList) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ListSubscriptions provides a mock function with given fields: ctx, namespace -func (_m *mockKubernetesClient) ListSubscriptions(ctx context.Context, namespace string) (*v1alpha1.SubscriptionList, error) { - ret := _m.Called(ctx, namespace) - - var r0 *v1alpha1.SubscriptionList - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*v1alpha1.SubscriptionList, error)); ok { - return rf(ctx, namespace) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *v1alpha1.SubscriptionList); ok { - r0 = rf(ctx, namespace) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1alpha1.SubscriptionList) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, namespace) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ListTemplates provides a mock function with given fields: ctx, engine, namespace -func (_m *mockKubernetesClient) ListTemplates(ctx context.Context, engine string, namespace string) ([]*dbaasv1beta1.Template, error) { - ret := _m.Called(ctx, engine, namespace) - - var r0 []*dbaasv1beta1.Template - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) ([]*dbaasv1beta1.Template, error)); ok { - return rf(ctx, engine, namespace) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string) []*dbaasv1beta1.Template); ok { - r0 = rf(ctx, engine, namespace) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*dbaasv1beta1.Template) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, engine, namespace) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PatchDatabaseCluster provides a mock function with given fields: _a0 -func (_m *mockKubernetesClient) PatchDatabaseCluster(_a0 *v1.DatabaseCluster) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(*v1.DatabaseCluster) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// RestartDatabaseCluster provides a mock function with given fields: _a0, _a1 -func (_m *mockKubernetesClient) RestartDatabaseCluster(_a0 context.Context, _a1 string) error { - ret := _m.Called(_a0, _a1) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SetKubeconfig provides a mock function with given fields: _a0 -func (_m *mockKubernetesClient) SetKubeconfig(_a0 string) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// UpgradeOperator provides a mock function with given fields: ctx, namespace, name -func (_m *mockKubernetesClient) UpgradeOperator(ctx context.Context, namespace string, name string) error { - ret := _m.Called(ctx, namespace, name) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { - r0 = rf(ctx, namespace, name) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// newMockKubernetesClient creates a new instance of mockKubernetesClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockKubernetesClient(t interface { - mock.TestingT - Cleanup(func()) -}, -) *mockKubernetesClient { - mock := &mockKubernetesClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/managed/services/management/dbaas/mock_version_service_test.go b/managed/services/management/dbaas/mock_version_service_test.go deleted file mode 100644 index cba073721d..0000000000 --- a/managed/services/management/dbaas/mock_version_service_test.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by mockery v2.33.0. DO NOT EDIT. - -package dbaas - -import ( - context "context" - - version "github.com/hashicorp/go-version" - mock "github.com/stretchr/testify/mock" -) - -// mockVersionService is an autogenerated mock type for the versionService type -type mockVersionService struct { - mock.Mock -} - -// GetNextDatabaseImage provides a mock function with given fields: ctx, operatorType, operatorVersion, installedDBVersion -func (_m *mockVersionService) GetNextDatabaseImage(ctx context.Context, operatorType string, operatorVersion string, installedDBVersion string) (string, error) { - ret := _m.Called(ctx, operatorType, operatorVersion, installedDBVersion) - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, string) (string, error)); ok { - return rf(ctx, operatorType, operatorVersion, installedDBVersion) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string, string) string); ok { - r0 = rf(ctx, operatorType, operatorVersion, installedDBVersion) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { - r1 = rf(ctx, operatorType, operatorVersion, installedDBVersion) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetVersionServiceURL provides a mock function with given fields: -func (_m *mockVersionService) GetVersionServiceURL() string { - ret := _m.Called() - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// IsDatabaseVersionSupportedByOperator provides a mock function with given fields: ctx, operatorType, operatorVersion, databaseVersion -func (_m *mockVersionService) IsDatabaseVersionSupportedByOperator(ctx context.Context, operatorType string, operatorVersion string, databaseVersion string) (bool, error) { - ret := _m.Called(ctx, operatorType, operatorVersion, databaseVersion) - - var r0 bool - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, string) (bool, error)); ok { - return rf(ctx, operatorType, operatorVersion, databaseVersion) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string, string) bool); ok { - r0 = rf(ctx, operatorType, operatorVersion, databaseVersion) - } else { - r0 = ret.Get(0).(bool) - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { - r1 = rf(ctx, operatorType, operatorVersion, databaseVersion) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// LatestOperatorVersion provides a mock function with given fields: ctx, pmmVersion -func (_m *mockVersionService) LatestOperatorVersion(ctx context.Context, pmmVersion string) (*version.Version, *version.Version, error) { - ret := _m.Called(ctx, pmmVersion) - - var r0 *version.Version - var r1 *version.Version - var r2 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*version.Version, *version.Version, error)); ok { - return rf(ctx, pmmVersion) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *version.Version); ok { - r0 = rf(ctx, pmmVersion) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*version.Version) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) *version.Version); ok { - r1 = rf(ctx, pmmVersion) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*version.Version) - } - } - - if rf, ok := ret.Get(2).(func(context.Context, string) error); ok { - r2 = rf(ctx, pmmVersion) - } else { - r2 = ret.Error(2) - } - - return r0, r1, r2 -} - -// Matrix provides a mock function with given fields: ctx, params -func (_m *mockVersionService) Matrix(ctx context.Context, params componentsParams) (*VersionServiceResponse, error) { - ret := _m.Called(ctx, params) - - var r0 *VersionServiceResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, componentsParams) (*VersionServiceResponse, error)); ok { - return rf(ctx, params) - } - if rf, ok := ret.Get(0).(func(context.Context, componentsParams) *VersionServiceResponse); ok { - r0 = rf(ctx, params) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*VersionServiceResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, componentsParams) error); ok { - r1 = rf(ctx, params) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NextOperatorVersion provides a mock function with given fields: ctx, operatorType, installedVersion -func (_m *mockVersionService) NextOperatorVersion(ctx context.Context, operatorType string, installedVersion string) (*version.Version, error) { - ret := _m.Called(ctx, operatorType, installedVersion) - - var r0 *version.Version - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (*version.Version, error)); ok { - return rf(ctx, operatorType, installedVersion) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string) *version.Version); ok { - r0 = rf(ctx, operatorType, installedVersion) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*version.Version) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, operatorType, installedVersion) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SupportedOperatorVersionsList provides a mock function with given fields: ctx, pmmVersion -func (_m *mockVersionService) SupportedOperatorVersionsList(ctx context.Context, pmmVersion string) (map[string][]string, error) { - ret := _m.Called(ctx, pmmVersion) - - var r0 map[string][]string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (map[string][]string, error)); ok { - return rf(ctx, pmmVersion) - } - if rf, ok := ret.Get(0).(func(context.Context, string) map[string][]string); ok { - r0 = rf(ctx, pmmVersion) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string][]string) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, pmmVersion) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// newMockVersionService creates a new instance of mockVersionService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newMockVersionService(t interface { - mock.TestingT - Cleanup(func()) -}, -) *mockVersionService { - mock := &mockVersionService{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/managed/services/management/dbaas/psmdb_cluster_service.go b/managed/services/management/dbaas/psmdb_cluster_service.go deleted file mode 100644 index 7a9fdea706..0000000000 --- a/managed/services/management/dbaas/psmdb_cluster_service.go +++ /dev/null @@ -1,385 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package dbaas - -import ( - "context" - cryptoRand "crypto/rand" - "fmt" - "math/big" - "math/rand" - "regexp" - "strings" - - "github.com/google/uuid" - "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "gopkg.in/reform.v1" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/services/dbaas/kubernetes" -) - -const ( - psmdbDefaultClusterSize = 3 - psmdbDefaultCPUM = 1000 - psmdbDefaultMemoryBytes = 2000000000 - psmdbDefaultDiskSize = 25000000000 -) - -// PSMDBClusterService implements PSMDBClusterServer methods. -type PSMDBClusterService struct { - db *reform.DB - l *logrus.Entry - grafanaClient grafanaClient - componentsService componentsService - kubeStorage *KubeStorage - versionServiceURL string - - dbaasv1beta1.UnimplementedPSMDBClustersServer -} - -// NewPSMDBClusterService creates PSMDB Service. -func NewPSMDBClusterService(db *reform.DB, grafanaClient grafanaClient, //nolint:ireturn - componentsService componentsService, versionServiceURL string, -) dbaasv1beta1.PSMDBClustersServer { - l := logrus.WithField("component", "psmdb_cluster") - return &PSMDBClusterService{ - db: db, - l: l, - grafanaClient: grafanaClient, - componentsService: componentsService, - kubeStorage: NewKubeStorage(db), - versionServiceURL: versionServiceURL, - } -} - -// Enabled returns if service is enabled and can be used. -func (s *PSMDBClusterService) Enabled() bool { - settings, err := models.GetSettings(s.db) - if err != nil { - s.l.WithError(err).Error("can't get settings") - return false - } - return settings.DBaaS.Enabled -} - -// GetPSMDBClusterCredentials returns a PSMDB cluster credentials by cluster name. -func (s PSMDBClusterService) GetPSMDBClusterCredentials(ctx context.Context, req *dbaasv1beta1.GetPSMDBClusterCredentialsRequest) (*dbaasv1beta1.GetPSMDBClusterCredentialsResponse, error) { //nolint:lll - kubeClient, err := s.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, err - } - dbCluster, err := kubeClient.GetDatabaseCluster(ctx, req.Name) - if err != nil { - return nil, errors.Wrap(err, "failed getting database cluster") - } - secret, err := kubeClient.GetSecret(ctx, dbCluster.Spec.SecretsName) - if err != nil { - return nil, errors.Wrap(err, "failed getting secret") - } - - resp := dbaasv1beta1.GetPSMDBClusterCredentialsResponse{ - ConnectionCredentials: &dbaasv1beta1.GetPSMDBClusterCredentialsResponse_PSMDBCredentials{ - Username: string(secret.Data["MONGODB_USER_ADMIN_USER"]), - Password: string(secret.Data["MONGODB_USER_ADMIN_PASSWORD"]), - Host: dbCluster.Status.Host, - Port: 27017, - Replicaset: "rs0", - }, - } - - return &resp, nil -} - -// CreatePSMDBCluster creates PSMDB cluster with given parameters. -// -//nolint:dupl -func (s PSMDBClusterService) CreatePSMDBCluster(ctx context.Context, req *dbaasv1beta1.CreatePSMDBClusterRequest) (*dbaasv1beta1.CreatePSMDBClusterResponse, error) { //nolint:lll - settings, err := models.GetSettings(s.db.Querier) - if err != nil { - return nil, err - } - kubeClient, err := s.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, err - } - - psmdbComponents, err := s.componentsService.GetPSMDBComponents(ctx, &dbaasv1beta1.GetPSMDBComponentsRequest{ - KubernetesClusterName: req.KubernetesClusterName, - }) - if err != nil { - return nil, errors.Wrap(err, "cannot get the list of PSMDB components") - } - if psmdbComponents == nil || len(psmdbComponents.Versions) < 1 { - return nil, errors.New("version service returned an empty list for the PSMDB components") - } - - var backupImage string - backupComponent, err := DefaultComponent(psmdbComponents.Versions[0].Matrix.Backup) - if err != nil { - s.l.Warnf("Cannot get the backup component: %s", err) - } else { - backupImage = backupComponent.ImagePath - } - - if err := s.fillDefaults(req, psmdbComponents); err != nil { - return nil, errors.Wrap(err, "cannot create PSMDB cluster") - } - if req.Params.Replicaset.StorageClass == "" { - className, err := kubeClient.GetDefaultStorageClassName(ctx) - if err != nil { - return nil, errors.Wrap(err, "failed to get storage classes") - } - req.Params.Replicaset.StorageClass = className - } - clusterType, err := kubeClient.GetClusterType(ctx) - if err != nil { - return nil, errors.Wrap(err, "failed getting cluster type") - } - backupLocation, err := s.getBackupLocation(req) - if err != nil { - return nil, errors.Wrap(err, "failed getting backup location") - } - dbCluster, dbRestore, err := kubernetes.DatabaseClusterForPSMDB(req, clusterType, backupLocation, backupImage) - if err != nil { - return nil, errors.Wrap(err, "failed to create CR specification") - } - - secrets := map[string][]byte{ - "MONGODB_BACKUP_USER": []byte("backup"), - "MONGODB_CLUSTER_ADMIN_USER": []byte("clusterAdmin"), - "MONGODB_CLUSTER_MONITOR_USER": []byte("clusterMonitor"), - "MONGODB_USER_ADMIN_USER": []byte("userAdmin"), - } - passwords, err := generatePasswords(map[string][]byte{ - "MONGODB_BACKUP_PASSWORD": {}, - "MONGODB_CLUSTER_ADMIN_PASSWORD": {}, - "MONGODB_CLUSTER_MONITOR_PASSWORD": {}, - "MONGODB_USER_ADMIN_PASSWORD": {}, - }) - if err != nil { - return nil, err - } - for k, v := range passwords { - secrets[k] = v - } - var apiKeyID int64 - if settings.PMMPublicAddress != "" { - var apiKey string - apiKeyName := fmt.Sprintf("psmdb-%s-%s-%d", req.KubernetesClusterName, req.Name, rand.Int63()) //nolint:gosec - apiKeyID, apiKey, err = s.grafanaClient.CreateAdminAPIKey(ctx, apiKeyName) - if err != nil { - return nil, err - } - dbCluster.Spec.Monitoring.PMM.PublicAddress = settings.PMMPublicAddress - dbCluster.Spec.Monitoring.PMM.Login = "api_key" - dbCluster.Spec.Monitoring.PMM.Image = getPMMClientImage() //nolint:contextcheck - secrets["PMM_SERVER_USER"] = []byte("api_key") - secrets["PMM_SERVER_PASSWORD"] = []byte(apiKey) - } - if req.Params.Restore == nil || (req.Params.Restore != nil && req.Params.Restore.SecretsName == "") { - err = kubeClient.CreatePMMSecret(dbCluster.Spec.SecretsName, secrets) - if err != nil { - return nil, err - } - } - - err = kubeClient.CreateDatabaseCluster(dbCluster) - if err != nil { - if apiKeyID != 0 { - e := s.grafanaClient.DeleteAPIKeyByID(ctx, apiKeyID) - if e != nil { - s.l.Warnf("couldn't delete created API Key %v: %s", apiKeyID, e) - } - } - return nil, err - } - if req.Params.Backup != nil || req.Params.Restore != nil && backupLocation != nil { - secretsName := fmt.Sprintf("%s-backup", dbCluster.Spec.SecretsName) - secrets := kubernetes.SecretForBackup(backupLocation) - if err := kubeClient.CreatePMMSecret(secretsName, secrets); err != nil { - return nil, errors.Wrap(err, "failed to create a secret") - } - } - if dbRestore != nil { - if err := kubeClient.CreateRestore(dbRestore); err != nil { - return nil, err - } - } - - return &dbaasv1beta1.CreatePSMDBClusterResponse{}, nil -} - -func (s PSMDBClusterService) fillDefaults( - req *dbaasv1beta1.CreatePSMDBClusterRequest, psmdbComponents *dbaasv1beta1.GetPSMDBComponentsResponse, -) error { - if req.Name != "" { - r := regexp.MustCompile("^[a-z]([-a-z0-9]*[a-z0-9])?$") - if !r.MatchString(req.Name) { - return errInvalidClusterName - } - } - if req.Params == nil { - req.Params = &dbaasv1beta1.PSMDBClusterParams{} - } - - if req.Params.ClusterSize < 1 { - req.Params.ClusterSize = psmdbDefaultClusterSize - } - - if req.Params.Replicaset == nil { - req.Params.Replicaset = &dbaasv1beta1.PSMDBClusterParams_ReplicaSet{} - } - - if req.Params.Replicaset.DiskSize == 0 { - req.Params.Replicaset.DiskSize = psmdbDefaultDiskSize - } - - if req.Params.Replicaset.ComputeResources == nil { - req.Params.Replicaset.ComputeResources = &dbaasv1beta1.ComputeResources{ - CpuM: psmdbDefaultCPUM, - MemoryBytes: psmdbDefaultMemoryBytes, - } - } - if req.Params.Replicaset.ComputeResources.CpuM == 0 { - req.Params.Replicaset.ComputeResources.CpuM = psmdbDefaultCPUM - } - if req.Params.Replicaset.ComputeResources.MemoryBytes == 0 { - req.Params.Replicaset.ComputeResources.MemoryBytes = psmdbDefaultMemoryBytes - } - - psmdbComponent, err := DefaultComponent(psmdbComponents.Versions[0].Matrix.Mongod) - if err != nil { - return errors.Wrap(err, "cannot get the recommended MongoDB image name") - } - - if req.Params.Image == "" { - req.Params.Image = psmdbComponent.ImagePath - } - - if req.Name == "" { - // Image is a string like this: percona/percona-server-mongodb:4.2.12-13 - // We need only the version part to build the cluster name. - parts := strings.Split(req.Params.Image, ":") - - // This is to generate an unique name. - uuids := strings.ReplaceAll(uuid.New().String(), "-", "") - uuids = uuids[len(uuids)-5:] - - req.Name = fmt.Sprintf("psmdb-%s-%s", strings.ReplaceAll(parts[len(parts)-1], ".", "-"), uuids) - if len(req.Name) > 22 { // Kubernetes limitation - req.Name = req.Name[:21] - } - } - // } - - return nil -} - -// UpdatePSMDBCluster updates PSMDB cluster. -func (s PSMDBClusterService) UpdatePSMDBCluster(ctx context.Context, req *dbaasv1beta1.UpdatePSMDBClusterRequest) (*dbaasv1beta1.UpdatePSMDBClusterResponse, error) { - kubeClient, err := s.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, err - } - dbCluster, err := kubeClient.GetDatabaseCluster(ctx, req.Name) - if err != nil { - return nil, err - } - clusterType, err := kubeClient.GetClusterType(ctx) - if err != nil { - return nil, errors.Wrap(err, "failed getting cluster type") - } - err = kubernetes.UpdatePatchForPSMDB(dbCluster, req, clusterType) - if err != nil { - return nil, err - } - - err = kubeClient.PatchDatabaseCluster(dbCluster) - if err != nil { - return nil, err - } - - return &dbaasv1beta1.UpdatePSMDBClusterResponse{}, nil -} - -func (s PSMDBClusterService) getBackupLocation(req *dbaasv1beta1.CreatePSMDBClusterRequest) (*models.BackupLocation, error) { - if req.Params != nil && req.Params.Backup != nil && req.Params.Backup.LocationId != "" { - return models.FindBackupLocationByID(s.db.Querier, req.Params.Backup.LocationId) - } - if req.Params != nil && req.Params.Restore != nil && req.Params.Restore.LocationId != "" { - return models.FindBackupLocationByID(s.db.Querier, req.Params.Restore.LocationId) - } - return nil, nil //nolint:nilnil -} - -// GetPSMDBClusterResources returns expected resources to be consumed by the cluster. -func (s PSMDBClusterService) GetPSMDBClusterResources(ctx context.Context, req *dbaasv1beta1.GetPSMDBClusterResourcesRequest) (*dbaasv1beta1.GetPSMDBClusterResourcesResponse, error) { //nolint:lll - settings, err := models.GetSettings(s.db.Querier) - if err != nil { - return nil, err - } - - clusterSize := uint64(req.Params.ClusterSize) - memory := uint64(req.Params.Replicaset.ComputeResources.MemoryBytes) * 2 * clusterSize - cpu := uint64(req.Params.Replicaset.ComputeResources.CpuM) * 2 * clusterSize - disk := uint64(req.Params.Replicaset.DiskSize)*3 + uint64(req.Params.Replicaset.DiskSize)*clusterSize - - if settings.PMMPublicAddress != "" { - memory += (3 + 2*clusterSize) * 500000000 - cpu += (3 + 2*clusterSize) * 500 - } - - return &dbaasv1beta1.GetPSMDBClusterResourcesResponse{ - Expected: &dbaasv1beta1.Resources{ - CpuM: cpu, - MemoryBytes: memory, - DiskSize: disk, - }, - }, nil -} - -const ( - passwordLength = 24 -) - -func generatePasswords(secrets map[string][]byte) (map[string][]byte, error) { - for key := range secrets { - password, err := generatePassword(passwordLength) - if err != nil { - return nil, errors.Wrapf(err, "failed to generate password for %s", key) - } - secrets[key] = []byte(password) - } - return secrets, nil -} - -func generatePassword(n int) (string, error) { - // PSMDB do not support all special characters in password https://jira.percona.com/browse/K8SPSMDB-364 - symbols := []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") - symbolsLen := len(symbols) - b := make([]rune, n) - for i := range b { - randomIndex, err := cryptoRand.Int(cryptoRand.Reader, big.NewInt(int64(symbolsLen))) - if err != nil { - return "", err - } - b[i] = symbols[randomIndex.Uint64()] - } - return string(b), nil -} diff --git a/managed/services/management/dbaas/psmdb_cluster_service_test.go b/managed/services/management/dbaas/psmdb_cluster_service_test.go deleted file mode 100644 index b406675433..0000000000 --- a/managed/services/management/dbaas/psmdb_cluster_service_test.go +++ /dev/null @@ -1,390 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -// Package dbaas contains all logic related to dbaas services. -package dbaas - -import ( - "context" - "fmt" - "testing" - "time" - - "github.com/google/uuid" - dbaasv1 "github.com/percona/dbaas-operator/api/v1" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "gopkg.in/reform.v1" - "gopkg.in/reform.v1/dialects/postgresql" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/services/dbaas/kubernetes" - "github.com/percona/pmm/managed/utils/testdb" - "github.com/percona/pmm/managed/utils/tests" - "github.com/percona/pmm/utils/logger" - pmmversion "github.com/percona/pmm/version" -) - -const psmdbKubeconfTest = ` -{ - "apiVersion": "v1", - "kind": "Config", - "users": [ - { - "name": "percona-server-mongodb-operator", - "user": { - "token": "some-token" - } - } - ], - "clusters": [ - { - "cluster": { - "certificate-authority-data": "some-certificate-authority-data", - "server": "https://192.168.0.42:8443" - }, - "name": "self-hosted-cluster" - } - ], - "contexts": [ - { - "context": { - "cluster": "self-hosted-cluster", - "user": "percona-server-mongodb-operator" - }, - "name": "svcs-acct-context" - } - ], - "current-context": "svcs-acct-context" -} -` -const psmdbKubernetesClusterNameTest = "test-k8s-cluster-name" - -func TestPSMDBClusterService(t *testing.T) { - // This is for local testing. When running local tests, if pmmversion.PMMVersion is empty - // these lines in kubernetes_server.go will throw an error and tests won't finish. - // - // pmmVersion, err := goversion.NewVersion(pmmversion.PMMVersion) - // if err != nil { - // return nil, status.Error(codes.Internal, err.Error()) - // } - // - if pmmversion.PMMVersion == "" { - pmmversion.PMMVersion = "2.30.0" - } - setup := func(t *testing.T) (ctx context.Context, db *reform.DB, dbaasClient *mockDbaasClient, grafanaClient *mockGrafanaClient, - kubeClient *mockKubernetesClient, componentsService *mockComponentsService, teardown func(t *testing.T), - ) { - t.Helper() - - ctx = logger.Set(context.Background(), t.Name()) - uuid.SetRand(&tests.IDReader{}) - - sqlDB := testdb.Open(t, models.SetupFixtures, nil) - // To enable queries logs, use: - // db = reform.NewDB(sqlDB, postgresql.Dialect, reform.NewPrintfLogger(t.Logf)) - db = reform.NewDB(sqlDB, postgresql.Dialect, nil) - dbaasClient = &mockDbaasClient{} - grafanaClient = &mockGrafanaClient{} - kubeClient = &mockKubernetesClient{} - componentsService = &mockComponentsService{} - - teardown = func(t *testing.T) { - t.Helper() - uuid.SetRand(nil) - dbaasClient.AssertExpectations(t) - require.NoError(t, sqlDB.Close()) - } - - return - } - - ctx, db, dbaasClient, grafanaClient, kubeClient, componentsService, teardown := setup(t) - defer teardown(t) - versionService := NewVersionServiceClient(versionServiceURL) - ks := NewKubernetesServer(db, dbaasClient, versionService, grafanaClient) - - grafanaClient.On("CreateAdminAPIKey", mock.Anything, mock.Anything).Return(int64(0), "", nil) - kubeClient.On("CreatePMMSecret", mock.Anything, mock.Anything).Return(nil, nil) - kubeClient.On("GetClusterType", ctx).Return(kubernetes.ClusterTypeGeneric, nil) - kubeClient.On("GetDefaultStorageClassName", mock.Anything).Return("", nil) - kubeClient.On("GetPSMDBOperatorVersion", mock.Anything, mock.Anything).Return("1.11.0", nil) - kubeClient.On("GetPXCOperatorVersion", mock.Anything, mock.Anything).Return("1.11.0", nil) - kubeClient.On("InstallOLMOperator", mock.Anything, mock.Anything).WaitUntil(time.After(time.Second)).Return(nil) - kubeClient.On("InstallOperator", mock.Anything, mock.Anything).WaitUntil(time.After(time.Second)).Return(nil) - - kubeClient.On("GetServerVersion").Return(nil, nil) - clients := map[string]kubernetesClient{ - psmdbKubernetesClusterNameTest: kubeClient, - } - s := ks.(*kubernetesServer) - s.kubeStorage.clients = clients - ks = s - registerKubernetesClusterResponse, err := ks.RegisterKubernetesCluster(ctx, &dbaasv1beta1.RegisterKubernetesClusterRequest{ - KubernetesClusterName: psmdbKubernetesClusterNameTest, - KubeAuth: &dbaasv1beta1.KubeAuth{Kubeconfig: psmdbKubeconfTest}, - }) - require.NoError(t, err) - assert.NotNil(t, registerKubernetesClusterResponse) - versionService = NewVersionServiceClient(versionServiceURL) - - //nolint:dupl - t.Run("BasicCreatePSMDBClusters", func(t *testing.T) { - mockGetPSMDBComponentsResponse := &dbaasv1beta1.GetPSMDBComponentsResponse{ - Versions: []*dbaasv1beta1.OperatorVersion{ - { - Product: "psmdb-operator", - Operator: "1.6.0", - Matrix: &dbaasv1beta1.Matrix{ - Mongod: map[string]*dbaasv1beta1.Component{ - "4.2.11-12": { - ImagePath: "percona/percona-server-mongodb:4.2.11-12", - ImageHash: "1909cb7a6ecea9bf0535b54aa86b9ae74ba2fa303c55cf4a1a54262fb0edbd3c", - Status: "recommended", - Critical: false, - Default: false, - Disabled: false, - }, - "4.2.7-7": { - ImagePath: "percona/percona-server-mongodb:4.2.7-7", - ImageHash: "1d8a0859b48a3e9cadf9ad7308ec5aa4b278a64ca32ff5d887156b1b46146b13", - Status: "available", - Critical: false, - Default: false, - Disabled: false, - }, - "4.4.2-4": { - ImagePath: "percona/percona-server-mongodb:4.4.2-4", - ImageHash: "991d6049059e5eb1a74981290d829a5fb4ab0554993748fde1e67b2f46f26bf0", - Status: "recommended", - Critical: false, - Default: true, - Disabled: false, - }, - "4.2.8-8": { - ImagePath: "percona/percona-server-mongodb:4.2.8-8", - ImageHash: "a66e889d3e986413e41083a9c887f33173da05a41c8bd107cf50eede4588a505", - Status: "available", - Critical: false, - Default: false, - Disabled: false, - }, - }, - }, - }, - }, - } - cs := NewPSMDBClusterService(db, grafanaClient, componentsService, versionService.GetVersionServiceURL()) - s := cs.(*PSMDBClusterService) - s.kubeStorage.clients = clients - - componentsService.On("GetPSMDBComponents", mock.Anything, mock.Anything).Return(mockGetPSMDBComponentsResponse, nil) - kubeClient.On("CreateDatabaseCluster", mock.Anything).Return(nil) - - in := dbaasv1beta1.CreatePSMDBClusterRequest{ - KubernetesClusterName: psmdbKubernetesClusterNameTest, - Name: "third-psmdb-test", - Params: &dbaasv1beta1.PSMDBClusterParams{ - ClusterSize: 5, - Replicaset: &dbaasv1beta1.PSMDBClusterParams_ReplicaSet{ - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 3, - MemoryBytes: 256, - }, - DiskSize: 1024 * 1024 * 1024, - }, - Image: "path", - }, - } - - _, err := s.CreatePSMDBCluster(ctx, &in) - assert.NoError(t, err) - }) - - // Pass the minimum parameters to use the defaults set by the fillDefaults function - t.Run("CreatePSMDBClustersMinimumParams", func(t *testing.T) { - psmdbComponents := &dbaasv1beta1.GetPSMDBComponentsResponse{ - Versions: []*dbaasv1beta1.OperatorVersion{ - { - Product: "psmdb-operator", - Operator: "1.11.0", - Matrix: &dbaasv1beta1.Matrix{ - Mongod: map[string]*dbaasv1beta1.Component{ - "4.2.11-12": { - ImagePath: "percona/percona-server-mongodb:4.2.11-12", - ImageHash: "1909cb7a6ecea9bf0535b54aa86b9ae74ba2fa303c55cf4a1a54262fb0edbd3c", - Status: "available", - Critical: false, - Default: false, - Disabled: false, - }, - "4.2.12-13": { - ImagePath: "percona/percona-server-mongodb:4.2.12-13", - ImageHash: "dda89e647ea5aa1266055ef465d66a139722d9e3f78a839a90a9f081b09ce26d", - Status: "available", - Critical: false, - Default: false, - Disabled: false, - }, - "4.2.17-17": { - ImagePath: "percona/percona-server-mongodb:4.2.17-17", - ImageHash: "dde894b50568e088b28767ff18cfbdfe6b2496f12eddb14743d3d33c105e3f01", - Status: "recommended", - Critical: false, - Default: true, - Disabled: false, - }, - }, - }, - }, - }, - } - componentsService.On("GetPSMDBComponents", ctx, mock.Anything).Return(psmdbComponents, nil) - - cs := NewPSMDBClusterService(db, grafanaClient, componentsService, versionService.GetVersionServiceURL()) - s := cs.(*PSMDBClusterService) - s.kubeStorage.clients = clients - kubeClient.On("CreateDatabaseCluster", mock.Anything).Return(nil) - - in := dbaasv1beta1.CreatePSMDBClusterRequest{ - KubernetesClusterName: psmdbKubernetesClusterNameTest, - } - - _, err := s.CreatePSMDBCluster(ctx, &in) - assert.NoError(t, err) - }) - - //nolint:dupl - t.Run("BasicUpdatePSMDBCluster", func(t *testing.T) { - cs := NewPSMDBClusterService(db, grafanaClient, componentsService, versionService.GetVersionServiceURL()) - s := cs.(*PSMDBClusterService) - s.kubeStorage.clients = clients - dbMock := &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "third-psmdb-test", - }, - Spec: dbaasv1.DatabaseSpec{ - Database: "psmdb", - DatabaseImage: "percona/percona-server-mongodb:4.4.5-7", - ClusterSize: 5, - DBInstance: dbaasv1.DBInstanceSpec{ - CPU: resource.MustParse("3m"), - Memory: resource.MustParse("256"), - DiskSize: resource.MustParse("1073741824"), - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "mongos", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("2m"), - corev1.ResourceMemory: resource.MustParse("124"), - }, - }, - }, - }, - Status: dbaasv1.DatabaseClusterStatus{ - Ready: 10, - Size: 10, - }, - } - - kubeClient.On("GetDatabaseCluster", ctx, "third-psmdb-test").Return(dbMock, nil) - kubeClient.On("PatchDatabaseCluster", mock.Anything).Return(nil) - - in := dbaasv1beta1.UpdatePSMDBClusterRequest{ - KubernetesClusterName: psmdbKubernetesClusterNameTest, - Name: "third-psmdb-test", - Params: &dbaasv1beta1.UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams{ - ClusterSize: 8, - Replicaset: &dbaasv1beta1.UpdatePSMDBClusterRequest_UpdatePSMDBClusterParams_ReplicaSet{ - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 1, - MemoryBytes: 256, - }, - }, - }, - } - - _, err := s.UpdatePSMDBCluster(ctx, &in) - assert.NoError(t, err) - }) - - t.Run("BasicGetPSMDBClusterCredentials", func(t *testing.T) { - cs := NewPSMDBClusterService(db, grafanaClient, componentsService, versionService.GetVersionServiceURL()) - s := cs.(*PSMDBClusterService) - s.kubeStorage.clients = clients - mockReq := &corev1.Secret{ - Data: map[string][]byte{ - "MONGODB_USER_ADMIN_USER": []byte("userAdmin"), - "MONGODB_USER_ADMIN_PASSWORD": []byte("userAdmin123"), - }, - } - dbMock := &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "another-third-psmdb-test", - }, - Spec: dbaasv1.DatabaseSpec{ - SecretsName: fmt.Sprintf(psmdbSecretNameTmpl, "another-third-psmdb-test"), - }, - Status: dbaasv1.DatabaseClusterStatus{ - Host: "hostname", - }, - } - - kubeClient.On("GetDatabaseCluster", ctx, "another-third-psmdb-test").Return(dbMock, nil) - - kubeClient.On("GetSecret", ctx, fmt.Sprintf(psmdbSecretNameTmpl, "another-third-psmdb-test")).Return(mockReq, nil) - - in := dbaasv1beta1.GetPSMDBClusterCredentialsRequest{ - KubernetesClusterName: psmdbKubernetesClusterNameTest, - Name: "another-third-psmdb-test", - } - - cluster, err := s.GetPSMDBClusterCredentials(ctx, &in) - - assert.NoError(t, err) - assert.Equal(t, "hostname", cluster.ConnectionCredentials.Host) - }) - - t.Run("BasicGetPSMDBClusterResources", func(t *testing.T) { - cs := NewPSMDBClusterService(db, grafanaClient, componentsService, versionService.GetVersionServiceURL()) - s := cs.(*PSMDBClusterService) - s.kubeStorage.clients = clients - - in := dbaasv1beta1.GetPSMDBClusterResourcesRequest{ - Params: &dbaasv1beta1.PSMDBClusterParams{ - ClusterSize: 4, - Replicaset: &dbaasv1beta1.PSMDBClusterParams_ReplicaSet{ - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 2000, - MemoryBytes: 2000000000, - }, - DiskSize: 2000000000, - }, - }, - } - - actual, err := s.GetPSMDBClusterResources(ctx, &in) - assert.NoError(t, err) - assert.Equal(t, uint64(16000000000), actual.Expected.MemoryBytes) - assert.Equal(t, uint64(16000), actual.Expected.CpuM) - assert.Equal(t, uint64(14000000000), actual.Expected.DiskSize) - }) -} diff --git a/managed/services/management/dbaas/pxc_cluster_service.go b/managed/services/management/dbaas/pxc_cluster_service.go deleted file mode 100644 index de510c9998..0000000000 --- a/managed/services/management/dbaas/pxc_cluster_service.go +++ /dev/null @@ -1,411 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -// Package dbaas contains all logic related to dbaas services. -package dbaas - -import ( - "context" - "fmt" - "math/rand" - "regexp" - "strings" - - "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "gopkg.in/reform.v1" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/services/dbaas/kubernetes" -) - -const ( - pxcDefaultClusterSize = 3 - pxcDefaultCPUM = 1000 - pxcDefaultMemoryBytes = 2000000000 - pxcDefaultDiskSize = 25000000000 - proxyDefaultCPUM = 500 - proxyDefaultMemoryBytes = 500000000 - haProxyTemplate = "percona/percona-xtradb-cluster-operator:%s-haproxy" - proxySQLTemplate = "percona/percona-xtradb-cluster-operator:%s-proxysql" -) - -var errInvalidClusterName = errors.New("invalid cluster name. It must start with a letter and have only letters, numbers and -") - -// PXCClustersService implements PXCClusterServer methods. -type PXCClustersService struct { - db *reform.DB - l *logrus.Entry - grafanaClient grafanaClient - componentsService componentsService - kubeStorage *KubeStorage - versionServiceURL string - - dbaasv1beta1.UnimplementedPXCClustersServer -} - -// NewPXCClusterService creates PXC Service. -func NewPXCClusterService(db *reform.DB, grafanaClient grafanaClient, componentsService componentsService, //nolint:ireturn - versionServiceURL string, -) dbaasv1beta1.PXCClustersServer { - l := logrus.WithField("component", "pxc_cluster") - return &PXCClustersService{ - db: db, - l: l, - grafanaClient: grafanaClient, - versionServiceURL: versionServiceURL, - componentsService: componentsService, - kubeStorage: NewKubeStorage(db), - } -} - -// GetPXCClusterCredentials returns a PXC cluster credentials. -func (s PXCClustersService) GetPXCClusterCredentials(ctx context.Context, req *dbaasv1beta1.GetPXCClusterCredentialsRequest) (*dbaasv1beta1.GetPXCClusterCredentialsResponse, error) { //nolint:lll - kubeClient, err := s.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, err - } - dbCluster, err := kubeClient.GetDatabaseCluster(ctx, req.Name) - if err != nil { - return nil, errors.Wrap(err, "failed getting database cluster") - } - secret, err := kubeClient.GetSecret(ctx, dbCluster.Spec.SecretsName) - if err != nil { - return nil, errors.Wrap(err, "failed getting secret") - } - - resp := dbaasv1beta1.GetPXCClusterCredentialsResponse{ - ConnectionCredentials: &dbaasv1beta1.PXCClusterConnectionCredentials{ - Username: "root", - Password: string(secret.Data["root"]), - Host: dbCluster.Status.Host, - Port: 3306, - }, - } - - return &resp, nil -} - -// CreatePXCCluster creates PXC cluster with given parameters. -// -//nolint:dupl -func (s PXCClustersService) CreatePXCCluster(ctx context.Context, req *dbaasv1beta1.CreatePXCClusterRequest) (*dbaasv1beta1.CreatePXCClusterResponse, error) { - settings, err := models.GetSettings(s.db.Querier) - if err != nil { - return nil, errInvalidClusterName - } - - if req.Params == nil { - req.Params = &dbaasv1beta1.PXCClusterParams{} - } - // Check if one and only one of proxies is set. - if req.Params.Proxysql != nil && req.Params.Haproxy != nil { - return nil, errors.New("pxc cluster must have one and only one proxy type defined") - } - - kubeClient, err := s.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, err - } - - if err := s.fillDefaults(ctx, req.KubernetesClusterName, req, kubeClient); err != nil { - return nil, errors.Wrap(err, "cannot create pxc cluster") - } - - if req.Params.Pxc.StorageClass == "" { - className, err := kubeClient.GetDefaultStorageClassName(ctx) - if err != nil { - return nil, errors.Wrap(err, "failed to get storage classes") - } - req.Params.Pxc.StorageClass = className - } - clusterType, err := kubeClient.GetClusterType(ctx) - if err != nil { - return nil, errors.Wrap(err, "failed getting cluster type") - } - backupLocation, err := s.getBackupLocation(req) - if err != nil { - return nil, errors.Wrap(err, "failed getting backup location") - } - dbCluster, dbRestore, err := kubernetes.DatabaseClusterForPXC(req, clusterType, backupLocation) - if err != nil { - return nil, errors.Wrap(err, "failed to create CR specification") - } - - secrets, err := generatePasswords(map[string][]byte{ - "root": {}, - "xtrabackup": {}, - "monitor": {}, - "clustercheck": {}, - "proxyadmin": {}, - "operator": {}, - "replication": {}, - }) - if err != nil { - return nil, err - } - var apiKeyID int64 - if settings.PMMPublicAddress != "" { - var apiKey string - apiKeyName := fmt.Sprintf("pxc-%s-%s-%d", req.KubernetesClusterName, req.Name, rand.Int63()) //nolint:gosec - apiKeyID, apiKey, err = s.grafanaClient.CreateAdminAPIKey(ctx, apiKeyName) - if err != nil { - return nil, err - } - dbCluster.Spec.Monitoring.PMM.PublicAddress = settings.PMMPublicAddress - dbCluster.Spec.Monitoring.PMM.Login = "api_key" - dbCluster.Spec.Monitoring.PMM.Image = getPMMClientImage() //nolint:contextcheck - - secrets["pmmserver"] = []byte(apiKey) - } - if req.Params.Restore == nil || (req.Params.Restore != nil && req.Params.Restore.SecretsName == "") { - err = kubeClient.CreatePMMSecret(dbCluster.Spec.SecretsName, secrets) - if err != nil { - return nil, err - } - } - err = kubeClient.CreateDatabaseCluster(dbCluster) - - if err != nil { - if apiKeyID != 0 { - e := s.grafanaClient.DeleteAPIKeyByID(ctx, apiKeyID) - if e != nil { - s.l.Warnf("couldn't delete created API Key %v: %s", apiKeyID, e) - } - } - } - if req.Params.Backup != nil || req.Params.Restore != nil && backupLocation != nil { - secretsName := fmt.Sprintf("%s-backup", dbCluster.Spec.SecretsName) - secrets := kubernetes.SecretForBackup(backupLocation) - if err := kubeClient.CreatePMMSecret(secretsName, secrets); err != nil { - return nil, errors.Wrap(err, "failed to create a secret") - } - } - if dbRestore != nil { - if err := kubeClient.CreateRestore(dbRestore); err != nil { - return nil, err - } - } - return &dbaasv1beta1.CreatePXCClusterResponse{}, nil -} - -//nolint:cyclop -func (s PXCClustersService) fillDefaults(ctx context.Context, kubernetesClusterName string, - req *dbaasv1beta1.CreatePXCClusterRequest, kubeClient kubernetesClient, -) error { - if req.Name != "" { - r := regexp.MustCompile("^[a-z]([-a-z0-9]*[a-z0-9])?$") - if !r.MatchString(req.Name) { - return errInvalidClusterName - } - } - if req.Params == nil { - req.Params = &dbaasv1beta1.PXCClusterParams{} - } - - if req.Params.ClusterSize < 1 { - req.Params.ClusterSize = pxcDefaultClusterSize - } - - if req.Params.Pxc == nil { - req.Params.Pxc = &dbaasv1beta1.PXCClusterParams_PXC{} - } - - if req.Params.Pxc.DiskSize == 0 { - req.Params.Pxc.DiskSize = pxcDefaultDiskSize - } - - if req.Params.Pxc.ComputeResources == nil { - req.Params.Pxc.ComputeResources = &dbaasv1beta1.ComputeResources{ - CpuM: pxcDefaultCPUM, - MemoryBytes: pxcDefaultMemoryBytes, - } - } - if req.Params.Pxc.ComputeResources.CpuM == 0 { - req.Params.Pxc.ComputeResources.CpuM = pxcDefaultCPUM - } - if req.Params.Pxc.ComputeResources.MemoryBytes == 0 { - req.Params.Pxc.ComputeResources.MemoryBytes = pxcDefaultMemoryBytes - } - - // If none of them was specified, use HAProxy by default. - if req.Params.Proxysql == nil && req.Params.Haproxy == nil { - req.Params.Haproxy = &dbaasv1beta1.PXCClusterParams_HAProxy{ - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: proxyDefaultCPUM, - MemoryBytes: proxyDefaultMemoryBytes, - }, - } - } - - if req.Params.Haproxy != nil { - if req.Params.Haproxy.ComputeResources == nil { - req.Params.Haproxy.ComputeResources = &dbaasv1beta1.ComputeResources{ - CpuM: proxyDefaultCPUM, - MemoryBytes: proxyDefaultMemoryBytes, - } - } - if req.Params.Haproxy.ComputeResources.CpuM == 0 { - req.Params.Haproxy.ComputeResources.CpuM = proxyDefaultCPUM - } - if req.Params.Haproxy.ComputeResources.MemoryBytes == 0 { - req.Params.Haproxy.ComputeResources.MemoryBytes = proxyDefaultMemoryBytes - } - if req.Params.Haproxy.Image == "" { - // PXC operator requires to specify HAproxy image - // It uses default operator distribution based on version - // following the template operatorimage:version-haproxy - version, err := kubeClient.GetPXCOperatorVersion(ctx) - if err != nil { - return err - } - req.Params.Haproxy.Image = fmt.Sprintf(haProxyTemplate, version) - } - } - - if req.Params.Proxysql != nil { - if req.Params.Proxysql.ComputeResources == nil { - req.Params.Proxysql.ComputeResources = &dbaasv1beta1.ComputeResources{ - CpuM: proxyDefaultCPUM, - MemoryBytes: proxyDefaultMemoryBytes, - } - } - if req.Params.Proxysql.ComputeResources.CpuM == 0 { - req.Params.Proxysql.ComputeResources.CpuM = proxyDefaultCPUM - } - if req.Params.Proxysql.ComputeResources.MemoryBytes == 0 { - req.Params.Proxysql.ComputeResources.MemoryBytes = proxyDefaultMemoryBytes - } - if req.Params.Proxysql.Image == "" { - // PXC operator requires to specify ProxySQL image - // It uses default operator distribution based on version - // following the template operatorimage:version-proxysql - version, err := kubeClient.GetPXCOperatorVersion(ctx) - if err != nil { - return err - } - req.Params.Proxysql.Image = fmt.Sprintf(proxySQLTemplate, version) - } - } - - // Only call the version service if it is really needed. - if req.Name == "" || req.Params.Pxc.Image == "" { - pxcComponents, err := s.componentsService.GetPXCComponents(ctx, &dbaasv1beta1.GetPXCComponentsRequest{ - KubernetesClusterName: kubernetesClusterName, - }) - if err != nil { - return errors.New("cannot get the list of PXC components") - } - - component, err := DefaultComponent(pxcComponents.Versions[0].Matrix.Pxc) - if err != nil { - return errors.Wrap(err, "cannot get the recommended PXC image name") - } - - if req.Params.Pxc.Image == "" { - req.Params.Pxc.Image = component.ImagePath - } - - if req.Name == "" { - // Image is a string like this: percona/percona-server-mongodb:4.2.12-13 - // We need only the version part to build the cluster name. - parts := strings.Split(req.Params.Pxc.Image, ":") - req.Name = fmt.Sprintf("pxc-%s-%04d", strings.ReplaceAll(parts[len(parts)-1], ".", "-"), rand.Int63n(9999)) //nolint:gosec - if len(req.Name) > 22 { // Kubernetes limitation - req.Name = req.Name[:21] - } - } - } - - return nil -} - -// UpdatePXCCluster updates PXC cluster. -// -//nolint:dupl -func (s PXCClustersService) UpdatePXCCluster(ctx context.Context, req *dbaasv1beta1.UpdatePXCClusterRequest) (*dbaasv1beta1.UpdatePXCClusterResponse, error) { - if (req.Params.Proxysql != nil) && (req.Params.Haproxy != nil) { - return nil, errors.New("can't update both proxies, only one is in use") - } - kubeClient, err := s.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, err - } - dbCluster, err := kubeClient.GetDatabaseCluster(ctx, req.Name) - if err != nil { - return nil, err - } - clusterType, err := kubeClient.GetClusterType(ctx) - if err != nil { - return nil, errors.Wrap(err, "failed getting cluster type") - } - err = kubernetes.UpdatePatchForPXC(dbCluster, req, clusterType) - if err != nil { - return nil, errors.Wrap(err, "failed to create CR specification") - } - - err = kubeClient.PatchDatabaseCluster(dbCluster) - - if err != nil { - return nil, err - } - - return &dbaasv1beta1.UpdatePXCClusterResponse{}, nil -} - -// GetPXCClusterResources returns expected resources to be consumed by the cluster. -func (s PXCClustersService) GetPXCClusterResources(_ context.Context, req *dbaasv1beta1.GetPXCClusterResourcesRequest) (*dbaasv1beta1.GetPXCClusterResourcesResponse, error) { //nolint:lll - settings, err := models.GetSettings(s.db.Querier) - if err != nil { - return nil, err - } - - clusterSize := uint64(req.Params.ClusterSize) - var proxyComputeResources *dbaasv1beta1.ComputeResources - var disk uint64 - if req.Params.Proxysql != nil { - disk = uint64(req.Params.Proxysql.DiskSize) * clusterSize - proxyComputeResources = req.Params.Proxysql.ComputeResources - } else { - proxyComputeResources = req.Params.Haproxy.ComputeResources - } - memory := uint64(req.Params.Pxc.ComputeResources.MemoryBytes+proxyComputeResources.MemoryBytes) * clusterSize - cpu := uint64(req.Params.Pxc.ComputeResources.CpuM+proxyComputeResources.CpuM) * clusterSize - disk += uint64(req.Params.Pxc.DiskSize) * clusterSize - - if settings.PMMPublicAddress != "" { - memory += 1000000000 * clusterSize - cpu += 1000 * clusterSize - } - - return &dbaasv1beta1.GetPXCClusterResourcesResponse{ - Expected: &dbaasv1beta1.Resources{ - CpuM: cpu, - MemoryBytes: memory, - DiskSize: disk, - }, - }, nil -} - -func (s PXCClustersService) getBackupLocation(req *dbaasv1beta1.CreatePXCClusterRequest) (*models.BackupLocation, error) { - if req.Params != nil && req.Params.Backup != nil && req.Params.Backup.LocationId != "" { - return models.FindBackupLocationByID(s.db.Querier, req.Params.Backup.LocationId) - } - if req.Params != nil && req.Params.Restore != nil && req.Params.Restore.LocationId != "" { - return models.FindBackupLocationByID(s.db.Querier, req.Params.Restore.LocationId) - } - return nil, nil //nolint:nilnil -} diff --git a/managed/services/management/dbaas/pxc_cluster_service_test.go b/managed/services/management/dbaas/pxc_cluster_service_test.go deleted file mode 100644 index d5da41acfd..0000000000 --- a/managed/services/management/dbaas/pxc_cluster_service_test.go +++ /dev/null @@ -1,522 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -// Package dbaas contains all logic related to dbaas services. -package dbaas - -import ( - "context" - "fmt" - "sync" - "testing" - "time" - - "github.com/google/uuid" - goversion "github.com/hashicorp/go-version" - controllerv1beta1 "github.com/percona-platform/dbaas-api/gen/controller" - dbaasv1 "github.com/percona/dbaas-operator/api/v1" - "github.com/stretchr/testify/assert" - mock "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "gopkg.in/reform.v1" - "gopkg.in/reform.v1/dialects/postgresql" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/services/dbaas/kubernetes" - "github.com/percona/pmm/managed/utils/testdb" - "github.com/percona/pmm/managed/utils/tests" - "github.com/percona/pmm/utils/logger" - pmmversion "github.com/percona/pmm/version" -) - -const pxcKubeconfigTest = ` -{ - "apiVersion": "v1", - "kind": "Config", - "users": [ - { - "name": "percona-xtradb-cluster-operator", - "user": { - "token": "some-token" - } - } - ], - "clusters": [ - { - "cluster": { - "certificate-authority-data": "some-certificate-authority-data", - "server": "https://192.168.0.42:8443" - }, - "name": "self-hosted-cluster" - } - ], - "contexts": [ - { - "context": { - "cluster": "self-hosted-cluster", - "user": "percona-xtradb-cluster-operator" - }, - "name": "svcs-acct-context" - } - ], - "current-context": "svcs-acct-context" -} -` -const pxcKubernetesClusterNameTest = "test-k8s-cluster-name" - -func TestPXCClusterService(t *testing.T) { //nolint:tparallel - // This is for local testing. When running local tests, if pmmversion.PMMVersion is empty - // these lines in kubernetes_server.go will throw an error and tests won't finish. - // - // pmmVersion, err := goversion.NewVersion(pmmversion.PMMVersion) - // if err != nil { - // return nil, status.Error(codes.Internal, err.Error()) - // } - // - if pmmversion.PMMVersion == "" { - pmmversion.PMMVersion = "2.30.0" - } - setup := func(t *testing.T) (ctx context.Context, db *reform.DB, dbaasClient *mockDbaasClient, grafanaClient *mockGrafanaClient, - componentsService *mockComponentsService, kubeClient *mockKubernetesClient, teardown func(t *testing.T), - ) { - t.Helper() - - ctx = logger.Set(context.Background(), t.Name()) - uuid.SetRand(&tests.IDReader{}) - - sqlDB := testdb.Open(t, models.SetupFixtures, nil) - db = reform.NewDB(sqlDB, postgresql.Dialect, nil) - dbaasClient = &mockDbaasClient{} - grafanaClient = &mockGrafanaClient{} - kubeClient = &mockKubernetesClient{} - componentsService = &mockComponentsService{} - - teardown = func(t *testing.T) { - t.Helper() - uuid.SetRand(nil) - dbaasClient.AssertExpectations(t) - } - - return - } - - ctx, db, dbaasClient, grafanaClient, componentsClient, kubeClient, teardown := setup(t) - t.Cleanup(func() { teardown(t) }) - - versionService := &mockVersionService{} - v1120, _ := goversion.NewVersion("1.12.0") - versionService.On("LatestOperatorVersion", mock.Anything, mock.Anything).Return(v1120, v1120, nil) - versionService.On("GetVersionServiceURL", mock.Anything).Return("", nil) - - ks := NewKubernetesServer(db, dbaasClient, versionService, grafanaClient) - - grafanaClient.On("CreateAdminAPIKey", mock.Anything, mock.Anything).Return(int64(123456), "api-key", nil) - kubeClient.On("InstallOLMOperator", mock.Anything, mock.Anything).Return(nil) - kubeClient.On("InstallOperator", mock.Anything, mock.Anything).Return(nil) - kubeClient.On("GetPSMDBOperatorVersion", mock.Anything, mock.Anything).Return("1.11.0", nil) - kubeClient.On("GetPXCOperatorVersion", mock.Anything, mock.Anything).Return("1.11.0", nil) - - wg := sync.WaitGroup{} - wg.Add(1) - dbaasClient.On("StartMonitoring", mock.Anything, mock.Anything).WaitUntil(time.After(15*time.Second)). - Return(&controllerv1beta1.StartMonitoringResponse{}, nil).Run(func(a mock.Arguments) { - // StartMonitoring if being called in a go-routine. Since we cannot forsee when the runtime scheduler - // is going to assing some time to this go-routine, the waitgroup is being used to signal than the test - // can continue. - wg.Done() - }) - - kubeClient.On("GetServerVersion").Return(nil, nil) - clients := map[string]kubernetesClient{ - pxcKubernetesClusterNameTest: kubeClient, - } - s := ks.(*kubernetesServer) - s.kubeStorage.clients = clients - ks = s - registerKubernetesClusterResponse, err := ks.RegisterKubernetesCluster(ctx, &dbaasv1beta1.RegisterKubernetesClusterRequest{ - KubernetesClusterName: pxcKubernetesClusterNameTest, - KubeAuth: &dbaasv1beta1.KubeAuth{Kubeconfig: pxcKubeconfigTest}, - }) - require.NoError(t, err) - assert.NotNil(t, registerKubernetesClusterResponse) - - wg.Wait() - - kubeClient.On("SetKubeconfig", mock.Anything).Return(nil) - kubeClient.On("GetPSMDBOperatorVersion", mock.Anything, mock.Anything).Return("1.11.0", nil) - kubeClient.On("GetPXCOperatorVersion", mock.Anything, mock.Anything).Return("1.11.0", nil) - kubeClient.On("GetDefaultStorageClassName", mock.Anything).Return("", nil) - kubeClient.On("GetClusterType", ctx).Return(kubernetes.ClusterTypeGeneric, nil) - kubeClient.On("CreatePMMSecret", mock.Anything, mock.Anything).Return(nil, nil) - - //nolint:dupl - t.Run("BasicCreatePXCClusters", func(t *testing.T) { - cs := NewPXCClusterService(db, grafanaClient, componentsClient, versionService.GetVersionServiceURL()) - s := cs.(*PXCClustersService) - s.kubeStorage.clients = clients - kubeClient.On("CreateDatabaseCluster", mock.Anything).Return(nil) - - in := dbaasv1beta1.CreatePXCClusterRequest{ - KubernetesClusterName: pxcKubernetesClusterNameTest, - Name: "third-pxc-test", - Params: &dbaasv1beta1.PXCClusterParams{ - ClusterSize: 5, - Pxc: &dbaasv1beta1.PXCClusterParams_PXC{ - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 3, - MemoryBytes: 256, - }, - DiskSize: 1024 * 1024 * 1024, - Image: "path", - }, - Proxysql: &dbaasv1beta1.PXCClusterParams_ProxySQL{ - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 2, - MemoryBytes: 124, - }, - DiskSize: 1024 * 1024 * 1024, - }, - }, - } - - _, err := s.CreatePXCCluster(ctx, &in) - assert.NoError(t, err) - }) - - t.Run("CreatePXCClusterMinimumParams", func(t *testing.T) { - pxcComponents := &dbaasv1beta1.GetPXCComponentsResponse{ - Versions: []*dbaasv1beta1.OperatorVersion{ - { - Product: "pxc-operator", - Operator: "1.10.0", - Matrix: &dbaasv1beta1.Matrix{ - Pxc: map[string]*dbaasv1beta1.Component{ - "8.0.19-10.1": { - ImagePath: "percona/percona-xtradb-cluster:8.0.19-10.1", - ImageHash: "1058ae8eded735ebdf664807aad7187942fc9a1170b3fd0369574cb61206b63a", - Status: "available", - Critical: false, - Default: false, - Disabled: false, - }, - "8.0.20-11.1": { - ImagePath: "percona/percona-xtradb-cluster:8.0.20-11.1", - ImageHash: "54b1b2f5153b78b05d651034d4603a13e685cbb9b45bfa09a39864fa3f169349", - Status: "available", - Critical: false, - Default: false, - Disabled: false, - }, - "8.0.25-15.1": { - ImagePath: "percona/percona-xtradb-cluster:8.0.25-15.1", - ImageHash: "529e979c86442429e6feabef9a2d9fc362f4626146f208fbfac704e145a492dd", - Status: "recommended", - Critical: false, - Default: true, - Disabled: false, - }, - }, - }, - }, - }, - } - componentsClient.On("GetPXCComponents", ctx, mock.Anything).Return(pxcComponents, nil) - kubeClient.On("CreateDatabaseCluster", mock.Anything).Return(nil) - - cs := NewPXCClusterService(db, grafanaClient, componentsClient, versionService.GetVersionServiceURL()) - s := cs.(*PXCClustersService) - s.kubeStorage.clients = clients - - in := dbaasv1beta1.CreatePXCClusterRequest{ - KubernetesClusterName: pxcKubernetesClusterNameTest, - Name: "fourth-pxc-test", - } - - _, err := s.CreatePXCCluster(ctx, &in) - assert.NoError(t, err) - }) - - t.Run("BasicGetPXCClusterCredentials", func(t *testing.T) { - name := "third-pxc-test" - cs := NewPXCClusterService(db, grafanaClient, componentsClient, versionService.GetVersionServiceURL()) - s := cs.(*PXCClustersService) - s.kubeStorage.clients = clients - - mockReq := &corev1.Secret{ - Data: map[string][]byte{ - "root": []byte("root_password"), - }, - } - dbMock := &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - }, - Status: dbaasv1.DatabaseClusterStatus{ - Host: "hostname", - }, - Spec: dbaasv1.DatabaseSpec{ - SecretsName: fmt.Sprintf(pxcSecretNameTmpl, name), - }, - } - - kubeClient.On("GetDatabaseCluster", ctx, name).Return(dbMock, nil) - - kubeClient.On("GetSecret", ctx, mock.Anything).Return(mockReq, nil) - - in := dbaasv1beta1.GetPXCClusterCredentialsRequest{ - KubernetesClusterName: pxcKubernetesClusterNameTest, - Name: name, - } - - actual, err := s.GetPXCClusterCredentials(ctx, &in) - assert.NoError(t, err) - assert.Equal(t, actual.ConnectionCredentials.Username, "root") - assert.Equal(t, actual.ConnectionCredentials.Password, "root_password") - assert.Equal(t, actual.ConnectionCredentials.Host, "hostname", name) - assert.Equal(t, actual.ConnectionCredentials.Port, int32(3306)) - }) - - t.Run("BasicGetPXCClusterCredentialsWithHost", func(t *testing.T) { // Real kubernetes will have ingress - name := "another-third-pxc-test" - cs := NewPXCClusterService(db, grafanaClient, componentsClient, versionService.GetVersionServiceURL()) - s := cs.(*PXCClustersService) - s.kubeStorage.clients = clients - mockReq := &corev1.Secret{ - Data: map[string][]byte{ - "root": []byte("root_password"), - }, - } - dbMock := &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - }, - Spec: dbaasv1.DatabaseSpec{ - SecretsName: fmt.Sprintf(pxcSecretNameTmpl, name), - }, - Status: dbaasv1.DatabaseClusterStatus{ - Host: "amazing.com", - }, - } - - kubeClient.On("GetDatabaseCluster", ctx, name).Return(dbMock, nil) - - kubeClient.On("GetSecret", ctx, fmt.Sprintf(pxcSecretNameTmpl, name)).Return(mockReq, nil) - - in := dbaasv1beta1.GetPXCClusterCredentialsRequest{ - KubernetesClusterName: pxcKubernetesClusterNameTest, - Name: name, - } - - actual, err := s.GetPXCClusterCredentials(ctx, &in) - assert.NoError(t, err) - assert.Equal(t, "root", actual.ConnectionCredentials.Username) - assert.Equal(t, "root_password", actual.ConnectionCredentials.Password) - assert.Equal(t, "amazing.com", actual.ConnectionCredentials.Host) - assert.Equal(t, int32(3306), actual.ConnectionCredentials.Port) - }) - - //nolint:dupl - t.Run("BasicUpdatePXCCluster", func(t *testing.T) { - cs := NewPXCClusterService(db, grafanaClient, componentsClient, versionService.GetVersionServiceURL()) - s := cs.(*PXCClustersService) - s.kubeStorage.clients = clients - - dbMock := &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "first-pxc-test", - }, - Spec: dbaasv1.DatabaseSpec{ - Database: "pxc", - DatabaseImage: "percona/percona-xtradb-cluster:8.0.27-18.1", - ClusterSize: 5, - DBInstance: dbaasv1.DBInstanceSpec{ - CPU: resource.MustParse("3m"), - Memory: resource.MustParse("256"), - DiskSize: resource.MustParse("1073741824"), - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "proxysql", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("2m"), - corev1.ResourceMemory: resource.MustParse("124"), - }, - }, - }, - }, - Status: dbaasv1.DatabaseClusterStatus{ - Ready: 15, - Size: 15, - }, - } - kubeClient.On("GetDatabaseCluster", ctx, "first-pxc-test").Return(dbMock, nil) - kubeClient.On("PatchDatabaseCluster", mock.Anything).Return(nil) - in := dbaasv1beta1.UpdatePXCClusterRequest{ - KubernetesClusterName: pxcKubernetesClusterNameTest, - Name: "third-pxc-test", - Params: &dbaasv1beta1.UpdatePXCClusterRequest_UpdatePXCClusterParams{ - ClusterSize: 8, - Pxc: &dbaasv1beta1.UpdatePXCClusterRequest_UpdatePXCClusterParams_PXC{ - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 1, - MemoryBytes: 256, - }, - Image: "path", - }, - Proxysql: &dbaasv1beta1.UpdatePXCClusterRequest_UpdatePXCClusterParams_ProxySQL{ - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 1, - MemoryBytes: 124, - }, - }, - }, - } - - _, err := s.UpdatePXCCluster(ctx, &in) - assert.NoError(t, err) - }) - - //nolint:dupl - t.Run("BasicSuspendResumePXCCluster", func(t *testing.T) { - cs := NewPXCClusterService(db, grafanaClient, componentsClient, versionService.GetVersionServiceURL()) - s := cs.(*PXCClustersService) - s.kubeStorage.clients = clients - dbMock := &dbaasv1.DatabaseCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "forth-pxc-test", - }, - Spec: dbaasv1.DatabaseSpec{ - Database: "pxc", - DatabaseImage: "percona/percona-xtradb-cluster:8.0.27-18.1", - ClusterSize: 5, - DBInstance: dbaasv1.DBInstanceSpec{ - CPU: resource.MustParse("3m"), - Memory: resource.MustParse("256"), - DiskSize: resource.MustParse("1073741824"), - }, - LoadBalancer: dbaasv1.LoadBalancerSpec{ - Type: "proxysql", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("2m"), - corev1.ResourceMemory: resource.MustParse("124"), - }, - }, - }, - }, - Status: dbaasv1.DatabaseClusterStatus{ - Ready: 15, - Size: 15, - }, - } - kubeClient.On("GetDatabaseCluster", ctx, "forth-pxc-test").Return(dbMock, nil) - kubeClient.On("PatchDatabaseCluster", mock.Anything).Return(nil) - - in := dbaasv1beta1.UpdatePXCClusterRequest{ - KubernetesClusterName: pxcKubernetesClusterNameTest, - Name: "forth-pxc-test", - Params: &dbaasv1beta1.UpdatePXCClusterRequest_UpdatePXCClusterParams{ - Suspend: true, - }, - } - _, err := s.UpdatePXCCluster(ctx, &in) - assert.NoError(t, err) - - in = dbaasv1beta1.UpdatePXCClusterRequest{ - KubernetesClusterName: pxcKubernetesClusterNameTest, - Name: "forth-pxc-test", - Params: &dbaasv1beta1.UpdatePXCClusterRequest_UpdatePXCClusterParams{ - Resume: true, - }, - } - _, err = s.UpdatePXCCluster(ctx, &in) - assert.NoError(t, err) - }) - - t.Run("BasicGetXtraDBClusterResources", func(t *testing.T) { - t.Parallel() - t.Run("ProxySQL", func(t *testing.T) { - t.Parallel() - cs := NewPXCClusterService(db, grafanaClient, componentsClient, versionService.GetVersionServiceURL()) - s := cs.(*PXCClustersService) - s.kubeStorage.clients = clients - v := int64(1000000000) - r := int64(2000000000) - - in := dbaasv1beta1.GetPXCClusterResourcesRequest{ - Params: &dbaasv1beta1.PXCClusterParams{ - ClusterSize: 1, - Pxc: &dbaasv1beta1.PXCClusterParams_PXC{ - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 1000, - MemoryBytes: v, - }, - DiskSize: v, - }, - Proxysql: &dbaasv1beta1.PXCClusterParams_ProxySQL{ - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 1000, - MemoryBytes: v, - }, - DiskSize: v, - }, - }, - } - - actual, err := s.GetPXCClusterResources(ctx, &in) - assert.NoError(t, err) - assert.Equal(t, uint64(r), actual.Expected.MemoryBytes) - assert.Equal(t, uint64(2000), actual.Expected.CpuM) - assert.Equal(t, uint64(r), actual.Expected.DiskSize) - }) - - t.Run("HAProxy", func(t *testing.T) { - t.Parallel() - cs := NewPXCClusterService(db, grafanaClient, componentsClient, versionService.GetVersionServiceURL()) - s := cs.(*PXCClustersService) - s.kubeStorage.clients = clients - v := int64(1000000000) - - in := dbaasv1beta1.GetPXCClusterResourcesRequest{ - Params: &dbaasv1beta1.PXCClusterParams{ - ClusterSize: 1, - Pxc: &dbaasv1beta1.PXCClusterParams_PXC{ - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 1000, - MemoryBytes: v, - }, - DiskSize: v, - }, - Haproxy: &dbaasv1beta1.PXCClusterParams_HAProxy{ - ComputeResources: &dbaasv1beta1.ComputeResources{ - CpuM: 1000, - MemoryBytes: v, - }, - }, - }, - } - - actual, err := s.GetPXCClusterResources(ctx, &in) - assert.NoError(t, err) - assert.Equal(t, uint64(2000000000), actual.Expected.MemoryBytes) - assert.Equal(t, uint64(2000), actual.Expected.CpuM) - assert.Equal(t, uint64(v), actual.Expected.DiskSize) - }) - }) -} diff --git a/managed/services/management/dbaas/template_service.go b/managed/services/management/dbaas/template_service.go deleted file mode 100644 index 8680164533..0000000000 --- a/managed/services/management/dbaas/template_service.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package dbaas - -import ( - "context" - - "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "gopkg.in/reform.v1" - - dbaasv1beta1 "github.com/percona/pmm/api/managementpb/dbaas" - "github.com/percona/pmm/managed/services/dbaas/kubernetes" -) - -type TemplateService struct { - db *reform.DB - l *logrus.Entry - kubeStorage *KubeStorage - - dbaasv1beta1.UnimplementedTemplatesServer -} - -// NewTemplateService creates DB Clusters Service. -func NewTemplateService(db *reform.DB) dbaasv1beta1.TemplatesServer { //nolint:ireturn - l := logrus.WithField("component", "dbaas_db_cluster") - return &TemplateService{ - db: db, - l: l, - kubeStorage: NewKubeStorage(db), - } -} - -// ListTemplates returns a list of templates. -func (s TemplateService) ListTemplates(ctx context.Context, req *dbaasv1beta1.ListTemplatesRequest) (*dbaasv1beta1.ListTemplatesResponse, error) { - var clusterType string - switch req.ClusterType { - case dbaasv1beta1.DBClusterType_DB_CLUSTER_TYPE_PXC: - clusterType = string(kubernetes.DatabaseTypePXC) - case dbaasv1beta1.DBClusterType_DB_CLUSTER_TYPE_PSMDB: - clusterType = string(kubernetes.DatabaseTypePSMDB) - default: - return nil, status.Error(codes.InvalidArgument, "unexpected DB cluster type") - } - - kubeClient, err := s.kubeStorage.GetOrSetClient(req.KubernetesClusterName) - if err != nil { - return nil, err - } - - // XXX: using defaultNamespace because that's where the operator is - // installed, must be the same as defined in kubernetes_server.go - templates, err := kubeClient.ListTemplates(ctx, clusterType, defaultNamespace) - if err != nil { - return nil, errors.Wrap(err, "failed listing templates") - } - - return &dbaasv1beta1.ListTemplatesResponse{ - Templates: templates, - }, nil -} diff --git a/managed/services/management/dbaas/version_service_client.go b/managed/services/management/dbaas/version_service_client.go deleted file mode 100644 index 934d9bebba..0000000000 --- a/managed/services/management/dbaas/version_service_client.go +++ /dev/null @@ -1,383 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package dbaas - -import ( - "context" - "encoding/json" - "io" - "net" - "net/http" - "net/url" - "strings" - "sync" - "time" - - goversion "github.com/hashicorp/go-version" - "github.com/pkg/errors" - prom "github.com/prometheus/client_golang/prometheus" - "github.com/sirupsen/logrus" - - "github.com/percona/pmm/managed/utils/irt" -) - -const ( - psmdbOperator = "psmdb-operator" - pxcOperator = "pxc-operator" -) - -var errNoVersionsFound = errors.New("no versions to compare current version with found") - -// componentVersion contains info about exact component version. -type componentVersion struct { - ImagePath string `json:"imagePath"` - ImageHash string `json:"imageHash"` - Status string `json:"status"` - Critical bool `json:"critical"` -} - -type matrix struct { - Mongod map[string]componentVersion `json:"mongod"` - Pxc map[string]componentVersion `json:"pxc"` - Pmm map[string]componentVersion `json:"pmm"` - Proxysql map[string]componentVersion `json:"proxysql"` - Haproxy map[string]componentVersion `json:"haproxy"` - Backup map[string]componentVersion `json:"backup"` - Operator map[string]componentVersion `json:"operator"` - LogCollector map[string]componentVersion `json:"logCollector"` - PXCOperator map[string]componentVersion `json:"pxcOperator,omitempty"` - PSMDBOperator map[string]componentVersion `json:"psmdbOperator,omitempty"` -} - -type Version struct { - Product string `json:"product"` - ProductVersion string `json:"operator"` - Matrix matrix `json:"matrix"` -} - -// VersionServiceResponse represents response from version service API. -type VersionServiceResponse struct { - Versions []Version `json:"versions"` -} - -// componentsParams contains params to filter components in version service API. -type componentsParams struct { - product string - productVersion string - dbVersion string -} - -// cache isn't supposed to be big, so we don't clear it. -type versionResponseCache struct { - updateTime time.Time - response VersionServiceResponse -} - -// VersionServiceClient represents a client for Version Service API. -type VersionServiceClient struct { - url string - http *http.Client - irtm prom.Collector - cacheLock sync.Mutex - cache map[string]versionResponseCache - l *logrus.Entry -} - -// NewVersionServiceClient creates a new client for given version service URL. -func NewVersionServiceClient(url string) *VersionServiceClient { - var t http.RoundTripper = &http.Transport{ - DialContext: (&net.Dialer{ - Timeout: 3 * time.Second, - KeepAlive: 30 * time.Second, - }).DialContext, - MaxIdleConns: 50, - IdleConnTimeout: 90 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - } - - if logrus.GetLevel() >= logrus.TraceLevel { - t = irt.WithLogger(t, logrus.WithField("component", "versionService/client").Tracef) - } - t, irtm := irt.WithMetrics(t, "versionService_client") - - return &VersionServiceClient{ - url: url, - http: &http.Client{ - Transport: t, - }, - irtm: irtm, - cache: make(map[string]versionResponseCache), - l: logrus.WithField("component", "VersionServiceClient"), - } -} - -// Describe implements prometheus.Collector. -func (c *VersionServiceClient) Describe(ch chan<- *prom.Desc) { - c.irtm.Describe(ch) -} - -// Collect implements prometheus.Collector. -func (c *VersionServiceClient) Collect(ch chan<- prom.Metric) { - c.irtm.Collect(ch) -} - -// Matrix calls version service with given params and returns components matrix. -func (c *VersionServiceClient) Matrix(ctx context.Context, params componentsParams) (*VersionServiceResponse, error) { - paths := []string{c.url, params.product} - if params.productVersion != "" { - paths = append(paths, params.productVersion) - if params.dbVersion != "" { - paths = append(paths, params.dbVersion) - } - } - fullURL := strings.Join(paths, "/") - c.cacheLock.Lock() - defer c.cacheLock.Unlock() - if val, ok := c.cache[fullURL]; ok && val.updateTime.After(time.Now().Add(-30*time.Minute)) { - c.l.Debugf("cache for %s is used", fullURL) - return &val.response, nil - } - req, err := http.NewRequestWithContext(ctx, http.MethodGet, fullURL, nil) - if err != nil { - return nil, err - } - resp, err := c.http.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() //nolint:gosec - body, err := io.ReadAll(resp.Body) - if err != nil { - return nil, err - } - - var vsResponse VersionServiceResponse - err = json.Unmarshal(body, &vsResponse) - if err != nil { - return nil, err - } - c.cache[fullURL] = versionResponseCache{ - updateTime: time.Now(), - response: vsResponse, - } - - return &vsResponse, nil -} - -// IsDatabaseVersionSupportedByOperator returns false and err when request to version service fails. Otherwise returns boolean telling -// if given database version is supported by given operator version, error is nil in that case. -func (c *VersionServiceClient) IsDatabaseVersionSupportedByOperator(ctx context.Context, operatorType, operatorVersion, databaseVersion string) (bool, error) { - m, err := c.Matrix(ctx, componentsParams{ - product: operatorType, - productVersion: operatorVersion, - dbVersion: databaseVersion, - }) - if err != nil { - return false, err - } - return len(m.Versions) != 0, nil -} - -// SupportedOperatorVersionsList returns list of operators versions supported by certain PMM version. -func (c *VersionServiceClient) SupportedOperatorVersionsList(ctx context.Context, pmmVersion string) (map[string][]string, error) { - pmm, err := goversion.NewVersion(pmmVersion) - if err != nil { - return nil, err - } - - resp, err := c.Matrix(ctx, componentsParams{product: "pmm-server", productVersion: pmm.Core().String()}) - if err != nil { - return nil, err - } - - if len(resp.Versions) == 0 { - return make(map[string][]string), nil - } - - operatorVersions := map[string][]string{ - pxcOperator: {}, - psmdbOperator: {}, - } - - for v := range resp.Versions[0].Matrix.PXCOperator { - operatorVersions[pxcOperator] = append(operatorVersions[pxcOperator], v) - } - - for v := range resp.Versions[0].Matrix.PSMDBOperator { - operatorVersions[psmdbOperator] = append(operatorVersions[psmdbOperator], v) - } - return operatorVersions, nil -} - -func latestRecommended(m map[string]componentVersion) (*goversion.Version, error) { - if len(m) == 0 { - return nil, errNoVersionsFound - } - latest := goversion.Must(goversion.NewVersion("0.0.0")) - for version, component := range m { - parsedVersion, err := goversion.NewVersion(version) - if err != nil { - return nil, err - } - if parsedVersion.GreaterThan(latest) && component.Status == "recommended" { - latest = parsedVersion - } - } - return latest, nil -} - -// LatestOperatorVersion return latest recommended PXC and PSMDB operators for given PMM version. -func (c *VersionServiceClient) LatestOperatorVersion(ctx context.Context, pmmVersion string) (*goversion.Version, *goversion.Version, error) { - if pmmVersion == "" { - return nil, nil, errors.New("given PMM version is empty") - } - params := componentsParams{ - product: "pmm-server", - productVersion: pmmVersion, - } - resp, err := c.Matrix(ctx, params) - if err != nil { - return nil, nil, err - } - if len(resp.Versions) != 1 { - return nil, nil, nil // no deps for the PMM version passed to c.Matrix - } - pmmVersionDeps := resp.Versions[0] - latestPSMDBOperator, err := latestRecommended(pmmVersionDeps.Matrix.PSMDBOperator) - if err != nil { - return nil, nil, err - } - latestPXCOperator, err := latestRecommended(pmmVersionDeps.Matrix.PXCOperator) - return latestPXCOperator, latestPSMDBOperator, err -} - -// GetNextDatabaseImage returns image of the version that is a direct successor of currently installed version. -// It returns empty string if update is not available or error occurred. -func (c *VersionServiceClient) GetNextDatabaseImage(ctx context.Context, operatorType, operatorVersion, installedDBVersion string) (string, error) { - // Get dependencies of operator type at given version. - params := componentsParams{ - product: operatorType, - productVersion: operatorVersion, - } - matrix, err := c.Matrix(ctx, params) - if err != nil { - return "", err - } - if len(matrix.Versions) != 1 { - return "", nil - } - operatorDependencies := matrix.Versions[0] - - // Choose proper versions map. - var versions map[string]componentVersion - switch operatorType { - case psmdbOperator: - versions = operatorDependencies.Matrix.Mongod - case pxcOperator: - versions = operatorDependencies.Matrix.Pxc - default: - return "", errors.Errorf("%q operator not supported", operatorType) - } - - // Convert slice of version structs to slice of strings so it can be used in generic function next. - stringVersions := make([]string, 0, len(versions)) - for version := range versions { - stringVersions = append(stringVersions, version) - } - - // Get direct successor of installed version. - nextVersion, err := next(stringVersions, installedDBVersion) - if err != nil { - return "", err - } - if nextVersion == nil { - return "", nil - } - return versions[nextVersion.String()].ImagePath, nil -} - -// GetVersionServiceURL returns base URL for version service currently used -func (c *VersionServiceClient) GetVersionServiceURL() string { - url, err := url.Parse(c.url) - if err != nil { - c.l.Warnf("failed to parse url %q: %v", c.url, err) - return c.url - } - return url.Scheme + "://" + url.Host -} - -// NextOperatorVersion returns operator version that is direct successor of currently installed one. -// It returns nil if update is not available or error occurred. It does not take PMM version into consideration. -// We need to upgrade to current + 1 version for upgrade to be successful. So even if dbaas-controller does not support the -// operator, we need to upgrade to it on our way to supported one. -func (c *VersionServiceClient) NextOperatorVersion( - ctx context.Context, - operatorType, - installedVersion string, -) (*goversion.Version, error) { - if installedVersion == "" { - return nil, nil //nolint:nilnil - } - // Get all operator versions - params := componentsParams{ - product: operatorType, - } - matrix, err := c.Matrix(ctx, params) - if err != nil { - return nil, err - } - if len(matrix.Versions) == 0 { - return nil, nil //nolint:nilnil - } - - // Convert slice of version structs to slice of strings so it can be used in generic function next. - versions := make([]string, 0, len(matrix.Versions)) - for _, version := range matrix.Versions { - versions = append(versions, version.ProductVersion) - } - - // Find next versions if installed. - if installedVersion != "" { - return next(versions, installedVersion) - } - return nil, nil //nolint:nilnil -} - -// next direct successor of given installed version, returns nil if there is none. -// An error is returned if any of given version can't be parsed. It's nil otherwise. -func next(versions []string, installedVersion string) (*goversion.Version, error) { - if len(versions) == 0 { - return nil, errNoVersionsFound - } - // Get versions greater than currently installed one. - var nextVersion *goversion.Version - installed, err := goversion.NewVersion(installedVersion) - if err != nil { - return nil, err - } - - for _, version := range versions { - v, err := goversion.NewVersion(version) - if err != nil { - return nil, err - } - if v.GreaterThan(installed) && (nextVersion == nil || nextVersion.GreaterThan(v)) { - nextVersion = v - } - } - - return nextVersion, nil -} diff --git a/managed/services/management/dbaas/version_service_client_test.go b/managed/services/management/dbaas/version_service_client_test.go deleted file mode 100644 index fed2e3037e..0000000000 --- a/managed/services/management/dbaas/version_service_client_test.go +++ /dev/null @@ -1,326 +0,0 @@ -// Copyright (C) 2023 Percona LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package dbaas - -import ( - "context" - "encoding/json" - "log" - "net" - "net/http" - "strings" - "testing" - "time" - - goversion "github.com/hashicorp/go-version" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestVersionServiceClient(t *testing.T) { - c := NewVersionServiceClient(versionServiceURL) - - for _, tt := range []struct { - params componentsParams - }{ - {params: componentsParams{product: psmdbOperator}}, - {params: componentsParams{product: psmdbOperator, productVersion: onePointSix}}, - {params: componentsParams{product: psmdbOperator, productVersion: onePointSeven, dbVersion: "4.2.8-8"}}, - {params: componentsParams{product: pxcOperator}}, - {params: componentsParams{product: pxcOperator, productVersion: onePointSeven}}, - {params: componentsParams{product: pxcOperator, productVersion: onePointSeven, dbVersion: "8.0.20-11.2"}}, - } { - t.Run("NotEmptyMatrix", func(t *testing.T) { - response, err := c.Matrix(context.TODO(), tt.params) - require.NoError(t, err) - require.NotEmpty(t, response.Versions) - for _, v := range response.Versions { - switch tt.params.product { - case psmdbOperator: - assert.NotEmpty(t, v.Matrix.Mongod) - case pxcOperator: - assert.NotEmpty(t, v.Matrix.Pxc) - assert.NotEmpty(t, v.Matrix.Proxysql) - } - assert.NotEmpty(t, v.Matrix.Backup) - } - }) - } -} - -type fakeLatestVersionServer struct { - response *VersionServiceResponse - components []string -} - -func (f fakeLatestVersionServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { - encoder := json.NewEncoder(w) - var response *VersionServiceResponse - var certainVersionRequested bool - var component string - for _, c := range f.components { - if strings.Contains(r.URL.Path, c) { - component = c - certainVersionRequested = strings.Contains(r.URL.Path, component+"/") - break - } - } - - switch { - case certainVersionRequested: - segments := strings.Split(r.URL.Path, "/") - version := segments[len(segments)-2] - var dbVersion string - // handle product/version/applyversion - if _, err := goversion.NewVersion(version); err == nil { - dbVersion = segments[len(segments)-1] - } else { - version = segments[len(segments)-1] - } - for _, v := range f.response.Versions { - if v.ProductVersion == version && v.Product == component { - if dbVersion != "" { - var database map[string]componentVersion - switch component { - case pxcOperator: - database = v.Matrix.Pxc - case psmdbOperator: - database = v.Matrix.Mongod - default: - panic(component + " not supported") - } - if _, ok := database[dbVersion]; !ok { - response = nil - break - } - } - response = &VersionServiceResponse{ - Versions: []Version{v}, - } - break - } - } - case component != "": - response = &VersionServiceResponse{} - for _, v := range f.response.Versions { - if v.Product == component { - response.Versions = append(response.Versions, v) - } - } - default: - panic("path " + r.URL.Path + " not expected") - } - - err := encoder.Encode(response) - if err != nil { - log.Fatal(err) - } -} - -// newFakeVersionService creates new fake version service on given port. -// It returns values based on given response but only for specified components. -func newFakeVersionService(response *VersionServiceResponse, port string, components ...string) (versionService, func(*testing.T)) { - if len(components) == 0 { - panic("failed to create fake version service, at least one component has to be given, none received") - } - var httpServer *http.Server - waitForListener := make(chan struct{}) - server := fakeLatestVersionServer{ - response: response, - components: components, - } - fakeHostAndPort := "localhost:" + port - go func() { - httpServer = &http.Server{Addr: fakeHostAndPort, Handler: server} //nolint:gosec - listener, err := net.Listen("tcp", fakeHostAndPort) - if err != nil { - log.Fatal(err) - } - close(waitForListener) - _ = httpServer.Serve(listener) - }() - <-waitForListener - - return NewVersionServiceClient("http://" + fakeHostAndPort + "/versions/v1"), func(t *testing.T) { - t.Helper() - assert.NoError(t, httpServer.Shutdown(context.TODO())) - } -} - -func TestOperatorVersionGetting(t *testing.T) { - t.Parallel() - t.Run("Invalid url", func(t *testing.T) { - t.Parallel() - c := NewVersionServiceClient("wrongschema://check.percona.com/versions/invalid") - ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) - defer cancel() - pxcOperatorVersion, psmdbOperatorVersion, err := c.LatestOperatorVersion(ctx, "2.19") - assert.Error(t, err, "err is expected") - assert.Nil(t, pxcOperatorVersion) - assert.Nil(t, psmdbOperatorVersion) - }) - response := &VersionServiceResponse{ - Versions: []Version{ - { - ProductVersion: onePointSix, - Product: pxcOperator, - }, - { - ProductVersion: onePointSeven, - Product: pxcOperator, - }, - { - ProductVersion: onePointEight, - Product: pxcOperator, - }, - - { - ProductVersion: onePointSix, - Product: psmdbOperator, - }, - { - ProductVersion: onePointSeven, - Product: psmdbOperator, - }, - { - ProductVersion: onePointEight, - Product: psmdbOperator, - }, - - { - ProductVersion: twoPointEighteen, - Product: "pmm-server", - Matrix: matrix{ - PXCOperator: map[string]componentVersion{ - onePointEight: {Status: "recommended"}, - onePointSeven: {}, - }, - PSMDBOperator: map[string]componentVersion{ - onePointTen: {Status: "available"}, - onePointNine: {Status: "recommended"}, - onePointEight: {}, - onePointSeven: {}, - }, - }, - }, - }, - } - c, cleanup := newFakeVersionService(response, "5897", "pmm-server", psmdbOperator, pxcOperator) - t.Cleanup(func() { cleanup(t) }) - t.Run("Get latest", func(t *testing.T) { - t.Parallel() - ctx := context.Background() - pxcOperatorVersion, psmdbOperatorVersion, err := c.LatestOperatorVersion(ctx, twoPointEighteen) - require.NoError(t, err, "request to fakeserver for latest version should not fail") - assert.Equal(t, onePointEight, pxcOperatorVersion.String()) - assert.Equal(t, onePointNine, psmdbOperatorVersion.String()) - }) - t.Run("Get latest, PMM version unknown by version service", func(t *testing.T) { - t.Parallel() - ctx := context.Background() - pxcOperatorVersion, psmdbOperatorVersion, err := c.LatestOperatorVersion(ctx, "2.2200.0") - require.NoError(t, err, "request to fakeserver for latest version should not fail") - assert.Nil(t, pxcOperatorVersion) - assert.Nil(t, psmdbOperatorVersion) - }) - t.Run("Get next, update not available", func(t *testing.T) { - t.Parallel() - ctx := context.Background() - pxcOperatorVersion, err := c.NextOperatorVersion(ctx, pxcOperator, onePointEight) - require.NoError(t, err, "request to fakeserver for latest version should not fail") - psmdbOperatorVersion, err := c.NextOperatorVersion(ctx, psmdbOperator, onePointEight) - require.NoError(t, err, "request to fakeserver for latest version should not fail") - assert.Nil(t, pxcOperatorVersion) - assert.Nil(t, psmdbOperatorVersion) - }) - t.Run("Get next, update available", func(t *testing.T) { - t.Parallel() - ctx := context.Background() - pxcOperatorVersion, err := c.NextOperatorVersion(ctx, pxcOperator, onePointSix) - require.NoError(t, err, "request to fakeserver for latest version should not fail") - psmdbOperatorVersion, err := c.NextOperatorVersion(ctx, psmdbOperator, onePointSeven) - require.NoError(t, err, "request to fakeserver for latest version should not fail") - assert.Equal(t, onePointSeven, pxcOperatorVersion.String()) - assert.Equal(t, onePointEight, psmdbOperatorVersion.String()) - }) -} - -const ( - pxcImage = "percona/percona-xtradb-cluster" - psmdbImage = "percona/percona-server-mongodb" -) - -func TestGetNextDatabaseVersion(t *testing.T) { //nolint:tparallel - ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*100) - response := &VersionServiceResponse{ - Versions: []Version{ - { - ProductVersion: "1.8.0", - Product: pxcOperator, - Matrix: matrix{ - Pxc: map[string]componentVersion{ - "5.7.26-31.37": {ImagePath: pxcImage + ":5.7.26-31.37"}, - "5.7.29-31.43": {ImagePath: pxcImage + ":5.7.29-31.43"}, - "5.7.31-31.45.2": {ImagePath: pxcImage + ":5.7.31-31.45.2"}, - }, - }, - }, - { - ProductVersion: "1.8.0", - Product: psmdbOperator, - Matrix: matrix{ - Mongod: map[string]componentVersion{ - "3.6.19-7.0": {ImagePath: psmdbImage + ":3.6.19-7.0"}, - "3.6.18-5.0": {ImagePath: psmdbImage + ":3.6.18-5.0"}, - "3.6.23-13.0": {ImagePath: psmdbImage + ":3.6.23-13.0"}, - }, - }, - }, - }, - } - c, cleanup := newFakeVersionService(response, "5899", pxcOperator, psmdbOperator) - t.Cleanup(func() { cleanup(t); cancel() }) - t.Run("Update available", func(t *testing.T) { - t.Parallel() - nextVersionImage, err := c.GetNextDatabaseImage(ctx, pxcOperator, "1.8.0", "5.7.26-31.37") - require.NoError(t, err) - assert.Equal(t, pxcImage+":5.7.29-31.43", nextVersionImage) - - nextVersionImage, err = c.GetNextDatabaseImage(ctx, psmdbOperator, "1.8.0", "3.6.19-7.0") - require.NoError(t, err) - assert.Equal(t, psmdbImage+":3.6.23-13.0", nextVersionImage) - - // older than supported version of database - nextVersionImage, err = c.GetNextDatabaseImage(ctx, pxcOperator, "1.8.0", "5.0.0") - require.NoError(t, err) - assert.Equal(t, pxcImage+":5.7.26-31.37", nextVersionImage) - }) - t.Run("Update not available", func(t *testing.T) { - t.Parallel() - nextVersionImage, err := c.GetNextDatabaseImage(ctx, pxcOperator, "1.8.0", "5.7.31-31.45.2") - require.NoError(t, err) - assert.Equal(t, "", nextVersionImage) - - nextVersionImage, err = c.GetNextDatabaseImage(ctx, psmdbOperator, "1.8.0", "3.6.23-13.0") - require.NoError(t, err) - assert.Equal(t, "", nextVersionImage) - - // more up to date than is supported - nextVersionImage, err = c.GetNextDatabaseImage(ctx, psmdbOperator, "1.8.0", "4.0.0") - require.NoError(t, err) - assert.Equal(t, "", nextVersionImage) - }) -} diff --git a/managed/services/server/server.go b/managed/services/server/server.go index 84c8d67ae1..f4747a7902 100644 --- a/managed/services/server/server.go +++ b/managed/services/server/server.go @@ -62,7 +62,6 @@ type Server struct { awsInstanceChecker *AWSInstanceChecker grafanaClient grafanaClient rulesService rulesService - dbaasInitializer dbaasInitializer emailer emailer l *logrus.Entry @@ -78,11 +77,6 @@ type Server struct { serverpb.UnimplementedServerServer } -type dbaasInitializer interface { - Enable(ctx context.Context) error - Disable(ctx context.Context) error -} - type pmmUpdateAuth struct { AuthToken string `json:"auth_token"` } @@ -102,7 +96,6 @@ type Params struct { AwsInstanceChecker *AWSInstanceChecker GrafanaClient grafanaClient RulesService rulesService - DBaaSInitializer dbaasInitializer Emailer emailer } @@ -128,7 +121,6 @@ func NewServer(params *Params) (*Server, error) { awsInstanceChecker: params.AwsInstanceChecker, grafanaClient: params.GrafanaClient, rulesService: params.RulesService, - dbaasInitializer: params.DBaaSInitializer, emailer: params.Emailer, l: logrus.WithField("component", "server"), pmmUpdateAuthFile: path, @@ -445,7 +437,6 @@ func (s *Server) convertSettings(settings *models.Settings, connectedToPlatform AwsPartitions: settings.AWSPartitions, AlertManagerUrl: settings.AlertManagerURL, SttEnabled: !settings.SaaS.STTDisabled, - DbaasEnabled: settings.DBaaS.Enabled, AzurediscoverEnabled: settings.Azurediscover.Enabled, PmmPublicAddress: settings.PMMPublicAddress, @@ -547,11 +538,6 @@ func (s *Server) validateChangeSettingsRequest(ctx context.Context, req *serverp return status.Error(codes.FailedPrecondition, "Azure Discover is enabled via ENABLE_AZUREDISCOVER environment variable.") } - // ignore req.DisableDbaas when DBaaS is enabled through env var. - if req.DisableDbaas && s.envSettings.EnableDBaaS { - return status.Error(codes.FailedPrecondition, "DBaaS is enabled via ENABLE_DBAAS or via deprecated PERCONA_TEST_DBAAS environment variable.") - } - if !canUpdateDurationSetting(metricsRes.GetHr().AsDuration(), s.envSettings.MetricsResolutions.HR) { return status.Error(codes.FailedPrecondition, "High resolution for metrics is set via METRICS_RESOLUTION_HR (or METRICS_RESOLUTION) environment variable.") } @@ -623,9 +609,6 @@ func (s *Server) ChangeSettings(ctx context.Context, req *serverpb.ChangeSetting EnableBackupManagement: req.EnableBackupManagement, DisableBackupManagement: req.DisableBackupManagement, - EnableDBaaS: req.EnableDbaas, - DisableDBaaS: req.DisableDbaas, - EnableAccessControl: req.EnableAccessControl, DisableAccessControl: req.DisableAccessControl, } @@ -732,22 +715,6 @@ func (s *Server) ChangeSettings(ctx context.Context, req *serverpb.ChangeSetting } } - // When DBaaS is enabled, connect to the dbaas-controller API. - if !oldSettings.DBaaS.Enabled && newSettings.DBaaS.Enabled { - err := s.dbaasInitializer.Enable(ctx) - if err != nil { - return nil, err - } - } - - // When DBaaS is disabled, disconnect from the dbaas-controller API. - if oldSettings.DBaaS.Enabled && !newSettings.DBaaS.Enabled { - err := s.dbaasInitializer.Disable(ctx) - if err != nil { - return nil, err - } - } - if isAgentsStateUpdateNeeded(req.MetricsResolutions) { if err := s.agentsState.UpdateAgentsState(ctx); err != nil { return nil, err diff --git a/managed/services/server/server_test.go b/managed/services/server/server_test.go index 0ffec40532..24c784b1e5 100644 --- a/managed/services/server/server_test.go +++ b/managed/services/server/server_test.go @@ -234,7 +234,6 @@ func TestServer(t *testing.T) { server := newServer(t) server.UpdateSettingsFromEnv([]string{ - "ENABLE_DBAAS=1", "ENABLE_ALERTING=1", "ENABLE_AZUREDISCOVER=1", }) @@ -250,7 +249,6 @@ func TestServer(t *testing.T) { settings, err := server.GetSettings(ctx, &serverpb.GetSettingsRequest{}) require.NoError(t, err) - assert.True(t, settings.Settings.DbaasEnabled) assert.True(t, settings.Settings.AlertingEnabled) assert.True(t, settings.Settings.AzurediscoverEnabled) }) diff --git a/managed/services/supervisord/logs_test.go b/managed/services/supervisord/logs_test.go index ebdf0f78f6..d1805e8a68 100644 --- a/managed/services/supervisord/logs_test.go +++ b/managed/services/supervisord/logs_test.go @@ -171,10 +171,6 @@ func TestFiles(t *testing.T) { continue } - if f.Name == "dbaas-controller.log" { - continue - } - if f.Name == "supervisorctl_status.log" { // FIXME: this fails following the transition to EL9 continue @@ -214,9 +210,6 @@ func TestZip(t *testing.T) { "systemctl_status.log", "prometheus.base.yml", } - if os.Getenv("ENABLE_DBAAS") == "1" { - additionalFiles = append(additionalFiles, "dbaas-controller.log") - } // zip file includes client files expected := append(commonExpectedFiles, additionalFiles...) //nolint:gocritic diff --git a/managed/services/supervisord/supervisord.go b/managed/services/supervisord/supervisord.go index 79335b5b77..1dced16711 100644 --- a/managed/services/supervisord/supervisord.go +++ b/managed/services/supervisord/supervisord.go @@ -425,7 +425,6 @@ func (s *Service) marshalConfig(tmpl *template.Template, settings *models.Settin "VMDBCacheDisable": !settings.VictoriaMetrics.CacheEnabled, "VMURL": s.vmParams.URL(), "ExternalVM": s.vmParams.ExternalVM(), - "PerconaTestDbaas": settings.DBaaS.Enabled, "InterfaceToBind": envvars.GetInterfaceToBind(), "ClickhouseAddr": clickhouseAddr, "ClickhouseDataSourceAddr": clickhouseDataSourceAddr, @@ -609,22 +608,6 @@ func (s *Service) RestartSupervisedService(serviceName string) error { //nolint:lll var templates = template.Must(template.New("").Option("missingkey=error").Parse(` -{{define "dbaas-controller"}} -[program:dbaas-controller] -priority = 6 -command = /usr/sbin/dbaas-controller -user = pmm -autorestart = {{ .PerconaTestDbaas }} -autostart = {{ .PerconaTestDbaas }} -startretries = 10 -startsecs = 1 -stopsignal = TERM -stopwaitsecs = 300 -stdout_logfile = /srv/logs/dbaas-controller.log -stdout_logfile_maxbytes = 10MB -stdout_logfile_backups = 3 -redirect_stderr = true -{{end}} {{define "prometheus"}} [program:prometheus] diff --git a/managed/services/supervisord/supervisord_test.go b/managed/services/supervisord/supervisord_test.go index 6676406f39..8092666727 100644 --- a/managed/services/supervisord/supervisord_test.go +++ b/managed/services/supervisord/supervisord_test.go @@ -19,7 +19,6 @@ import ( "os" "path/filepath" "testing" - "text/template" "time" "github.com/AlekSi/pointer" @@ -47,10 +46,9 @@ func TestConfig(t *testing.T) { for _, tmpl := range templates.Templates() { n := tmpl.Name() - if n == "" || n == "dbaas-controller" { + if n == "" { continue } - tmpl := tmpl t.Run(tmpl.Name(), func(t *testing.T) { t.Parallel() @@ -63,54 +61,6 @@ func TestConfig(t *testing.T) { } } -func TestDBaaSController(t *testing.T) { - t.Parallel() - gRPCMessageMaxSize := uint32(100 * 1024 * 1024) - - pmmUpdateCheck := NewPMMUpdateChecker(logrus.WithField("component", "supervisord/pmm-update-checker_logs")) - configDir := filepath.Join("..", "..", "testdata", "supervisord.d") - vmParams, err := models.NewVictoriaMetricsParams(models.BasePrometheusConfigPath, models.VMBaseURL) - require.NoError(t, err) - s := New(configDir, pmmUpdateCheck, vmParams, models.PGParams{}, gRPCMessageMaxSize) - - var tp *template.Template - for _, tmpl := range templates.Templates() { - if tmpl.Name() == "dbaas-controller" { - tp = tmpl - break - } - } - - tests := []struct { - Enabled bool - File string - }{ - { - Enabled: true, - File: "dbaas-controller_enabled", - }, - { - Enabled: false, - File: "dbaas-controller_disabled", - }, - } - for _, test := range tests { - st := models.Settings{ - DBaaS: struct { - Enabled bool `json:"enabled"` - }{ - Enabled: test.Enabled, - }, - } - - expected, err := os.ReadFile(filepath.Join(configDir, test.File+".ini")) //nolint:gosec - require.NoError(t, err) - actual, err := s.marshalConfig(tp, &st, nil) - require.NoError(t, err) - assert.Equal(t, string(expected), string(actual)) - } -} - func TestParseStatus(t *testing.T) { t.Parallel() diff --git a/managed/services/telemetry/config.default.yml b/managed/services/telemetry/config.default.yml index 74924104e0..9c49134f0d 100644 --- a/managed/services/telemetry/config.default.yml +++ b/managed/services/telemetry/config.default.yml @@ -56,15 +56,6 @@ telemetry: - metric_name: "pmm_server_alert_manager_enabled" column: "alert_manager_set" - - - id: PMMServerDBaaSEnabled - source: PMMDB_SELECT - query: (CASE WHEN dbaas->'enabled' = 'true' THEN '1' ELSE '0' END) AS dbaas_enabled FROM settings s, jsonb_extract_path(s.settings, 'dbaas') AS dbaas - summary: "PMM Server DBaaS feature enabled/disabled" - data: - - metric_name: "pmm_server_dbaas_enabled" - column: "dbaas_enabled" - - id: PMMServerAccessControlEnabled source: PMMDB_SELECT query: (CASE WHEN access_control->'enabled' = 'true' THEN '1' ELSE '0' END) AS access_control_enabled FROM settings s, jsonb_extract_path(s.settings, 'access_control') AS access_control @@ -666,32 +657,6 @@ telemetry: - metric_name: "pmm_server_node_os_pretty_name_and_version" label: "pretty_name" - # DBaaS - - id: DBaaSServicesCount - source: PMMDB_SELECT - query: count(service_name) AS count from services where service_name ~ concat('default-', cluster,'-(pxc|rs0)-\d+') - summary: "DBaaS Services Count" - data: - - metric_name: "dbaas_services_count" - column: "count" - - - id: DBaaSClustersCount - source: PMMDB_SELECT - query: count(distinct cluster) AS count from services where service_name ~ concat('default-', cluster,'-(pxc|rs0)-\d+') - summary: "DBaaS Clusters Count" - data: - - metric_name: "dbaas_clusters_count" - column: "count" - - # K8s Clusters - - id: K8sClustersCount - source: PMMDB_SELECT - query: count(*) AS count FROM kubernetes_clusters - summary: "K8s Clusters Count" - data: - - metric_name: "k8s_clusters_count" - column: "count" - # Advisor - id: AdvisorChecksAvailable source: VM @@ -870,31 +835,31 @@ telemetry: j.job_status bm_job_status, coalesce(bl_backup.type, bl_restore.type, 'N/A') bm_location_type, count(*) count - from (select type, - "data"->"type"->>'mode' mod, - "data"->"type"->>'data_model' dm, + from (select type, + "data"->"type"->>'mode' mod, + "data"->"type"->>'data_model' dm, "data"->"type"->>'artifact_id' artifact_id, "data"->"type"->>'restore_id' restore_id, case error when '' then 'success' else 'failed' end job_status - from jobs - where created_at BETWEEN NOW() - INTERVAL '24 HOURS' AND NOW() + from jobs + where created_at BETWEEN NOW() - INTERVAL '24 HOURS' AND NOW() group by type, mod, dm, artifact_id, restore_id, job_status) j left join artifacts a_backup on a_backup.id = j.artifact_id left join backup_locations bl_backup - on bl_backup.id = a_backup.location_id + on bl_backup.id = a_backup.location_id left join restore_history rh on rh.id = j.restore_id left join artifacts a_restore on a_restore.id = rh.artifact_id left join backup_locations bl_restore on bl_restore.id = a_restore.location_id - group by - bm_job_type, - bm_backup_mode, - bm_data_model, - bm_job_run_type, - bm_job_status, + group by + bm_job_type, + bm_backup_mode, + bm_data_model, + bm_job_run_type, + bm_job_status, bm_location_type transform: type: JSON diff --git a/managed/services/victoriametrics/prometheus.go b/managed/services/victoriametrics/prometheus.go index 717868763f..2999efd2c9 100644 --- a/managed/services/victoriametrics/prometheus.go +++ b/managed/services/victoriametrics/prometheus.go @@ -204,14 +204,10 @@ func AddScrapeConfigs(l *logrus.Entry, cfg *config.Config, q *reform.Querier, s } // AddInternalServicesToScrape adds internal services metrics to scrape targets. -func AddInternalServicesToScrape(cfg *config.Config, s models.MetricsResolutions, dbaas bool) { +func AddInternalServicesToScrape(cfg *config.Config, s models.MetricsResolutions) { cfg.ScrapeConfigs = append(cfg.ScrapeConfigs, scrapeConfigForAlertmanager(s.MR), scrapeConfigForGrafana(s.MR), scrapeConfigForPMMManaged(s.MR), scrapeConfigForQANAPI2(s.MR)) - // TODO Refactor to remove boolean positional parameter when Prometheus is removed - if dbaas { - cfg.ScrapeConfigs = append(cfg.ScrapeConfigs, scrapeConfigForDBaaSController(s.MR)) - } } diff --git a/managed/services/victoriametrics/scrape_configs.go b/managed/services/victoriametrics/scrape_configs.go index e47df63673..e9ac99b09f 100644 --- a/managed/services/victoriametrics/scrape_configs.go +++ b/managed/services/victoriametrics/scrape_configs.go @@ -107,21 +107,6 @@ func scrapeConfigForQANAPI2(interval time.Duration) *config.ScrapeConfig { } } -func scrapeConfigForDBaaSController(interval time.Duration) *config.ScrapeConfig { - return &config.ScrapeConfig{ - JobName: "dbaas-controller", - ScrapeInterval: config.Duration(interval), - ScrapeTimeout: scrapeTimeout(interval), - MetricsPath: "/debug/metrics", - ServiceDiscoveryConfig: config.ServiceDiscoveryConfig{ - StaticConfigs: []*config.Group{{ - Targets: []string{"127.0.0.1:20203"}, - Labels: map[string]string{"instance": "pmm-server"}, - }}, - }, - } -} - func mergeLabels(node *models.Node, service *models.Service, agent *models.Agent) (map[string]string, error) { res, err := models.MergeLabels(node, service, agent) if err != nil { diff --git a/managed/services/victoriametrics/victoriametrics.go b/managed/services/victoriametrics/victoriametrics.go index 746e3008d7..8cef7cf9bc 100644 --- a/managed/services/victoriametrics/victoriametrics.go +++ b/managed/services/victoriametrics/victoriametrics.go @@ -338,7 +338,7 @@ func (svc *Service) populateConfig(cfg *config.Config) error { cfg.ScrapeConfigs = append(cfg.ScrapeConfigs, scrapeConfigForInternalVMAgent(s.HR, svc.baseURL.Host)) } cfg.ScrapeConfigs = append(cfg.ScrapeConfigs, scrapeConfigForVMAlert(s.HR)) - AddInternalServicesToScrape(cfg, s, settings.DBaaS.Enabled) + AddInternalServicesToScrape(cfg, s) return AddScrapeConfigs(svc.l, cfg, tx.Querier, &s, nil, false) }) } diff --git a/managed/testdata/supervisord.d/dbaas-controller_disabled.ini b/managed/testdata/supervisord.d/dbaas-controller_disabled.ini deleted file mode 100644 index 49e1216a58..0000000000 --- a/managed/testdata/supervisord.d/dbaas-controller_disabled.ini +++ /dev/null @@ -1,16 +0,0 @@ -; Managed by pmm-managed. DO NOT EDIT. - -[program:dbaas-controller] -priority = 6 -command = /usr/sbin/dbaas-controller -user = pmm -autorestart = false -autostart = false -startretries = 10 -startsecs = 1 -stopsignal = TERM -stopwaitsecs = 300 -stdout_logfile = /srv/logs/dbaas-controller.log -stdout_logfile_maxbytes = 10MB -stdout_logfile_backups = 3 -redirect_stderr = true diff --git a/managed/testdata/supervisord.d/dbaas-controller_enabled.ini b/managed/testdata/supervisord.d/dbaas-controller_enabled.ini deleted file mode 100644 index a2d8f7d51f..0000000000 --- a/managed/testdata/supervisord.d/dbaas-controller_enabled.ini +++ /dev/null @@ -1,16 +0,0 @@ -; Managed by pmm-managed. DO NOT EDIT. - -[program:dbaas-controller] -priority = 6 -command = /usr/sbin/dbaas-controller -user = pmm -autorestart = true -autostart = true -startretries = 10 -startsecs = 1 -stopsignal = TERM -stopwaitsecs = 300 -stdout_logfile = /srv/logs/dbaas-controller.log -stdout_logfile_maxbytes = 10MB -stdout_logfile_backups = 3 -redirect_stderr = true diff --git a/managed/utils/envvars/parser.go b/managed/utils/envvars/parser.go index 3412e95f23..49bf15613e 100644 --- a/managed/utils/envvars/parser.go +++ b/managed/utils/envvars/parser.go @@ -31,14 +31,11 @@ import ( ) const ( - defaultPlatformAddress = "https://check.percona.com" - envPlatformAddress = "PERCONA_TEST_PLATFORM_ADDRESS" - envPlatformInsecure = "PERCONA_TEST_PLATFORM_INSECURE" - envPlatformPublicKey = "PERCONA_TEST_PLATFORM_PUBLIC_KEY" - evnInterfaceToBind = "PERCONA_TEST_INTERFACE_TO_BIND" - // TODO REMOVE PERCONA_TEST_DBAAS IN FUTURE RELEASES. - envTestDbaas = "PERCONA_TEST_DBAAS" - envEnableDbaas = "ENABLE_DBAAS" + defaultPlatformAddress = "https://check.percona.com" + envPlatformAddress = "PERCONA_TEST_PLATFORM_ADDRESS" + envPlatformInsecure = "PERCONA_TEST_PLATFORM_INSECURE" + envPlatformPublicKey = "PERCONA_TEST_PLATFORM_PUBLIC_KEY" + evnInterfaceToBind = "PERCONA_TEST_INTERFACE_TO_BIND" envEnableAccessControl = "ENABLE_RBAC" envPlatformAPITimeout = "PERCONA_PLATFORM_API_TIMEOUT" defaultPlatformAPITimeout = 30 * time.Second @@ -64,7 +61,6 @@ func (e InvalidDurationError) Error() string { return string(e) } // - DATA_RETENTION is the duration of how long keep time-series data in ClickHouse; // - ENABLE_ALERTING enables Integrated Alerting; // - ENABLE_AZUREDISCOVER enables Azure Discover; -// - ENABLE_DBAAS enables Database as a Service feature, it's a replacement for deprecated PERCONA_TEST_DBAAS which still works but will be removed eventually; // - ENABLE_RBAC enables Access control; // - the environment variables prefixed with GF_ passed as related to Grafana. // - the environment variables relating to proxies @@ -172,18 +168,6 @@ func ParseEnvVars(envs []string) (envSettings *models.ChangeSettingsParams, errs case "PMM_INSTALL_METHOD": continue - case envEnableDbaas, envTestDbaas: - envSettings.EnableDBaaS, err = strconv.ParseBool(v) - if err != nil { - err = fmt.Errorf("invalid value %q for environment variable %q", v, k) - errs = append(errs, err) - continue - } - envSettings.DisableDBaaS = !envSettings.EnableDBaaS - if k == envTestDbaas { - warns = append(warns, fmt.Sprintf("environment variable %q IS DEPRECATED AND WILL BE REMOVED, USE %q INSTEAD", envTestDbaas, envEnableDbaas)) - } - case envEnableAccessControl: envSettings.EnableAccessControl, err = strconv.ParseBool(v) if err != nil { diff --git a/migrate-dbaas.py b/migrate-dbaas.py deleted file mode 100644 index 1b7b56adf4..0000000000 --- a/migrate-dbaas.py +++ /dev/null @@ -1,200 +0,0 @@ -#!/usr/bin/env python3 -import json -import subprocess - - -def get_clusters(cluster_type): - output = subprocess.check_output(["kubectl", "get", cluster_type, "-o", "json"]) - return json.loads(output) - - -def create_cluster(cluster): - cluster_name = cluster["metadata"]["name"] - p = subprocess.Popen(["kubectl", "apply", "-f", "-"], stdin=subprocess.PIPE) - p.communicate(json.dumps(cluster).encode('utf-8')) - output = subprocess.check_output(["kubectl", "get", "db", cluster_name, "-o", "json"]) - uid = json.loads(output).get("metadata", {}).get("uid") - meta_patch = { - "metadata": { - "ownerReferences": [ - { - "apiVersion": "dbaas.percona.com/v1", - "blockOwnerDeletion": True, - "controller": True, - "kind": "DatabaseCluster", - "name": cluster_name, - "uid": uid, - }, - ], - } - } - cluster_type = cluster["spec"]["databaseType"] - - print(subprocess.check_output(["kubectl", "patch", f"{cluster_type}/{cluster_name}","--type", "merge", "-p", json.dumps(meta_patch)])) - - - -def strip_none(data): - if isinstance(data, dict): - return {k:strip_none(v) for k, v in data.items() if k is not None and v is not None} - elif isinstance(data, list): - return [strip_none(item) for item in data if item is not None] - elif isinstance(data, tuple): - return tuple(strip_none(item) for item in data if item is not None) - elif isinstance(data, set): - return {strip_none(item) for item in data if item is not None} - else: - return data - - -def convert_pxc(cluster): - database_cluster = { - "apiVersion": "dbaas.percona.com/v1", - "kind": "DatabaseCluster", - "metadata": { - "name": cluster.get("metadata", {}).get("name", ""), - }, - "spec": { - "databaseType": "pxc", - "databaseConfig": cluster.get("spec", {}).get("pxc", {}).get("configuration", ""), - "databaseImage": cluster.get("spec", {}).get("pxc", {}).get("image", ""), - "secretsName": cluster.get("spec", {}).get("secretsName", ""), - "pause": cluster.get("spec", {}).get("pxc", {}).get("pause", None), - "clusterSize": cluster.get("spec", {}).get("pxc", {}).get("size"), - "loadBalancer": { - }, - "monitoring": {}, - "dbInstance": {} - } - } - if cluster.get("spec", {}).get("haproxy", None): - lb = cluster.get("spec", {}).get("haproxy", {}) - database_cluster["spec"]["loadBalancer"] = { - "type": "haproxy", - "exposeType": lb.get("serviceType", None), - "image": lb.get("image"), - "size": lb.get("size"), - "configuration": lb.get("configuration", None), - "annotations": lb.get("annotations", None), - "trafficPolicy": lb.get("externalTrafficPolicy", None), - "resources": lb.get("resources"), - } - - if cluster.get("spec", {}).get("proxysql", None): - lb = cluster.get("spec", {}).get("proxysql", {}) - database_cluster["spec"]["loadBalancer"] = { - "type": "proxysql", - "exposeType": lb.get("serviceType", None), - "image": lb.get("image"), - "size": lb.get("size"), - "configuration": lb.get("configuration", None), - "annotations": lb.get("annotations", None), - "trafficPolicy": lb.get("externalTrafficPolicy", None), - "resources": lb.get("resources"), - } - if cluster.get("spec", {}).get("pmm", {}).get("enabled", False): - mon = cluster.get("spec", {}).get("pmm", {}) - database_cluster["spec"]["monitoring"] = { - "pmm" : { - "image": mon.get("image"), - "serverHost": mon.get("serverHost", None), - "serverUser": mon.get("serverUser", None), - "publicAddress": mon.get("serverHost", None), - "login": mon.get("serverUser", None), - "password": mon.get("password", None), - }, - "resources": mon.get("resources"), - - } - volume_spec = cluster.get("spec", {}).get("pxc", {}).get("volumeSpec", {}).get("persistentVolumeClaim", {}) - limits = cluster.get("spec", {}).get("pxc", {}).get("resources", {}).get("limits", {}) - database_cluster["spec"]["dbInstance"] = { - "cpu": limits.get("cpu"), - "memory": limits.get("memory"), - "diskSize": volume_spec.get("resources", {}).get("requests", {}).get("storage"), - "storageClassName": volume_spec.get("storageClassName", None) - } - - - return database_cluster - - -def convert_psmdb(cluster): - database_cluster = { - "apiVersion": "dbaas.percona.com/v1", - "kind": "DatabaseCluster", - "metadata": { - "name": cluster.get("metadata", {}).get("name", ""), - }, - "spec": { - "databaseType": "psmdb", - "databaseImage": cluster.get("spec", {}).get("image"), - "secretsName": cluster.get("spec", {}).get("secrets", {}).get("users"), - "pause": cluster.get("spec", {}).get("pause", None), - "loadBalancer": { - }, - "monitoring": {}, - "dbInstance": {} - } - } - replsets = cluster.get("spec", {}).get("replsets", []) - - if len(replsets) == 0: - print("Cluster has no replicasets configured. Skipping") - return - - database_cluster["spec"]["databaseConfig"] = replsets[0].get("configuration", "") - database_cluster["spec"]["clusterSize"] = replsets[0].get("size") - - mongos = cluster.get("spec", {}).get("sharding", {}).get("mongos", None) - if mongos: - database_cluster["spec"]["loadBalancer"] = { - "type": "mongos", - "exposeType": mongos.get("expose", {}).get("exposeType", None), - "image": mongos.get("image"), - "size": mongos.get("size"), - "configuration": mongos.get("configuration", None), - "annotations": mongos.get("expose", {}).get("serviceAnnotations", None), - "loadBalancerSourceRanges": mongos.get("expose", {}).get("loadBalancerSourceRanges", None), - "trafficPolicy": mongos.get("externalTrafficPolicy", None), - "resources": mongos.get("resources"), - } - if cluster.get("spec", {}).get("pmm", {}).get("enabled", False): - mon = cluster.get("spec", {}).get("pmm", {}) - database_cluster["spec"]["monitoring"] = { - "pmm" : { - "image": mon.get("image"), - "serverHost": mon.get("serverHost", None), - "serverUser": mon.get("serverUser", None), - "publicAddress": mon.get("serverHost", None), - "login": mon.get("serverUser", None), - "password": mon.get("password", None), - }, - "resources": mon.get("resources"), - - } - volume_spec = replsets[0].get("volumeSpec", {}).get("persistentVolumeClaim", {}) - limits = replsets[0].get("resources", {}).get("limits", {}) - database_cluster["spec"]["dbInstance"] = { - "cpu": limits.get("cpu"), - "memory": limits.get("memory"), - "diskSize": volume_spec.get("resources", {}).get("requests", {}).get("storage"), - "storageClassName": volume_spec.get("storageClassName", None) - } - - - return database_cluster - - -if __name__ == '__main__': - clusters = [] - for cluster in get_clusters("pxc").get("items", []): - del cluster["status"] - clusters.append(convert_pxc(cluster)) - - for cluster in get_clusters("psmdb").get("items", []): - del cluster["status"] - clusters.append(convert_psmdb(cluster)) - - for cluster in clusters: - create_cluster(strip_none(cluster)) diff --git a/update/ansible/playbook/tasks/update.yml b/update/ansible/playbook/tasks/update.yml index 61ae3a43a2..3bcb34f34b 100644 --- a/update/ansible/playbook/tasks/update.yml +++ b/update/ansible/playbook/tasks/update.yml @@ -15,8 +15,6 @@ - percona-alertmanager - pmm-managed - pmm-update - - dbaas-controller - - dbaas-tools - pmm2-client - pmm-dump - vmproxy