From d0eaa02db3e9a99f1f7079d354e2e36adeddf900 Mon Sep 17 00:00:00 2001 From: Diogo Recharte Date: Wed, 7 Feb 2024 21:36:06 +0000 Subject: [PATCH] EVEREST-495 Add multi namespaces (#428) --- api/backup_storage.go | 86 +- api/database_cluster.go | 42 +- api/database_cluster_backup.go | 22 +- api/database_cluster_restore.go | 30 +- api/database_engine.go | 22 +- api/everest-server.gen.go | 818 ++++--- api/everest_test.go | 37 +- api/kubernetes.go | 50 - api/monitoring_instance.go | 64 +- api/namespace.go | 20 + api/proxy.go | 23 +- api/telemetry.go | 16 +- api/validation.go | 95 +- client/everest-client.gen.go | 2048 +++++++++-------- deploy/quickstart-k8s.yaml | 28 +- docs/spec/openapi.yml | 223 +- go.mod | 2 +- go.sum | 4 +- pkg/auth/token.go | 4 +- pkg/kubernetes/backup_storage.go | 50 +- pkg/kubernetes/client/client.go | 16 + pkg/kubernetes/client/database_cluster.go | 8 +- .../client/database_cluster_backup.go | 8 +- .../client/database_cluster_restore.go | 8 +- pkg/kubernetes/client/database_engine.go | 8 +- pkg/kubernetes/client/kubeclient_interface.go | 31 +- .../client/mock_kube_client_connector.go | 279 ++- pkg/kubernetes/client/monitoring_config.go | 12 +- pkg/kubernetes/client/secret.go | 12 +- pkg/kubernetes/database_cluster.go | 8 +- pkg/kubernetes/database_cluster_backup.go | 8 +- pkg/kubernetes/database_cluster_restore.go | 8 +- pkg/kubernetes/database_engine.go | 8 +- pkg/kubernetes/kubernetes.go | 36 + pkg/kubernetes/monitoring_config.go | 96 +- pkg/kubernetes/secret.go | 8 +- pkg/kubernetes/vmagent.go | 197 -- 37 files changed, 2382 insertions(+), 2053 deletions(-) create mode 100644 api/namespace.go delete mode 100644 pkg/kubernetes/vmagent.go diff --git a/api/backup_storage.go b/api/backup_storage.go index 04f4bbb8..face1621 100644 --- a/api/backup_storage.go +++ b/api/backup_storage.go @@ -41,12 +41,13 @@ func (e *EverestServer) ListBackupStorages(ctx echo.Context) error { for _, bs := range backupList.Items { s := bs result = append(result, BackupStorage{ - Type: BackupStorageType(bs.Spec.Type), - Name: s.Name, - Description: &s.Spec.Description, - BucketName: s.Spec.Bucket, - Region: s.Spec.Region, - Url: &s.Spec.EndpointURL, + Type: BackupStorageType(bs.Spec.Type), + Name: s.Name, + Description: &s.Spec.Description, + BucketName: s.Spec.Bucket, + Region: s.Spec.Region, + Url: &s.Spec.EndpointURL, + TargetNamespaces: s.Spec.TargetNamespaces, }) } @@ -55,7 +56,15 @@ func (e *EverestServer) ListBackupStorages(ctx echo.Context) error { // CreateBackupStorage creates a new backup storage object. func (e *EverestServer) CreateBackupStorage(ctx echo.Context) error { //nolint:funlen - params, err := validateCreateBackupStorageRequest(ctx, e.l) + namespaces, err := e.kubeClient.GetDBNamespaces(ctx.Request().Context(), e.kubeClient.Namespace()) + if err != nil { + e.l.Error(err) + return ctx.JSON(http.StatusInternalServerError, Error{ + Message: pointer.ToString("Failed getting watched namespaces"), + }) + } + + params, err := validateCreateBackupStorageRequest(ctx, namespaces, e.l) if err != nil { return ctx.JSON(http.StatusBadRequest, Error{Message: pointer.ToString(err.Error())}) } @@ -111,6 +120,7 @@ func (e *EverestServer) CreateBackupStorage(ctx echo.Context) error { //nolint:f Bucket: params.BucketName, Region: params.Region, CredentialsSecretName: params.Name, + TargetNamespaces: params.TargetNamespaces, }, } if params.Url != nil { @@ -123,7 +133,7 @@ func (e *EverestServer) CreateBackupStorage(ctx echo.Context) error { //nolint:f if err != nil { e.l.Error(err) // TODO: Move this logic to the operator - dErr := e.kubeClient.DeleteSecret(c, params.Name) + dErr := e.kubeClient.DeleteSecret(c, e.kubeClient.Namespace(), params.Name) if dErr != nil { return ctx.JSON(http.StatusInternalServerError, Error{ Message: pointer.ToString("Failed cleaning up secret for a backup storage"), @@ -134,12 +144,13 @@ func (e *EverestServer) CreateBackupStorage(ctx echo.Context) error { //nolint:f }) } result := BackupStorage{ - Type: BackupStorageType(params.Type), - Name: params.Name, - Description: params.Description, - BucketName: params.BucketName, - Region: params.Region, - Url: params.Url, + Type: BackupStorageType(params.Type), + Name: params.Name, + Description: params.Description, + BucketName: params.BucketName, + Region: params.Region, + Url: params.Url, + TargetNamespaces: params.TargetNamespaces, } return ctx.JSON(http.StatusOK, result) @@ -173,7 +184,7 @@ func (e *EverestServer) DeleteBackupStorage(ctx echo.Context, backupStorageName Message: pointer.ToString("Failed to delete a backup storage"), }) } - if err := e.kubeClient.DeleteSecret(ctx.Request().Context(), backupStorageName); err != nil { + if err := e.kubeClient.DeleteSecret(ctx.Request().Context(), e.kubeClient.Namespace(), backupStorageName); err != nil { if k8serrors.IsNotFound(err) { return ctx.NoContent(http.StatusNoContent) } @@ -208,17 +219,18 @@ func (e *EverestServer) GetBackupStorage(ctx echo.Context, backupStorageName str }) } return ctx.JSON(http.StatusOK, BackupStorage{ - Type: BackupStorageType(s.Spec.Type), - Name: s.Name, - Description: &s.Spec.Description, - BucketName: s.Spec.Bucket, - Region: s.Spec.Region, - Url: &s.Spec.EndpointURL, + Type: BackupStorageType(s.Spec.Type), + Name: s.Name, + Description: &s.Spec.Description, + BucketName: s.Spec.Bucket, + Region: s.Spec.Region, + Url: &s.Spec.EndpointURL, + TargetNamespaces: s.Spec.TargetNamespaces, }) } // UpdateBackupStorage updates of the specified backup storage. -func (e *EverestServer) UpdateBackupStorage(ctx echo.Context, backupStorageName string) error { //nolint:funlen +func (e *EverestServer) UpdateBackupStorage(ctx echo.Context, backupStorageName string) error { //nolint:funlen,cyclop c := ctx.Request().Context() bs, err := e.kubeClient.GetBackupStorage(c, backupStorageName) if err != nil { @@ -232,7 +244,8 @@ func (e *EverestServer) UpdateBackupStorage(ctx echo.Context, backupStorageName Message: pointer.ToString("Failed getting backup storage"), }) } - secret, err := e.kubeClient.GetSecret(c, backupStorageName) + + secret, err := e.kubeClient.GetSecret(c, e.kubeClient.Namespace(), backupStorageName) if err != nil { if k8serrors.IsNotFound(err) { return ctx.JSON(http.StatusNotFound, Error{ @@ -244,7 +257,16 @@ func (e *EverestServer) UpdateBackupStorage(ctx echo.Context, backupStorageName Message: pointer.ToString("Failed getting secret"), }) } - params, err := validateUpdateBackupStorageRequest(ctx, bs, secret, e.l) + + namespaces, err := e.kubeClient.GetDBNamespaces(ctx.Request().Context(), e.kubeClient.Namespace()) + if err != nil { + e.l.Error(err) + return ctx.JSON(http.StatusInternalServerError, Error{ + Message: pointer.ToString("Failed getting watched namespaces"), + }) + } + + params, err := validateUpdateBackupStorageRequest(ctx, bs, secret, namespaces, e.l) if err != nil { return ctx.JSON(http.StatusBadRequest, Error{Message: pointer.ToString(err.Error())}) } @@ -276,6 +298,9 @@ func (e *EverestServer) UpdateBackupStorage(ctx echo.Context, backupStorageName if params.Description != nil { bs.Spec.Description = *params.Description } + if params.TargetNamespaces != nil { + bs.Spec.TargetNamespaces = *params.TargetNamespaces + } err = e.kubeClient.UpdateBackupStorage(c, bs) if err != nil { @@ -285,12 +310,13 @@ func (e *EverestServer) UpdateBackupStorage(ctx echo.Context, backupStorageName }) } result := BackupStorage{ - Type: BackupStorageType(bs.Spec.Type), - Name: bs.Name, - Description: params.Description, - BucketName: bs.Spec.Bucket, - Region: bs.Spec.Region, - Url: &bs.Spec.EndpointURL, + Type: BackupStorageType(bs.Spec.Type), + Name: bs.Name, + Description: params.Description, + BucketName: bs.Spec.Bucket, + Region: bs.Spec.Region, + Url: &bs.Spec.EndpointURL, + TargetNamespaces: bs.Spec.TargetNamespaces, } return ctx.JSON(http.StatusOK, result) diff --git a/api/database_cluster.go b/api/database_cluster.go index 5a5e1930..ad10504b 100644 --- a/api/database_cluster.go +++ b/api/database_cluster.go @@ -28,8 +28,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +const ( + databaseClusterKind = "databaseclusters" +) + // CreateDatabaseCluster creates a new db cluster inside the given k8s cluster. -func (e *EverestServer) CreateDatabaseCluster(ctx echo.Context) error { +func (e *EverestServer) CreateDatabaseCluster(ctx echo.Context, namespace string) error { dbc := &DatabaseCluster{} if err := e.getBodyFromContext(ctx, dbc); err != nil { e.l.Error(err) @@ -38,30 +42,30 @@ func (e *EverestServer) CreateDatabaseCluster(ctx echo.Context) error { }) } - if err := e.validateDatabaseClusterCR(ctx, dbc); err != nil { + if err := e.validateDatabaseClusterCR(ctx, namespace, dbc); err != nil { return ctx.JSON(http.StatusBadRequest, Error{Message: pointer.ToString(err.Error())}) } - return e.proxyKubernetes(ctx, "") + return e.proxyKubernetes(ctx, namespace, databaseClusterKind, "") } // ListDatabaseClusters lists the created database clusters on the specified kubernetes cluster. -func (e *EverestServer) ListDatabaseClusters(ctx echo.Context) error { - return e.proxyKubernetes(ctx, "") +func (e *EverestServer) ListDatabaseClusters(ctx echo.Context, namespace string) error { + return e.proxyKubernetes(ctx, namespace, databaseClusterKind, "") } // DeleteDatabaseCluster deletes a database cluster on the specified kubernetes cluster. -func (e *EverestServer) DeleteDatabaseCluster(ctx echo.Context, name string) error { - return e.proxyKubernetes(ctx, name) +func (e *EverestServer) DeleteDatabaseCluster(ctx echo.Context, namespace, name string) error { + return e.proxyKubernetes(ctx, namespace, databaseClusterKind, name) } // GetDatabaseCluster retrieves the specified database cluster on the specified kubernetes cluster. -func (e *EverestServer) GetDatabaseCluster(ctx echo.Context, name string) error { - return e.proxyKubernetes(ctx, name) +func (e *EverestServer) GetDatabaseCluster(ctx echo.Context, namespace, name string) error { + return e.proxyKubernetes(ctx, namespace, databaseClusterKind, name) } // UpdateDatabaseCluster replaces the specified database cluster on the specified kubernetes cluster. -func (e *EverestServer) UpdateDatabaseCluster(ctx echo.Context, name string) error { +func (e *EverestServer) UpdateDatabaseCluster(ctx echo.Context, namespace, name string) error { dbc := &DatabaseCluster{} if err := e.getBodyFromContext(ctx, dbc); err != nil { e.l.Error(err) @@ -70,11 +74,11 @@ func (e *EverestServer) UpdateDatabaseCluster(ctx echo.Context, name string) err }) } - if err := e.validateDatabaseClusterCR(ctx, dbc); err != nil { + if err := e.validateDatabaseClusterCR(ctx, namespace, dbc); err != nil { return ctx.JSON(http.StatusBadRequest, Error{Message: pointer.ToString(err.Error())}) } - oldDB, err := e.kubeClient.GetDatabaseCluster(ctx.Request().Context(), name) + oldDB, err := e.kubeClient.GetDatabaseCluster(ctx.Request().Context(), namespace, name) if err != nil { return errors.Join(err, errors.New("could not get old Database Cluster")) } @@ -82,17 +86,17 @@ func (e *EverestServer) UpdateDatabaseCluster(ctx echo.Context, name string) err return ctx.JSON(http.StatusBadRequest, Error{Message: pointer.ToString(err.Error())}) } - return e.proxyKubernetes(ctx, name) + return e.proxyKubernetes(ctx, namespace, databaseClusterKind, name) } // GetDatabaseClusterCredentials returns credentials for the specified database cluster. -func (e *EverestServer) GetDatabaseClusterCredentials(ctx echo.Context, name string) error { - databaseCluster, err := e.kubeClient.GetDatabaseCluster(ctx.Request().Context(), name) +func (e *EverestServer) GetDatabaseClusterCredentials(ctx echo.Context, namespace, name string) error { + databaseCluster, err := e.kubeClient.GetDatabaseCluster(ctx.Request().Context(), namespace, name) if err != nil { e.l.Error(err) return ctx.JSON(http.StatusInternalServerError, Error{Message: pointer.ToString(err.Error())}) } - secret, err := e.kubeClient.GetSecret(ctx.Request().Context(), databaseCluster.Spec.Engine.UserSecretsName) + secret, err := e.kubeClient.GetSecret(ctx.Request().Context(), namespace, databaseCluster.Spec.Engine.UserSecretsName) if err != nil { e.l.Error(err) return ctx.JSON(http.StatusInternalServerError, Error{Message: pointer.ToString(err.Error())}) @@ -116,8 +120,8 @@ func (e *EverestServer) GetDatabaseClusterCredentials(ctx echo.Context, name str } // GetDatabaseClusterPitr returns the point-in-time recovery related information for the specified database cluster. -func (e *EverestServer) GetDatabaseClusterPitr(ctx echo.Context, name string) error { - databaseCluster, err := e.kubeClient.GetDatabaseCluster(ctx.Request().Context(), name) +func (e *EverestServer) GetDatabaseClusterPitr(ctx echo.Context, namespace, name string) error { + databaseCluster, err := e.kubeClient.GetDatabaseCluster(ctx.Request().Context(), namespace, name) if err != nil { e.l.Error(err) return ctx.JSON(http.StatusInternalServerError, Error{Message: pointer.ToString(err.Error())}) @@ -135,7 +139,7 @@ func (e *EverestServer) GetDatabaseClusterPitr(ctx echo.Context, name string) er }, }), } - backups, err := e.kubeClient.ListDatabaseClusterBackups(ctx.Request().Context(), options) + backups, err := e.kubeClient.ListDatabaseClusterBackups(ctx.Request().Context(), namespace, options) if err != nil { e.l.Error(err) return ctx.JSON(http.StatusInternalServerError, Error{Message: pointer.ToString(err.Error())}) diff --git a/api/database_cluster_backup.go b/api/database_cluster_backup.go index 1c8887c9..78f59b5e 100644 --- a/api/database_cluster_backup.go +++ b/api/database_cluster_backup.go @@ -26,8 +26,12 @@ import ( "github.com/labstack/echo/v4" ) +const ( + databaseClusterBackupKind = "databaseclusterbackups" +) + // ListDatabaseClusterBackups returns list of the created database cluster backups on the specified kubernetes cluster. -func (e *EverestServer) ListDatabaseClusterBackups(ctx echo.Context, name string) error { +func (e *EverestServer) ListDatabaseClusterBackups(ctx echo.Context, namespace, name string) error { req := ctx.Request() if err := validateRFC1035(name, "name"); err != nil { return ctx.JSON(http.StatusBadRequest, Error{Message: pointer.ToString(err.Error())}) @@ -42,11 +46,11 @@ func (e *EverestServer) ListDatabaseClusterBackups(ctx echo.Context, name string path = strings.TrimSuffix(path, name) path = strings.ReplaceAll(path, "database-clusters", "database-cluster-backups") req.URL.Path = path - return e.proxyKubernetes(ctx, "") + return e.proxyKubernetes(ctx, namespace, databaseClusterBackupKind, "") } // CreateDatabaseClusterBackup creates a database cluster backup on the specified kubernetes cluster. -func (e *EverestServer) CreateDatabaseClusterBackup(ctx echo.Context) error { +func (e *EverestServer) CreateDatabaseClusterBackup(ctx echo.Context, namespace string) error { dbb := &DatabaseClusterBackup{} if err := e.getBodyFromContext(ctx, dbb); err != nil { e.l.Error(err) @@ -55,19 +59,19 @@ func (e *EverestServer) CreateDatabaseClusterBackup(ctx echo.Context) error { }) } // TODO: Improve returns status code in EVEREST-616 - if err := validateDatabaseClusterBackup(ctx.Request().Context(), dbb, e.kubeClient); err != nil { + if err := validateDatabaseClusterBackup(ctx.Request().Context(), namespace, dbb, e.kubeClient); err != nil { e.l.Error(err) return ctx.JSON(http.StatusBadRequest, Error{Message: pointer.ToString(err.Error())}) } - return e.proxyKubernetes(ctx, "") + return e.proxyKubernetes(ctx, namespace, databaseClusterBackupKind, "") } // DeleteDatabaseClusterBackup deletes the specified cluster backup on the specified kubernetes cluster. -func (e *EverestServer) DeleteDatabaseClusterBackup(ctx echo.Context, name string) error { - return e.proxyKubernetes(ctx, name) +func (e *EverestServer) DeleteDatabaseClusterBackup(ctx echo.Context, namespace, name string) error { + return e.proxyKubernetes(ctx, namespace, databaseClusterBackupKind, name) } // GetDatabaseClusterBackup returns the specified cluster backup on the specified kubernetes cluster. -func (e *EverestServer) GetDatabaseClusterBackup(ctx echo.Context, name string) error { - return e.proxyKubernetes(ctx, name) +func (e *EverestServer) GetDatabaseClusterBackup(ctx echo.Context, namespace, name string) error { + return e.proxyKubernetes(ctx, namespace, databaseClusterBackupKind, name) } diff --git a/api/database_cluster_restore.go b/api/database_cluster_restore.go index 349bd41d..98be3924 100644 --- a/api/database_cluster_restore.go +++ b/api/database_cluster_restore.go @@ -27,8 +27,12 @@ import ( everestv1alpha1 "github.com/percona/everest-operator/api/v1alpha1" ) +const ( + databaseClusterRestoreKind = "databaseclusterrestores" +) + // ListDatabaseClusterRestores List of the created database cluster restores on the specified kubernetes cluster. -func (e *EverestServer) ListDatabaseClusterRestores(ctx echo.Context, name string) error { +func (e *EverestServer) ListDatabaseClusterRestores(ctx echo.Context, namespace, name string) error { req := ctx.Request() if err := validateRFC1035(name, "name"); err != nil { return ctx.JSON(http.StatusBadRequest, Error{Message: pointer.ToString(err.Error())}) @@ -43,11 +47,11 @@ func (e *EverestServer) ListDatabaseClusterRestores(ctx echo.Context, name strin path = strings.TrimSuffix(path, name) path = strings.ReplaceAll(path, "database-clusters", "database-cluster-restores") req.URL.Path = path - return e.proxyKubernetes(ctx, "") + return e.proxyKubernetes(ctx, namespace, databaseClusterRestoreKind, "") } // CreateDatabaseClusterRestore Create a database cluster restore on the specified kubernetes cluster. -func (e *EverestServer) CreateDatabaseClusterRestore(ctx echo.Context) error { +func (e *EverestServer) CreateDatabaseClusterRestore(ctx echo.Context, namespace string) error { restore := &DatabaseClusterRestore{} if err := e.getBodyFromContext(ctx, restore); err != nil { e.l.Error(err) @@ -55,13 +59,13 @@ func (e *EverestServer) CreateDatabaseClusterRestore(ctx echo.Context) error { Message: pointer.ToString("Could not get DatabaseClusterRestore from the request body"), }) } - if err := validateDatabaseClusterRestore(ctx.Request().Context(), restore, e.kubeClient); err != nil { + if err := validateDatabaseClusterRestore(ctx.Request().Context(), namespace, restore, e.kubeClient); err != nil { e.l.Error(err) return ctx.JSON(http.StatusBadRequest, Error{ Message: pointer.ToString(err.Error()), }) } - dbCluster, err := e.kubeClient.GetDatabaseCluster(ctx.Request().Context(), restore.Spec.DbClusterName) + dbCluster, err := e.kubeClient.GetDatabaseCluster(ctx.Request().Context(), namespace, restore.Spec.DbClusterName) if err != nil { e.l.Error(err) return ctx.JSON(http.StatusInternalServerError, Error{ @@ -75,21 +79,21 @@ func (e *EverestServer) CreateDatabaseClusterRestore(ctx echo.Context) error { }) } - return e.proxyKubernetes(ctx, "") + return e.proxyKubernetes(ctx, namespace, databaseClusterRestoreKind, "") } // DeleteDatabaseClusterRestore Delete the specified cluster restore on the specified kubernetes cluster. -func (e *EverestServer) DeleteDatabaseClusterRestore(ctx echo.Context, name string) error { - return e.proxyKubernetes(ctx, name) +func (e *EverestServer) DeleteDatabaseClusterRestore(ctx echo.Context, namespace, name string) error { + return e.proxyKubernetes(ctx, namespace, databaseClusterRestoreKind, name) } // GetDatabaseClusterRestore Returns the specified cluster restore on the specified kubernetes cluster. -func (e *EverestServer) GetDatabaseClusterRestore(ctx echo.Context, name string) error { - return e.proxyKubernetes(ctx, name) +func (e *EverestServer) GetDatabaseClusterRestore(ctx echo.Context, namespace, name string) error { + return e.proxyKubernetes(ctx, namespace, databaseClusterRestoreKind, name) } // UpdateDatabaseClusterRestore Replace the specified cluster restore on the specified kubernetes cluster. -func (e *EverestServer) UpdateDatabaseClusterRestore(ctx echo.Context, name string) error { +func (e *EverestServer) UpdateDatabaseClusterRestore(ctx echo.Context, namespace, name string) error { restore := &DatabaseClusterRestore{} if err := e.getBodyFromContext(ctx, restore); err != nil { e.l.Error(err) @@ -97,11 +101,11 @@ func (e *EverestServer) UpdateDatabaseClusterRestore(ctx echo.Context, name stri Message: pointer.ToString("Could not get DatabaseClusterRestore from the request body"), }) } - if err := validateDatabaseClusterRestore(ctx.Request().Context(), restore, e.kubeClient); err != nil { + if err := validateDatabaseClusterRestore(ctx.Request().Context(), namespace, restore, e.kubeClient); err != nil { e.l.Error(err) return ctx.JSON(http.StatusBadRequest, Error{ Message: pointer.ToString(err.Error()), }) } - return e.proxyKubernetes(ctx, name) + return e.proxyKubernetes(ctx, namespace, databaseClusterRestoreKind, name) } diff --git a/api/database_engine.go b/api/database_engine.go index c6a242cb..956cf60f 100644 --- a/api/database_engine.go +++ b/api/database_engine.go @@ -18,17 +18,21 @@ package api import "github.com/labstack/echo/v4" -// ListDatabaseEngines List of the available database engines on the specified kubernetes cluster. -func (e *EverestServer) ListDatabaseEngines(ctx echo.Context) error { - return e.proxyKubernetes(ctx, "") +const ( + databaseEngineKind = "databaseengines" +) + +// ListDatabaseEngines List of the available database engines on the specified namespace. +func (e *EverestServer) ListDatabaseEngines(ctx echo.Context, namespace string) error { + return e.proxyKubernetes(ctx, namespace, databaseEngineKind, "") } -// GetDatabaseEngine Get the specified database cluster on the specified kubernetes cluster. -func (e *EverestServer) GetDatabaseEngine(ctx echo.Context, name string) error { - return e.proxyKubernetes(ctx, name) +// GetDatabaseEngine Get the specified database engine on the specified namespace. +func (e *EverestServer) GetDatabaseEngine(ctx echo.Context, namespace, name string) error { + return e.proxyKubernetes(ctx, namespace, databaseEngineKind, name) } -// UpdateDatabaseEngine Get the specified database cluster on the specified kubernetes cluster. -func (e *EverestServer) UpdateDatabaseEngine(ctx echo.Context, name string) error { - return e.proxyKubernetes(ctx, name) +// UpdateDatabaseEngine Update the specified database engine on the specified namespace. +func (e *EverestServer) UpdateDatabaseEngine(ctx echo.Context, namespace, name string) error { + return e.proxyKubernetes(ctx, namespace, databaseEngineKind, name) } diff --git a/api/everest-server.gen.go b/api/everest-server.gen.go index 1addc1e1..a95dc0b0 100644 --- a/api/everest-server.gen.go +++ b/api/everest-server.gen.go @@ -87,12 +87,15 @@ const ( // BackupStorage Backup storage information type BackupStorage struct { - BucketName string `json:"bucketName"` - Description *string `json:"description,omitempty"` - Name string `json:"name"` - Region string `json:"region,omitempty"` - Type BackupStorageType `json:"type"` - Url *string `json:"url,omitempty"` + BucketName string `json:"bucketName"` + Description *string `json:"description,omitempty"` + Name string `json:"name"` + Region string `json:"region,omitempty"` + + // TargetNamespaces List of namespaces allowed to use this backup storage + TargetNamespaces []string `json:"targetNamespaces"` + Type BackupStorageType `json:"type"` + Url *string `json:"url,omitempty"` } // BackupStorageType defines model for BackupStorage.Type. @@ -110,11 +113,14 @@ type CreateBackupStorageParams struct { Description *string `json:"description,omitempty"` // Name A user defined string name of the storage in the DNS name format https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names - Name string `json:"name"` - Region string `json:"region,omitempty"` - SecretKey string `json:"secretKey"` - Type CreateBackupStorageParamsType `json:"type"` - Url *string `json:"url,omitempty"` + Name string `json:"name"` + Region string `json:"region,omitempty"` + SecretKey string `json:"secretKey"` + + // TargetNamespaces List of namespaces allowed to use this backup storage + TargetNamespaces []string `json:"targetNamespaces"` + Type CreateBackupStorageParamsType `json:"type"` + Url *string `json:"url,omitempty"` } // CreateBackupStorageParamsType defines model for CreateBackupStorageParams.Type. @@ -614,14 +620,6 @@ type KubernetesClusterInfo struct { StorageClassNames []string `json:"storageClassNames"` } -// KubernetesClusterMonitoring Kubernetes cluster monitoring configuration -type KubernetesClusterMonitoring struct { - Enable bool `json:"enable"` - - // MonitoringInstanceName Name of the monitoring instance to use for monitoring the Kubernetes cluster - MonitoringInstanceName string `json:"monitoringInstanceName,omitempty"` -} - // KubernetesClusterResources kubernetes cluster resources type KubernetesClusterResources struct { Available ResourcesAvailable `json:"available"` @@ -647,8 +645,10 @@ type MonitoringInstance = MonitoringInstanceBaseWithName // MonitoringInstanceBase Monitoring instance information type MonitoringInstanceBase struct { - Type MonitoringInstanceBaseType `json:"type,omitempty"` - Url string `json:"url,omitempty"` + // TargetNamespaces List of namespaces allowed to use this monitoring instance + TargetNamespaces *[]string `json:"targetNamespaces,omitempty"` + Type MonitoringInstanceBaseType `json:"type,omitempty"` + Url string `json:"url,omitempty"` } // MonitoringInstanceBaseType defines model for MonitoringInstanceBase.Type. @@ -657,9 +657,12 @@ type MonitoringInstanceBaseType string // MonitoringInstanceBaseWithName defines model for MonitoringInstanceBaseWithName. type MonitoringInstanceBaseWithName struct { // Name A user defined string name of the storage in the DNS name format https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names - Name string `json:"name,omitempty"` - Type MonitoringInstanceBaseWithNameType `json:"type,omitempty"` - Url string `json:"url,omitempty"` + Name string `json:"name,omitempty"` + + // TargetNamespaces List of namespaces allowed to use this monitoring instance + TargetNamespaces *[]string `json:"targetNamespaces,omitempty"` + Type MonitoringInstanceBaseWithNameType `json:"type,omitempty"` + Url string `json:"url,omitempty"` } // MonitoringInstanceBaseWithNameType defines model for MonitoringInstanceBaseWithName.Type. @@ -668,10 +671,13 @@ type MonitoringInstanceBaseWithNameType string // MonitoringInstanceCreateParams defines model for MonitoringInstanceCreateParams. type MonitoringInstanceCreateParams struct { // Name A user defined string name of the storage in the DNS name format https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names - Name string `json:"name,omitempty"` - Pmm *PMMMonitoringInstanceSpec `json:"pmm,omitempty"` - Type MonitoringInstanceCreateParamsType `json:"type,omitempty"` - Url string `json:"url,omitempty"` + Name string `json:"name,omitempty"` + Pmm *PMMMonitoringInstanceSpec `json:"pmm,omitempty"` + + // TargetNamespaces List of namespaces allowed to use this monitoring instance + TargetNamespaces *[]string `json:"targetNamespaces,omitempty"` + Type MonitoringInstanceCreateParamsType `json:"type,omitempty"` + Url string `json:"url,omitempty"` } // PMMMonitoringInstanceSpec defines model for . @@ -691,9 +697,12 @@ type MonitoringInstancePMM struct { // MonitoringInstanceUpdateParams defines model for MonitoringInstanceUpdateParams. type MonitoringInstanceUpdateParams struct { - Pmm *PMMMonitoringInstanceSpec `json:"pmm,omitempty"` - Type MonitoringInstanceUpdateParamsType `json:"type,omitempty"` - Url string `json:"url,omitempty"` + Pmm *PMMMonitoringInstanceSpec `json:"pmm,omitempty"` + + // TargetNamespaces List of namespaces allowed to use this monitoring instance + TargetNamespaces *[]string `json:"targetNamespaces,omitempty"` + Type MonitoringInstanceUpdateParamsType `json:"type,omitempty"` + Url string `json:"url,omitempty"` } // MonitoringInstanceUpdateParamsType defines model for MonitoringInstanceUpdateParams.Type. @@ -702,6 +711,9 @@ type MonitoringInstanceUpdateParamsType string // MonitoringInstancesList defines model for MonitoringInstancesList. type MonitoringInstancesList = []MonitoringInstance +// NamespaceList defines model for NamespaceList. +type NamespaceList = []string + // UpdateBackupStorageParams Backup storage parameters type UpdateBackupStorageParams struct { AccessKey *string `json:"accessKey,omitempty"` @@ -711,7 +723,10 @@ type UpdateBackupStorageParams struct { Description *string `json:"description,omitempty"` Region *string `json:"region,omitempty"` SecretKey *string `json:"secretKey,omitempty"` - Url *string `json:"url,omitempty"` + + // TargetNamespaces List of namespaces allowed to use this backup storage + TargetNamespaces *[]string `json:"targetNamespaces,omitempty"` + Url *string `json:"url,omitempty"` } // Version Everest version info @@ -808,8 +823,11 @@ type CreateBackupStorageJSONRequestBody = CreateBackupStorageParams // UpdateBackupStorageJSONRequestBody defines body for UpdateBackupStorage for application/json ContentType. type UpdateBackupStorageJSONRequestBody = UpdateBackupStorageParams -// SetKubernetesClusterMonitoringJSONRequestBody defines body for SetKubernetesClusterMonitoring for application/json ContentType. -type SetKubernetesClusterMonitoringJSONRequestBody = KubernetesClusterMonitoring +// CreateMonitoringInstanceJSONRequestBody defines body for CreateMonitoringInstance for application/json ContentType. +type CreateMonitoringInstanceJSONRequestBody = MonitoringInstanceCreateParams + +// UpdateMonitoringInstanceJSONRequestBody defines body for UpdateMonitoringInstance for application/json ContentType. +type UpdateMonitoringInstanceJSONRequestBody = MonitoringInstanceUpdateParams // CreateDatabaseClusterBackupJSONRequestBody defines body for CreateDatabaseClusterBackup for application/json ContentType. type CreateDatabaseClusterBackupJSONRequestBody = DatabaseClusterBackup @@ -829,12 +847,6 @@ type UpdateDatabaseClusterJSONRequestBody = DatabaseCluster // UpdateDatabaseEngineJSONRequestBody defines body for UpdateDatabaseEngine for application/json ContentType. type UpdateDatabaseEngineJSONRequestBody = DatabaseEngine -// CreateMonitoringInstanceJSONRequestBody defines body for CreateMonitoringInstance for application/json ContentType. -type CreateMonitoringInstanceJSONRequestBody = MonitoringInstanceCreateParams - -// UpdateMonitoringInstanceJSONRequestBody defines body for UpdateMonitoringInstance for application/json ContentType. -type UpdateMonitoringInstanceJSONRequestBody = MonitoringInstanceUpdateParams - // AsDatabaseClusterSpecEngineResourcesCpu0 returns the union data inside the DatabaseCluster_Spec_Engine_Resources_Cpu as a DatabaseClusterSpecEngineResourcesCpu0 func (t DatabaseCluster_Spec_Engine_Resources_Cpu) AsDatabaseClusterSpecEngineResourcesCpu0() (DatabaseClusterSpecEngineResourcesCpu0, error) { var body DatabaseClusterSpecEngineResourcesCpu0 @@ -1289,81 +1301,81 @@ type ServerInterface interface { // Get the cluster type and storage classes of a kubernetes cluster // (GET /cluster-info) GetKubernetesClusterInfo(ctx echo.Context) error - // Manage Kubernetes cluster monitoring configuration - // (POST /cluster-monitoring) - SetKubernetesClusterMonitoring(ctx echo.Context) error + // List of the created monitoring instances + // (GET /monitoring-instances) + ListMonitoringInstances(ctx echo.Context) error + // Create a new monitoring instance object + // (POST /monitoring-instances) + CreateMonitoringInstance(ctx echo.Context) error + // Delete the specified Monitoring instance + // (DELETE /monitoring-instances/{name}) + DeleteMonitoringInstance(ctx echo.Context, name string) error + // Get the specified monitoring instance + // (GET /monitoring-instances/{name}) + GetMonitoringInstance(ctx echo.Context, name string) error + // Update the specified Monitoring instance + // (PATCH /monitoring-instances/{name}) + UpdateMonitoringInstance(ctx echo.Context, name string) error + // Get all namespaces managed by Everest + // (GET /namespaces) + ListNamespaces(ctx echo.Context) error // Create a database cluster backup - // (POST /database-cluster-backups) - CreateDatabaseClusterBackup(ctx echo.Context) error + // (POST /namespaces/{namespace}/database-cluster-backups) + CreateDatabaseClusterBackup(ctx echo.Context, namespace string) error // Delete the specified cluster backup - // (DELETE /database-cluster-backups/{name}) - DeleteDatabaseClusterBackup(ctx echo.Context, name string) error + // (DELETE /namespaces/{namespace}/database-cluster-backups/{name}) + DeleteDatabaseClusterBackup(ctx echo.Context, namespace string, name string) error // Returns the specified cluster backup - // (GET /database-cluster-backups/{name}) - GetDatabaseClusterBackup(ctx echo.Context, name string) error + // (GET /namespaces/{namespace}/database-cluster-backups/{name}) + GetDatabaseClusterBackup(ctx echo.Context, namespace string, name string) error // Create a database cluster restore - // (POST /database-cluster-restores) - CreateDatabaseClusterRestore(ctx echo.Context) error + // (POST /namespaces/{namespace}/database-cluster-restores) + CreateDatabaseClusterRestore(ctx echo.Context, namespace string) error // Delete the specified cluster restore - // (DELETE /database-cluster-restores/{name}) - DeleteDatabaseClusterRestore(ctx echo.Context, name string) error + // (DELETE /namespaces/{namespace}/database-cluster-restores/{name}) + DeleteDatabaseClusterRestore(ctx echo.Context, namespace string, name string) error // Returns the specified cluster restore - // (GET /database-cluster-restores/{name}) - GetDatabaseClusterRestore(ctx echo.Context, name string) error + // (GET /namespaces/{namespace}/database-cluster-restores/{name}) + GetDatabaseClusterRestore(ctx echo.Context, namespace string, name string) error // Replace the specified cluster restore - // (PUT /database-cluster-restores/{name}) - UpdateDatabaseClusterRestore(ctx echo.Context, name string) error + // (PUT /namespaces/{namespace}/database-cluster-restores/{name}) + UpdateDatabaseClusterRestore(ctx echo.Context, namespace string, name string) error // List of the created database clusters - // (GET /database-clusters) - ListDatabaseClusters(ctx echo.Context) error + // (GET /namespaces/{namespace}/database-clusters) + ListDatabaseClusters(ctx echo.Context, namespace string) error // Create a database cluster - // (POST /database-clusters) - CreateDatabaseCluster(ctx echo.Context) error + // (POST /namespaces/{namespace}/database-clusters) + CreateDatabaseCluster(ctx echo.Context, namespace string) error // Delete the specified database cluster - // (DELETE /database-clusters/{name}) - DeleteDatabaseCluster(ctx echo.Context, name string) error + // (DELETE /namespaces/{namespace}/database-clusters/{name}) + DeleteDatabaseCluster(ctx echo.Context, namespace string, name string) error // Get the specified database cluster - // (GET /database-clusters/{name}) - GetDatabaseCluster(ctx echo.Context, name string) error + // (GET /namespaces/{namespace}/database-clusters/{name}) + GetDatabaseCluster(ctx echo.Context, namespace string, name string) error // Replace the specified database cluster - // (PUT /database-clusters/{name}) - UpdateDatabaseCluster(ctx echo.Context, name string) error + // (PUT /namespaces/{namespace}/database-clusters/{name}) + UpdateDatabaseCluster(ctx echo.Context, namespace string, name string) error // List of the created database cluster backups - // (GET /database-clusters/{name}/backups) - ListDatabaseClusterBackups(ctx echo.Context, name string) error + // (GET /namespaces/{namespace}/database-clusters/{name}/backups) + ListDatabaseClusterBackups(ctx echo.Context, namespace string, name string) error // Get the specified database cluster credentials - // (GET /database-clusters/{name}/credentials) - GetDatabaseClusterCredentials(ctx echo.Context, name string) error + // (GET /namespaces/{namespace}/database-clusters/{name}/credentials) + GetDatabaseClusterCredentials(ctx echo.Context, namespace string, name string) error // Get the Point-in-Time related data for the specified database cluster - // (GET /database-clusters/{name}/pitr) - GetDatabaseClusterPitr(ctx echo.Context, name string) error + // (GET /namespaces/{namespace}/database-clusters/{name}/pitr) + GetDatabaseClusterPitr(ctx echo.Context, namespace string, name string) error // List of the created database cluster restores - // (GET /database-clusters/{name}/restores) - ListDatabaseClusterRestores(ctx echo.Context, name string) error + // (GET /namespaces/{namespace}/database-clusters/{name}/restores) + ListDatabaseClusterRestores(ctx echo.Context, namespace string, name string) error // List of the available database engines - // (GET /database-engines) - ListDatabaseEngines(ctx echo.Context) error + // (GET /namespaces/{namespace}/database-engines) + ListDatabaseEngines(ctx echo.Context, namespace string) error // Get the specified database engine - // (GET /database-engines/{name}) - GetDatabaseEngine(ctx echo.Context, name string) error + // (GET /namespaces/{namespace}/database-engines/{name}) + GetDatabaseEngine(ctx echo.Context, namespace string, name string) error // Update the specified database engine - // (PUT /database-engines/{name}) - UpdateDatabaseEngine(ctx echo.Context, name string) error - // List of the created monitoring instances - // (GET /monitoring-instances) - ListMonitoringInstances(ctx echo.Context) error - // Create a new monitoring instance object - // (POST /monitoring-instances) - CreateMonitoringInstance(ctx echo.Context) error - // Delete the specified Monitoring instance - // (DELETE /monitoring-instances/{name}) - DeleteMonitoringInstance(ctx echo.Context, name string) error - // Get the specified monitoring instance - // (GET /monitoring-instances/{name}) - GetMonitoringInstance(ctx echo.Context, name string) error - // Update the specified Monitoring instance - // (PATCH /monitoring-instances/{name}) - UpdateMonitoringInstance(ctx echo.Context, name string) error + // (PUT /namespaces/{namespace}/database-engines/{name}) + UpdateDatabaseEngine(ctx echo.Context, namespace string, name string) error // Get the capacity and available resources of a kubernetes cluster // (GET /resources) GetKubernetesClusterResources(ctx echo.Context) error @@ -1452,27 +1464,108 @@ func (w *ServerInterfaceWrapper) GetKubernetesClusterInfo(ctx echo.Context) erro return err } -// SetKubernetesClusterMonitoring converts echo context to params. -func (w *ServerInterfaceWrapper) SetKubernetesClusterMonitoring(ctx echo.Context) error { +// ListMonitoringInstances converts echo context to params. +func (w *ServerInterfaceWrapper) ListMonitoringInstances(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ListMonitoringInstances(ctx) + return err +} + +// CreateMonitoringInstance converts echo context to params. +func (w *ServerInterfaceWrapper) CreateMonitoringInstance(ctx echo.Context) error { var err error // Invoke the callback with all the unmarshaled arguments - err = w.Handler.SetKubernetesClusterMonitoring(ctx) + err = w.Handler.CreateMonitoringInstance(ctx) + return err +} + +// DeleteMonitoringInstance converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteMonitoringInstance(ctx echo.Context) error { + var err error + // ------------- Path parameter "name" ------------- + var name string + + err = runtime.BindStyledParameterWithLocation("simple", false, "name", runtime.ParamLocationPath, ctx.Param("name"), &name) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteMonitoringInstance(ctx, name) + return err +} + +// GetMonitoringInstance converts echo context to params. +func (w *ServerInterfaceWrapper) GetMonitoringInstance(ctx echo.Context) error { + var err error + // ------------- Path parameter "name" ------------- + var name string + + err = runtime.BindStyledParameterWithLocation("simple", false, "name", runtime.ParamLocationPath, ctx.Param("name"), &name) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetMonitoringInstance(ctx, name) + return err +} + +// UpdateMonitoringInstance converts echo context to params. +func (w *ServerInterfaceWrapper) UpdateMonitoringInstance(ctx echo.Context) error { + var err error + // ------------- Path parameter "name" ------------- + var name string + + err = runtime.BindStyledParameterWithLocation("simple", false, "name", runtime.ParamLocationPath, ctx.Param("name"), &name) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.UpdateMonitoringInstance(ctx, name) + return err +} + +// ListNamespaces converts echo context to params. +func (w *ServerInterfaceWrapper) ListNamespaces(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ListNamespaces(ctx) return err } // CreateDatabaseClusterBackup converts echo context to params. func (w *ServerInterfaceWrapper) CreateDatabaseClusterBackup(ctx echo.Context) error { var err error + // ------------- Path parameter "namespace" ------------- + var namespace string + + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.CreateDatabaseClusterBackup(ctx) + err = w.Handler.CreateDatabaseClusterBackup(ctx, namespace) return err } // DeleteDatabaseClusterBackup converts echo context to params. func (w *ServerInterfaceWrapper) DeleteDatabaseClusterBackup(ctx echo.Context) error { var err error + // ------------- Path parameter "namespace" ------------- + var namespace string + + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + // ------------- Path parameter "name" ------------- var name string @@ -1482,13 +1575,21 @@ func (w *ServerInterfaceWrapper) DeleteDatabaseClusterBackup(ctx echo.Context) e } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.DeleteDatabaseClusterBackup(ctx, name) + err = w.Handler.DeleteDatabaseClusterBackup(ctx, namespace, name) return err } // GetDatabaseClusterBackup converts echo context to params. func (w *ServerInterfaceWrapper) GetDatabaseClusterBackup(ctx echo.Context) error { var err error + // ------------- Path parameter "namespace" ------------- + var namespace string + + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + // ------------- Path parameter "name" ------------- var name string @@ -1498,22 +1599,37 @@ func (w *ServerInterfaceWrapper) GetDatabaseClusterBackup(ctx echo.Context) erro } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetDatabaseClusterBackup(ctx, name) + err = w.Handler.GetDatabaseClusterBackup(ctx, namespace, name) return err } // CreateDatabaseClusterRestore converts echo context to params. func (w *ServerInterfaceWrapper) CreateDatabaseClusterRestore(ctx echo.Context) error { var err error + // ------------- Path parameter "namespace" ------------- + var namespace string + + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.CreateDatabaseClusterRestore(ctx) + err = w.Handler.CreateDatabaseClusterRestore(ctx, namespace) return err } // DeleteDatabaseClusterRestore converts echo context to params. func (w *ServerInterfaceWrapper) DeleteDatabaseClusterRestore(ctx echo.Context) error { var err error + // ------------- Path parameter "namespace" ------------- + var namespace string + + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + // ------------- Path parameter "name" ------------- var name string @@ -1523,13 +1639,21 @@ func (w *ServerInterfaceWrapper) DeleteDatabaseClusterRestore(ctx echo.Context) } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.DeleteDatabaseClusterRestore(ctx, name) + err = w.Handler.DeleteDatabaseClusterRestore(ctx, namespace, name) return err } // GetDatabaseClusterRestore converts echo context to params. func (w *ServerInterfaceWrapper) GetDatabaseClusterRestore(ctx echo.Context) error { var err error + // ------------- Path parameter "namespace" ------------- + var namespace string + + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + // ------------- Path parameter "name" ------------- var name string @@ -1539,13 +1663,21 @@ func (w *ServerInterfaceWrapper) GetDatabaseClusterRestore(ctx echo.Context) err } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetDatabaseClusterRestore(ctx, name) + err = w.Handler.GetDatabaseClusterRestore(ctx, namespace, name) return err } // UpdateDatabaseClusterRestore converts echo context to params. func (w *ServerInterfaceWrapper) UpdateDatabaseClusterRestore(ctx echo.Context) error { var err error + // ------------- Path parameter "namespace" ------------- + var namespace string + + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + // ------------- Path parameter "name" ------------- var name string @@ -1555,31 +1687,53 @@ func (w *ServerInterfaceWrapper) UpdateDatabaseClusterRestore(ctx echo.Context) } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.UpdateDatabaseClusterRestore(ctx, name) + err = w.Handler.UpdateDatabaseClusterRestore(ctx, namespace, name) return err } // ListDatabaseClusters converts echo context to params. func (w *ServerInterfaceWrapper) ListDatabaseClusters(ctx echo.Context) error { var err error + // ------------- Path parameter "namespace" ------------- + var namespace string + + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ListDatabaseClusters(ctx) + err = w.Handler.ListDatabaseClusters(ctx, namespace) return err } // CreateDatabaseCluster converts echo context to params. func (w *ServerInterfaceWrapper) CreateDatabaseCluster(ctx echo.Context) error { var err error + // ------------- Path parameter "namespace" ------------- + var namespace string + + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.CreateDatabaseCluster(ctx) + err = w.Handler.CreateDatabaseCluster(ctx, namespace) return err } // DeleteDatabaseCluster converts echo context to params. func (w *ServerInterfaceWrapper) DeleteDatabaseCluster(ctx echo.Context) error { var err error + // ------------- Path parameter "namespace" ------------- + var namespace string + + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + // ------------- Path parameter "name" ------------- var name string @@ -1589,13 +1743,21 @@ func (w *ServerInterfaceWrapper) DeleteDatabaseCluster(ctx echo.Context) error { } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.DeleteDatabaseCluster(ctx, name) + err = w.Handler.DeleteDatabaseCluster(ctx, namespace, name) return err } // GetDatabaseCluster converts echo context to params. func (w *ServerInterfaceWrapper) GetDatabaseCluster(ctx echo.Context) error { var err error + // ------------- Path parameter "namespace" ------------- + var namespace string + + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + // ------------- Path parameter "name" ------------- var name string @@ -1605,13 +1767,21 @@ func (w *ServerInterfaceWrapper) GetDatabaseCluster(ctx echo.Context) error { } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetDatabaseCluster(ctx, name) + err = w.Handler.GetDatabaseCluster(ctx, namespace, name) return err } // UpdateDatabaseCluster converts echo context to params. func (w *ServerInterfaceWrapper) UpdateDatabaseCluster(ctx echo.Context) error { var err error + // ------------- Path parameter "namespace" ------------- + var namespace string + + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + // ------------- Path parameter "name" ------------- var name string @@ -1621,13 +1791,21 @@ func (w *ServerInterfaceWrapper) UpdateDatabaseCluster(ctx echo.Context) error { } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.UpdateDatabaseCluster(ctx, name) + err = w.Handler.UpdateDatabaseCluster(ctx, namespace, name) return err } // ListDatabaseClusterBackups converts echo context to params. func (w *ServerInterfaceWrapper) ListDatabaseClusterBackups(ctx echo.Context) error { var err error + // ------------- Path parameter "namespace" ------------- + var namespace string + + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + // ------------- Path parameter "name" ------------- var name string @@ -1637,13 +1815,21 @@ func (w *ServerInterfaceWrapper) ListDatabaseClusterBackups(ctx echo.Context) er } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ListDatabaseClusterBackups(ctx, name) + err = w.Handler.ListDatabaseClusterBackups(ctx, namespace, name) return err } // GetDatabaseClusterCredentials converts echo context to params. func (w *ServerInterfaceWrapper) GetDatabaseClusterCredentials(ctx echo.Context) error { var err error + // ------------- Path parameter "namespace" ------------- + var namespace string + + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + // ------------- Path parameter "name" ------------- var name string @@ -1653,29 +1839,21 @@ func (w *ServerInterfaceWrapper) GetDatabaseClusterCredentials(ctx echo.Context) } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetDatabaseClusterCredentials(ctx, name) + err = w.Handler.GetDatabaseClusterCredentials(ctx, namespace, name) return err } // GetDatabaseClusterPitr converts echo context to params. func (w *ServerInterfaceWrapper) GetDatabaseClusterPitr(ctx echo.Context) error { var err error - // ------------- Path parameter "name" ------------- - var name string + // ------------- Path parameter "namespace" ------------- + var namespace string - err = runtime.BindStyledParameterWithLocation("simple", false, "name", runtime.ParamLocationPath, ctx.Param("name"), &name) + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) } - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetDatabaseClusterPitr(ctx, name) - return err -} - -// ListDatabaseClusterRestores converts echo context to params. -func (w *ServerInterfaceWrapper) ListDatabaseClusterRestores(ctx echo.Context) error { - var err error // ------------- Path parameter "name" ------------- var name string @@ -1685,22 +1863,21 @@ func (w *ServerInterfaceWrapper) ListDatabaseClusterRestores(ctx echo.Context) e } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ListDatabaseClusterRestores(ctx, name) + err = w.Handler.GetDatabaseClusterPitr(ctx, namespace, name) return err } -// ListDatabaseEngines converts echo context to params. -func (w *ServerInterfaceWrapper) ListDatabaseEngines(ctx echo.Context) error { +// ListDatabaseClusterRestores converts echo context to params. +func (w *ServerInterfaceWrapper) ListDatabaseClusterRestores(ctx echo.Context) error { var err error + // ------------- Path parameter "namespace" ------------- + var namespace string - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ListDatabaseEngines(ctx) - return err -} + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } -// GetDatabaseEngine converts echo context to params. -func (w *ServerInterfaceWrapper) GetDatabaseEngine(ctx echo.Context) error { - var err error // ------------- Path parameter "name" ------------- var name string @@ -1710,47 +1887,37 @@ func (w *ServerInterfaceWrapper) GetDatabaseEngine(ctx echo.Context) error { } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetDatabaseEngine(ctx, name) + err = w.Handler.ListDatabaseClusterRestores(ctx, namespace, name) return err } -// UpdateDatabaseEngine converts echo context to params. -func (w *ServerInterfaceWrapper) UpdateDatabaseEngine(ctx echo.Context) error { +// ListDatabaseEngines converts echo context to params. +func (w *ServerInterfaceWrapper) ListDatabaseEngines(ctx echo.Context) error { var err error - // ------------- Path parameter "name" ------------- - var name string + // ------------- Path parameter "namespace" ------------- + var namespace string - err = runtime.BindStyledParameterWithLocation("simple", false, "name", runtime.ParamLocationPath, ctx.Param("name"), &name) + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.UpdateDatabaseEngine(ctx, name) + err = w.Handler.ListDatabaseEngines(ctx, namespace) return err } -// ListMonitoringInstances converts echo context to params. -func (w *ServerInterfaceWrapper) ListMonitoringInstances(ctx echo.Context) error { - var err error - - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.ListMonitoringInstances(ctx) - return err -} - -// CreateMonitoringInstance converts echo context to params. -func (w *ServerInterfaceWrapper) CreateMonitoringInstance(ctx echo.Context) error { +// GetDatabaseEngine converts echo context to params. +func (w *ServerInterfaceWrapper) GetDatabaseEngine(ctx echo.Context) error { var err error + // ------------- Path parameter "namespace" ------------- + var namespace string - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.CreateMonitoringInstance(ctx) - return err -} + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } -// DeleteMonitoringInstance converts echo context to params. -func (w *ServerInterfaceWrapper) DeleteMonitoringInstance(ctx echo.Context) error { - var err error // ------------- Path parameter "name" ------------- var name string @@ -1760,29 +1927,21 @@ func (w *ServerInterfaceWrapper) DeleteMonitoringInstance(ctx echo.Context) erro } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.DeleteMonitoringInstance(ctx, name) + err = w.Handler.GetDatabaseEngine(ctx, namespace, name) return err } -// GetMonitoringInstance converts echo context to params. -func (w *ServerInterfaceWrapper) GetMonitoringInstance(ctx echo.Context) error { +// UpdateDatabaseEngine converts echo context to params. +func (w *ServerInterfaceWrapper) UpdateDatabaseEngine(ctx echo.Context) error { var err error - // ------------- Path parameter "name" ------------- - var name string + // ------------- Path parameter "namespace" ------------- + var namespace string - err = runtime.BindStyledParameterWithLocation("simple", false, "name", runtime.ParamLocationPath, ctx.Param("name"), &name) + err = runtime.BindStyledParameterWithLocation("simple", false, "namespace", runtime.ParamLocationPath, ctx.Param("namespace"), &namespace) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) } - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetMonitoringInstance(ctx, name) - return err -} - -// UpdateMonitoringInstance converts echo context to params. -func (w *ServerInterfaceWrapper) UpdateMonitoringInstance(ctx echo.Context) error { - var err error // ------------- Path parameter "name" ------------- var name string @@ -1792,7 +1951,7 @@ func (w *ServerInterfaceWrapper) UpdateMonitoringInstance(ctx echo.Context) erro } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.UpdateMonitoringInstance(ctx, name) + err = w.Handler.UpdateDatabaseEngine(ctx, namespace, name) return err } @@ -1847,169 +2006,170 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL router.GET(baseURL+"/backup-storages/:name", wrapper.GetBackupStorage) router.PATCH(baseURL+"/backup-storages/:name", wrapper.UpdateBackupStorage) router.GET(baseURL+"/cluster-info", wrapper.GetKubernetesClusterInfo) - router.POST(baseURL+"/cluster-monitoring", wrapper.SetKubernetesClusterMonitoring) - router.POST(baseURL+"/database-cluster-backups", wrapper.CreateDatabaseClusterBackup) - router.DELETE(baseURL+"/database-cluster-backups/:name", wrapper.DeleteDatabaseClusterBackup) - router.GET(baseURL+"/database-cluster-backups/:name", wrapper.GetDatabaseClusterBackup) - router.POST(baseURL+"/database-cluster-restores", wrapper.CreateDatabaseClusterRestore) - router.DELETE(baseURL+"/database-cluster-restores/:name", wrapper.DeleteDatabaseClusterRestore) - router.GET(baseURL+"/database-cluster-restores/:name", wrapper.GetDatabaseClusterRestore) - router.PUT(baseURL+"/database-cluster-restores/:name", wrapper.UpdateDatabaseClusterRestore) - router.GET(baseURL+"/database-clusters", wrapper.ListDatabaseClusters) - router.POST(baseURL+"/database-clusters", wrapper.CreateDatabaseCluster) - router.DELETE(baseURL+"/database-clusters/:name", wrapper.DeleteDatabaseCluster) - router.GET(baseURL+"/database-clusters/:name", wrapper.GetDatabaseCluster) - router.PUT(baseURL+"/database-clusters/:name", wrapper.UpdateDatabaseCluster) - router.GET(baseURL+"/database-clusters/:name/backups", wrapper.ListDatabaseClusterBackups) - router.GET(baseURL+"/database-clusters/:name/credentials", wrapper.GetDatabaseClusterCredentials) - router.GET(baseURL+"/database-clusters/:name/pitr", wrapper.GetDatabaseClusterPitr) - router.GET(baseURL+"/database-clusters/:name/restores", wrapper.ListDatabaseClusterRestores) - router.GET(baseURL+"/database-engines", wrapper.ListDatabaseEngines) - router.GET(baseURL+"/database-engines/:name", wrapper.GetDatabaseEngine) - router.PUT(baseURL+"/database-engines/:name", wrapper.UpdateDatabaseEngine) router.GET(baseURL+"/monitoring-instances", wrapper.ListMonitoringInstances) router.POST(baseURL+"/monitoring-instances", wrapper.CreateMonitoringInstance) router.DELETE(baseURL+"/monitoring-instances/:name", wrapper.DeleteMonitoringInstance) router.GET(baseURL+"/monitoring-instances/:name", wrapper.GetMonitoringInstance) router.PATCH(baseURL+"/monitoring-instances/:name", wrapper.UpdateMonitoringInstance) + router.GET(baseURL+"/namespaces", wrapper.ListNamespaces) + router.POST(baseURL+"/namespaces/:namespace/database-cluster-backups", wrapper.CreateDatabaseClusterBackup) + router.DELETE(baseURL+"/namespaces/:namespace/database-cluster-backups/:name", wrapper.DeleteDatabaseClusterBackup) + router.GET(baseURL+"/namespaces/:namespace/database-cluster-backups/:name", wrapper.GetDatabaseClusterBackup) + router.POST(baseURL+"/namespaces/:namespace/database-cluster-restores", wrapper.CreateDatabaseClusterRestore) + router.DELETE(baseURL+"/namespaces/:namespace/database-cluster-restores/:name", wrapper.DeleteDatabaseClusterRestore) + router.GET(baseURL+"/namespaces/:namespace/database-cluster-restores/:name", wrapper.GetDatabaseClusterRestore) + router.PUT(baseURL+"/namespaces/:namespace/database-cluster-restores/:name", wrapper.UpdateDatabaseClusterRestore) + router.GET(baseURL+"/namespaces/:namespace/database-clusters", wrapper.ListDatabaseClusters) + router.POST(baseURL+"/namespaces/:namespace/database-clusters", wrapper.CreateDatabaseCluster) + router.DELETE(baseURL+"/namespaces/:namespace/database-clusters/:name", wrapper.DeleteDatabaseCluster) + router.GET(baseURL+"/namespaces/:namespace/database-clusters/:name", wrapper.GetDatabaseCluster) + router.PUT(baseURL+"/namespaces/:namespace/database-clusters/:name", wrapper.UpdateDatabaseCluster) + router.GET(baseURL+"/namespaces/:namespace/database-clusters/:name/backups", wrapper.ListDatabaseClusterBackups) + router.GET(baseURL+"/namespaces/:namespace/database-clusters/:name/credentials", wrapper.GetDatabaseClusterCredentials) + router.GET(baseURL+"/namespaces/:namespace/database-clusters/:name/pitr", wrapper.GetDatabaseClusterPitr) + router.GET(baseURL+"/namespaces/:namespace/database-clusters/:name/restores", wrapper.ListDatabaseClusterRestores) + router.GET(baseURL+"/namespaces/:namespace/database-engines", wrapper.ListDatabaseEngines) + router.GET(baseURL+"/namespaces/:namespace/database-engines/:name", wrapper.GetDatabaseEngine) + router.PUT(baseURL+"/namespaces/:namespace/database-engines/:name", wrapper.UpdateDatabaseEngine) router.GET(baseURL+"/resources", wrapper.GetKubernetesClusterResources) router.GET(baseURL+"/version", wrapper.VersionInfo) } // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+x9bXPbNtboX8Gwz0yTrkTbSbuz6y87tuNtfVu3HtvZO3fj3AYiIQlrEmABULaa5r8/", - "gwOAr6BESbbjbviljQUQL+f9HBwcfAwinmacEaZkcPgxkNGcpBj+eYyj2zy7UlzgGdE/4DiminKGkwvB", - "MyIUJTI4nOJEklEQExkJmun24NB+i6T5GFE25SLF0DgKssrXH4NJHt0S9TNOYQ61zEhwGEglKJsFnxrj", - "etpZ14eCzLzfjIL78YyP9Y9jeUuzMc/MpsYZp0wRERwqkZNPI/vdx4CwPA0O3wXydTAK8O+5IMH7UXvC", - "XCSehcBKfsupILEeA5Y7qm7ajlSOyCf/IZHSI9YwIH+iUukJqCIpQO5/BJkGh8FXeyUK9yz+9urIKzYT", - "YCHwUv99IghWpNbtAgtsRt4e05kegygiZAvROIqIlD+SpRdddTKoz3E9JyhKeB4X05jeexFnClNGBGIV", - "UG5DPvUJj1AuiUAxmVJG9Ky6O8yB+BSpOalQNvz55ucr02zoHM2VyuTh3t5tPiGCEUVkSPlezCOp1xyR", - "TMk9viBiQcnd3h0Xt5TNxndUzccG+3JPjyb3voqZHCd4QpIx/BCMAnKP0ywBXN7JcUwWvm3vTvySRIKo", - "Lmw9FWuUNFNd0QqWeYMVnmBJTpJcwnaaqG10QFQCAq+AbzT64M/Y9opML4mOLs7CNkVn9F9ESAvpBgld", - "nNk2S0ZmnoX5TROVmRHoiUokSCaIJEyBlNQ/Y4bMvkJ0RYT+EMk5z5MYRZwtiFBIkIjPGP29GE0ixWGa", - "BCsiFQKUMpygBU5yMkKYxSjFSySIHhflrDICdJEhOufCCOzDgopnVIW3fwMSjnia5oyqJfCeoJNccSH3", - "YrIgyZ6kszEW0ZwqEqlckD2c0TEslulNyTCNvxJE8lxEQMotOrmlLG6D8kfKYo0n7BgRllpCTP+kN315", - "enWN3PgGqgaAZVdZwlLDgbIpEabnVPAURiEsBl6AP6KEEqaQzCcpVRp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ZHejDdSNOMS5DcDaBmOdjqbPnL", - "NDh897G96Jbr/r5JWicXbx2s9D+LJVgxkUJ8EaSC9kiDw+D/v7i5+csf45f/ePHi3f747+//8uLmJoR/", - "ffPyHy//KP76y8uXL168+/H8++uL0/f05R/vWJ7emr/+ePGOnL7vP87Ll//4H4iAlFGZsWZ0LsZ2Xy74", - "kZKUi+XOQDmHYRxczKB/btD4+FyWEeKG7eFiZDWudObeamkaJVh6OORE/+wGLEaCHxXXGrGI4GRESCq1", - "0YUWPMlT6Ea9CkHS38nOuL6ivxc71QMWDljnOv4sCK9qegBVt533cYXCseiHjqWqye4jDQou1UwQ+Vui", - "/5BpPPGHESURVxAFlH6z4W29g9eKh2ZkI8cudARhBNPkDaYsusJ8LsZX36Trvs5wcqyzIqCZckYVNxhp", - "Tn5etBUypvxlNX+VHY3q9MPz3NOrCVSMmmOhk8vQr257aD5n0NeVmA3nOOYuZwx9koOmftFBUwnudLkB", - "aUwgO/moiPhTBoZI6JrMxyPjvGp9Csb3ZGlih8UxRIhuGLrWP2l/lCGcZHNsI1iYxU7k2ziII743S4ZT", - "GjkYHCXOE0ZTglUuCJphRcqxzXh6kjTNlXahQnSmIArGWbJEE03lJupVrAy8g454wWV1k0iQKRGEaVxw", - "pilaaRXG0AWPrzRIar1lG/4rnOo0lwqlWEXzGgXVpsl4HHpA79j3gsdFWKkKCo0PgEKKbyGugFVJQniB", - "aQIhAcokjQnCFZStZVLY0FrftiFLNZmNU5yNb8lSVkdp97LDpDjTgxqbrfsQbmM19Scxuerk8pOxXM2P", - "ExsoSvG9tqsRTnnOICYW8TTLVWkmSwQBZ00KnuD7qsO4mrTcSzHDMzIuhh2XfLQXeCjBnQt86Wi7dOcj", - "DcQZh2gl4hzHgStTjEMl4ilV1jGu8u0IUQgjan8XjD9LMnRqmJ9KRO61c0RVsnReJYlHiKs5EXdUghuO", - "mfaKEjDCAfVjpwHgjCksVxKZ0x5yHxES28melMr6Od0Z1pLQF/EBjVULk0rFM3vK5eJin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7vXEba/F", - "za5hVMG3j8zOW9xjwzb2zuIqNdj+9hhL8n+pmgMHem4zetiu/sBAK35iKpDbipXvvQvWk66usOOfq04P", - "zbroWZq2Dwn7F2G3ddNTyn4ibKYN7IMdZEYPtNVAvyMK4Wpqn9owz7na/uOAfgua7oE8c4ui8orDg/Df", - "aNPPL87Pe+7Q1uzenXn1lC3ZrHmv9SPOqH3T4CEwO6rlPm/N5dI8VPBA1OUR9Rfn522gXWUkCnrKhbdg", - "0j8MaT0qSRnfo0ZS3g1t9pqKR7953DUDpC/+SZWut0fWPirS+UpIi0A7wxanCyKIVC5O4XeUpnmSnPA0", - "pWoXrs0E18vxJ+z2H2bRFbXa0hmoLqscfVTdtM+CoxwccZzRFEdzjf9lmN3O9A8y1L5zuDgINc+cE+ND", - "N+t1mZZK4SfncJt4lVwyNSeKRpWST1AObo4XZIQoi5I81pxs6vNhFqMFFpTnsrhCblR1iI7KoEaKlzCA", - "OYnjDAyGj79AT72cEXIL++St66Moyz3M4VpgfFtNj06rhSIVFOZPqUKcNe7og0BBgqhcMBKboFWZQF48", - "XAFncALNsUQpFyaKWx6Vmcw3E9ihEvEM/5aTIv41IcV7GFRKaDCHijYg48JoldiNRoE59YPwDkQMTZF5", - "QcnC1DFg5B4qt0D0rji0K+B+YqBiyqlHnLmypjCWXpYN/2RcSgrF9qbVndafp9D7juaYzUiMwFc2j3ow", - "hNGU3KGUslyDC5CrdSyJDUgc6l1w0lR7ctA2t1RzWRSDKjBpQOmKTJlLmRFOHKQspA0up1RIVQR5Rihn", - "CZESLXlu1iNIRGgBSsVvCTPxMswQgQCRjQN1VMFMTeHRM0XSE54zTwi43addC0LmE6nRrduA5OzqAR13", - "cxrNy4I7wF3umqlDv9sgFO0pvnQk5PRAjMAg1kgysJYkgeRXqIZJWKtChV25W5REObtl/I4B9Rrw6mEc", - "KhIyVShnwFIsLqq9xTnodUkExQn9vawpViyUlleQ0QtCgf4nJMK5JIgqU5BKoWieM23u6/W7VmULdJpI", - "s7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hAFd3KQfK7wTR9NRgO", + "pulrHW50ja9q0Up5Dr4R33chw2X7xTQPLcoS2RK2QJJS/arZOY1jWl6iuQRRrtw8OBxklKm/fg+YPZW3", + "V/Y+Rbc3zEWr44UinYdpsEm5jrTJmiou5x3l6/s8HIQ4xSFVi//StZ645TU4zj0Ylvbbx2ZFLZMzpkN+", + "c56J49jeq1umqpvvHmNJ/i9VMzhB8dy4K1VmsW/UPhnQiPFN4WxPmWtbaPG9dw16HssLw/iHr7LIzqqM", + "J82Btyo1niZJ85Cte211W4o8oewXwqbaQT3YtLPPnViqwhZbshdc7exSW+UpF9F/GNJvIG8dNs/cQih9", + "nGEnumG47usX5+cdV2hrXj+IYtGzaJgSLY6NH3FK7dcLdrHZw0o68caCL03t/x0xnMcyXZyfN4l2lZJw", + "0FFVvAUveTfc9qBcZtz5Cpd5F7Ted1M85thjD3JubfS90pQY+n71311p+0DJs/jySOunRBry1QpknM6J", + "IFI55MIfOk2yOD7hSULVNkonFVxPx5/C272beRuOtYb6KhuB8rSK3oflRfv8ZcohNMcpTXA40zy4CNLb", + "qf5BBjqaDuYHgWaBc2Ki6iZz6CelUlAuBDcIllwwNSOKhqUiUFAgbobnZIgoC+Ms0orIVOzDLEJzLCjP", + "ZH6p3DgfAToqYI4EL6ADczbHGbhAn36Dlno6Q+Qm9tlb6UdRlnkE1D2B/m19PTopl45UUKo/oQpxVru1", + "D/yOBFGZYCQyMFaRUp5/ygJO5QSaYe1GC4PrFodnJhfOQD1UIp7iPzKSI2Jjkn8hg0oJD8wxo4VoHLBW", + "QnP0FphzQJBSwBBN2XlBydxUNmDkHmq5AJ6XH+PldD8xVDEF1kPOXKFT6EtPywJCKZeSQvm9SXml1Q9W", + "6HWHM8ymJEJcGBKoGWYIowm5QwllmSYXbK52EUhkSOK23sGVpv6To7a5t5rJvDxUvpOGlK7slLmmGeLY", + "UcpS2uzlhAqpcthniDIWEynRgmdmPoKEhOakVPyWMIOgYYYIQEYWGWqpi5mYUqRniiQnPGM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GKiggdEFEyBnOV2tE", + "qXRSeDg4CPaDfZtqz3BKB4eD18F+8MrWsgAu2jPHvCN7zAu/TYlqPzU2XyM2MGr1iFhvbM54Z5F9p3KS", + "LyHRxcSyMNSr/X13gkfM+Ql8SMRs7d5/rIzbta1QItWRIPMA+KhuB0EKJllcSImm0fc7nInJQvYM/pbJ", + "luF/eIzhz5wnYwEIYhsOBzJLEiwWnfdZ4als1EmBlKSU+y5HmBwt+z3nanfOP9MC9d13DpP77jtA5T58", + "+KD/90n/p8DotDaTrx3P3gyG7rHWIu5x6ecih8M8NH8flFrkOSCmgfnz91v9d94mz7uwI8CftTYmbcM0", + "INkoJEwJHI8Obga6xed8ScvXhj9mgixdHrRYssI8AWXJIm3/v+MQQOXfzfity621LtZdrKqhAMy2VwRz", + "kH9265ibEvo74XnPSDZtyCMH16V6RxUmtEcKruBxOSHDZnk8jvbqFdf6imu1ilmitz4PG5Zw75MWiM9G", + "l8XEWwoJfjcm2iEmzbypqkiYd+oiUUpPO3zn/QijVcnNrCwoxYjVzOWFHroP/Fd5d1jag7r79b7B19/7", + "Asie/5bxXzdmaDecXq/rR6LWY68fiXrqvNXrzCfDsx3Ya4mnh1XorcQnFMWxyz92sEHLCAEyCb+2Kke1", + "qTmPChpM7skRfhp8vnu/pj0duptfA0SRAfqtjbr5qaCDqnqv5zlJ8HrStsIDsnczRw55WWqS3EVOOA+G", + "w9/yd/3NJ7oxat789Jks/5XaB+Q7/4A9/21sQbbgBseRt3+Tlg+L64gjd51lPWDKc5/Rj055rsM8JNu1", + "3b7pGW8nOFXLtjsGSzyb3Q5ZHfm6K46NwEJK9EEz/IcinTa4YcdYksjle7nn5pg4JfDNRnRLFgZhrubS", + "M0IiWenrKgtnCMshohPT1SFKk+SDzXD+oP8NnZXftHkqkcOwK2MErSiN52bXw7g0K25wtvg15+2b8eVA", + "G99tuF6Ut0Ju2oVupSS3mY5NkZxz7614H5zjlZ3O8UjL7fuvHNj53sz1YYf3aRXGFZrwjEVPH17yc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iVlr", + "z/3bc/9SZquzvSH7euxeOg1eN0o1PSzzUk9di+dgsvLlPBdbY6nbS9guQ8ecC1qFq+WEyFsIaJWsVM+H", + "vnJxebhznXZJedrHOr2E77Qs1xpCri1o8S3VlRXvcYpDqhZQ37ww2XkHW1W8vyx90vXxyt4Xo/bct3nt", + "+835oln7fl58C7mVGd03H49xeEtY5L6HDJ/wbDCb/YDyQ39RwX3DefNacEtXBd2avTDWMhPx4HCwNz8Y", + "aLNi6Vgnlu5yoWaUTXMsyX5Ss5AEVLomYA2b3o2mfWzvzClyT1d1IGqjbougstarsxxbzBWVICf/nPP7", + "NNuMUhxM+wdxFVHWGOO4/mkT23P1yyaf33/+3wAAAP//6jMNuFv8AAA=", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/everest_test.go b/api/everest_test.go index 4b28c424..1c9a0219 100644 --- a/api/everest_test.go +++ b/api/everest_test.go @@ -23,31 +23,36 @@ import ( func TestBuildProxiedUrl(t *testing.T) { t.Parallel() type tCase struct { - url string - resourceName string - expected string + url string + kind string + name string + expected string } cases := []tCase{ { - url: "/v1/database-clusters", - resourceName: "", - expected: "/apis/everest.percona.com/v1alpha1/namespaces/percona-everest/databaseclusters", + url: "/v1/database-clusters", + kind: "databaseclusters", + name: "", + expected: "/apis/everest.percona.com/v1alpha1/namespaces/percona-everest/databaseclusters", }, { - url: "/v1/database-clusters/snake_case_name", - resourceName: "snake_case_name", - expected: "/apis/everest.percona.com/v1alpha1/namespaces/percona-everest/databaseclusters/snake_case_name", + url: "/v1/database-clusters/snake_case_name", + kind: "databaseclusters", + name: "snake_case_name", + expected: "/apis/everest.percona.com/v1alpha1/namespaces/percona-everest/databaseclusters/snake_case_name", }, { - url: "/v1/database-clusters/kebab-case-name", - resourceName: "kebab-case-name", - expected: "/apis/everest.percona.com/v1alpha1/namespaces/percona-everest/databaseclusters/kebab-case-name", + url: "/v1/database-clusters/kebab-case-name", + kind: "databaseclusters", + name: "kebab-case-name", + expected: "/apis/everest.percona.com/v1alpha1/namespaces/percona-everest/databaseclusters/kebab-case-name", }, { - url: "/v1/database-cluster-restores/kebab-case-name", - resourceName: "kebab-case-name", - expected: "/apis/everest.percona.com/v1alpha1/namespaces/percona-everest/databaseclusterrestores/kebab-case-name", + url: "/v1/database-cluster-restores/kebab-case-name", + kind: "databaseclusterrestores", + name: "kebab-case-name", + expected: "/apis/everest.percona.com/v1alpha1/namespaces/percona-everest/databaseclusterrestores/kebab-case-name", }, } @@ -55,7 +60,7 @@ func TestBuildProxiedUrl(t *testing.T) { tc := testCase t.Run(tc.url, func(t *testing.T) { t.Parallel() - require.Equal(t, tc.expected, buildProxiedURL(tc.url, tc.resourceName, "percona-everest")) + require.Equal(t, tc.expected, buildProxiedURL("percona-everest", tc.kind, tc.name)) }) } } diff --git a/api/kubernetes.go b/api/kubernetes.go index 9659ae1b..e6c56160 100644 --- a/api/kubernetes.go +++ b/api/kubernetes.go @@ -23,7 +23,6 @@ import ( "github.com/AlekSi/pointer" "github.com/labstack/echo/v4" corev1 "k8s.io/api/core/v1" - k8serrors "k8s.io/apimachinery/pkg/api/errors" "github.com/percona/percona-everest-backend/pkg/kubernetes" ) @@ -57,55 +56,6 @@ func (e *EverestServer) GetKubernetesClusterResources(ctx echo.Context) error { return ctx.JSON(http.StatusOK, res) } -// SetKubernetesClusterMonitoring enables or disables Kubernetes cluster monitoring. -func (e *EverestServer) SetKubernetesClusterMonitoring(ctx echo.Context) error { - var params KubernetesClusterMonitoring - if err := ctx.Bind(¶ms); err != nil { - e.l.Error(err) - return ctx.JSON(http.StatusBadRequest, Error{ - Message: pointer.ToString("Could not parse request body"), - }) - } - - if params.Enable { - return e.enableK8sClusterMonitoring(ctx, params) - } - - return e.disableK8sClusterMonitoring(ctx) -} - -func (e *EverestServer) disableK8sClusterMonitoring(ctx echo.Context) error { - if err := e.kubeClient.DeleteVMAgent(); err != nil { - if k8serrors.IsNotFound(err) { - // Nothing to disable - return ctx.NoContent(http.StatusOK) - } - return ctx.JSON(http.StatusInternalServerError, Error{ - Message: pointer.ToString("Could not delete VMAgent"), - }) - } - - return ctx.NoContent(http.StatusOK) -} - -func (e *EverestServer) enableK8sClusterMonitoring(ctx echo.Context, params KubernetesClusterMonitoring) error { - mc, err := e.kubeClient.GetMonitoringConfig(ctx.Request().Context(), params.MonitoringInstanceName) - if err != nil { - e.l.Error(err) - return ctx.JSON(http.StatusInternalServerError, Error{ - Message: pointer.ToString("Could not create VMAgent in Kubernetes"), - }) - } - if err := e.kubeClient.DeployVMAgent(ctx.Request().Context(), mc.Spec.CredentialsSecretName, mc.Spec.PMM.URL); err != nil { - e.l.Error(err) - return ctx.JSON(http.StatusInternalServerError, Error{ - Message: pointer.ToString("Could not create VMAgent in Kubernetes"), - }) - } - - return ctx.NoContent(http.StatusOK) -} - func (e *EverestServer) calculateClusterResources( ctx echo.Context, kubeClient *kubernetes.Kubernetes, clusterType kubernetes.ClusterType, volumes *corev1.PersistentVolumeList, diff --git a/api/monitoring_instance.go b/api/monitoring_instance.go index 93d3b6a3..07ffa34a 100644 --- a/api/monitoring_instance.go +++ b/api/monitoring_instance.go @@ -31,6 +31,11 @@ import ( "github.com/percona/percona-everest-backend/pkg/pmm" ) +const ( + // MonitoringNamespace is the namespace where monitoring configs are created. + MonitoringNamespace = "percona-everest-monitoring" +) + // CreateMonitoringInstance creates a new monitoring instance. func (e *EverestServer) CreateMonitoringInstance(ctx echo.Context) error { params, err := validateCreateMonitoringInstanceRequest(ctx) @@ -38,7 +43,7 @@ func (e *EverestServer) CreateMonitoringInstance(ctx echo.Context) error { return ctx.JSON(http.StatusBadRequest, Error{Message: pointer.ToString(err.Error())}) } c := ctx.Request().Context() - m, err := e.kubeClient.GetMonitoringConfig(c, params.Name) + m, err := e.kubeClient.GetMonitoringConfig(c, MonitoringNamespace, params.Name) if err != nil && !k8serrors.IsNotFound(err) { e.l.Error(err) return ctx.JSON(http.StatusInternalServerError, Error{ @@ -68,9 +73,10 @@ func (e *EverestServer) CreateMonitoringInstance(ctx echo.Context) error { } result := MonitoringInstance{ - Type: MonitoringInstanceBaseWithNameType(params.Type), - Name: params.Name, - Url: params.Url, + Type: MonitoringInstanceBaseWithNameType(params.Type), + Name: params.Name, + Url: params.Url, + TargetNamespaces: params.TargetNamespaces, } return ctx.JSON(http.StatusOK, result) @@ -94,7 +100,7 @@ func (e *EverestServer) createMonitoringK8sResources( secret := &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Name: params.Name, - Namespace: e.kubeClient.Namespace(), + Namespace: MonitoringNamespace, }, Type: corev1.SecretTypeOpaque, StringData: e.monitoringConfigSecretData(apiKey), @@ -114,7 +120,7 @@ func (e *EverestServer) createMonitoringK8sResources( err := e.kubeClient.CreateMonitoringConfig(c, &everestv1alpha1.MonitoringConfig{ ObjectMeta: metav1.ObjectMeta{ Name: params.Name, - Namespace: e.kubeClient.Namespace(), + Namespace: MonitoringNamespace, }, Spec: everestv1alpha1.MonitoringConfigSpec{ Type: everestv1alpha1.MonitoringType(params.Type), @@ -122,12 +128,13 @@ func (e *EverestServer) createMonitoringK8sResources( URL: params.Url, }, CredentialsSecretName: params.Name, + TargetNamespaces: *params.TargetNamespaces, }, }) if err != nil { e.l.Error(err) - if dErr := e.kubeClient.DeleteSecret(c, params.Name); dErr != nil { - return fmt.Errorf("failed cleaning up the secret because failed creating backup storage") + if dErr := e.kubeClient.DeleteSecret(c, MonitoringNamespace, params.Name); dErr != nil { + return fmt.Errorf("failed cleaning up the secret because failed creating monitoring instance") } return fmt.Errorf("failed creating monitoring instance") } @@ -137,7 +144,7 @@ func (e *EverestServer) createMonitoringK8sResources( // ListMonitoringInstances lists all monitoring instances. func (e *EverestServer) ListMonitoringInstances(ctx echo.Context) error { - mcList, err := e.kubeClient.ListMonitoringConfigs(ctx.Request().Context()) + mcList, err := e.kubeClient.ListMonitoringConfigs(ctx.Request().Context(), MonitoringNamespace) if err != nil { e.l.Error(err) return ctx.JSON(http.StatusInternalServerError, Error{Message: pointer.ToString("Could not get a list of monitoring instances")}) @@ -147,9 +154,10 @@ func (e *EverestServer) ListMonitoringInstances(ctx echo.Context) error { for _, mc := range mcList.Items { mc := mc result = append(result, &MonitoringInstance{ - Type: MonitoringInstanceBaseWithNameType(mc.Spec.Type), - Name: mc.Name, - Url: mc.Spec.PMM.URL, + Type: MonitoringInstanceBaseWithNameType(mc.Spec.Type), + Name: mc.Name, + Url: mc.Spec.PMM.URL, + TargetNamespaces: &mc.Spec.TargetNamespaces, }) } return ctx.JSON(http.StatusOK, result) @@ -157,7 +165,7 @@ func (e *EverestServer) ListMonitoringInstances(ctx echo.Context) error { // GetMonitoringInstance retrieves a monitoring instance. func (e *EverestServer) GetMonitoringInstance(ctx echo.Context, name string) error { - m, err := e.kubeClient.GetMonitoringConfig(ctx.Request().Context(), name) + m, err := e.kubeClient.GetMonitoringConfig(ctx.Request().Context(), MonitoringNamespace, name) if err != nil { if k8serrors.IsNotFound(err) { return ctx.JSON(http.StatusNotFound, Error{ @@ -169,9 +177,10 @@ func (e *EverestServer) GetMonitoringInstance(ctx echo.Context, name string) err } return ctx.JSON(http.StatusOK, &MonitoringInstance{ - Type: MonitoringInstanceBaseWithNameType(m.Spec.Type), - Name: m.Name, - Url: m.Spec.PMM.URL, + Type: MonitoringInstanceBaseWithNameType(m.Spec.Type), + Name: m.Name, + Url: m.Spec.PMM.URL, + TargetNamespaces: &m.Spec.TargetNamespaces, }) } @@ -182,7 +191,7 @@ func (e *EverestServer) UpdateMonitoringInstance(ctx echo.Context, name string) if err != nil { return ctx.JSON(http.StatusBadRequest, Error{Message: pointer.ToString(err.Error())}) } - m, err := e.kubeClient.GetMonitoringConfig(c, name) + m, err := e.kubeClient.GetMonitoringConfig(c, MonitoringNamespace, name) if err != nil { if k8serrors.IsNotFound(err) { return ctx.JSON(http.StatusNotFound, Error{ @@ -214,7 +223,7 @@ func (e *EverestServer) UpdateMonitoringInstance(ctx echo.Context, name string) _, err = e.kubeClient.UpdateSecret(c, &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Name: name, - Namespace: e.kubeClient.Namespace(), + Namespace: MonitoringNamespace, }, Type: corev1.SecretTypeOpaque, StringData: e.monitoringConfigSecretData(apiKey), @@ -228,6 +237,9 @@ func (e *EverestServer) UpdateMonitoringInstance(ctx echo.Context, name string) if params.Url != "" { m.Spec.PMM.URL = params.Url } + if params.TargetNamespaces != nil { + m.Spec.TargetNamespaces = *params.TargetNamespaces + } err = e.kubeClient.UpdateMonitoringConfig(c, m) if err != nil { e.l.Error(err) @@ -237,15 +249,16 @@ func (e *EverestServer) UpdateMonitoringInstance(ctx echo.Context, name string) } return ctx.JSON(http.StatusOK, &MonitoringInstance{ - Type: MonitoringInstanceBaseWithNameType(m.Spec.Type), - Name: m.Name, - Url: m.Spec.PMM.URL, + Type: MonitoringInstanceBaseWithNameType(m.Spec.Type), + Name: m.Name, + Url: m.Spec.PMM.URL, + TargetNamespaces: &m.Spec.TargetNamespaces, }) } // DeleteMonitoringInstance deletes a monitoring instance. func (e *EverestServer) DeleteMonitoringInstance(ctx echo.Context, name string) error { - used, err := e.kubeClient.IsMonitoringConfigUsed(ctx.Request().Context(), name) + used, err := e.kubeClient.IsMonitoringConfigUsed(ctx.Request().Context(), MonitoringNamespace, name) if err != nil { if k8serrors.IsNotFound(err) { return ctx.JSON(http.StatusNotFound, Error{ @@ -262,7 +275,7 @@ func (e *EverestServer) DeleteMonitoringInstance(ctx echo.Context, name string) Message: pointer.ToString(fmt.Sprintf("Monitoring instance %s is used", name)), }) } - if err := e.kubeClient.DeleteMonitoringConfig(ctx.Request().Context(), name); err != nil { + if err := e.kubeClient.DeleteMonitoringConfig(ctx.Request().Context(), MonitoringNamespace, name); err != nil { if k8serrors.IsNotFound(err) { return ctx.JSON(http.StatusNotFound, Error{ Message: pointer.ToString("Monitoring instance is not found"), @@ -273,7 +286,7 @@ func (e *EverestServer) DeleteMonitoringInstance(ctx echo.Context, name string) Message: pointer.ToString("Failed to get monitoring instance"), }) } - if err := e.kubeClient.DeleteSecret(ctx.Request().Context(), name); err != nil { + if err := e.kubeClient.DeleteSecret(ctx.Request().Context(), MonitoringNamespace, name); err != nil { if k8serrors.IsNotFound(err) { return ctx.NoContent(http.StatusNoContent) } @@ -287,6 +300,7 @@ func (e *EverestServer) DeleteMonitoringInstance(ctx echo.Context, name string) func (e *EverestServer) monitoringConfigSecretData(apiKey string) map[string]string { return map[string]string{ - "apiKey": apiKey, + "apiKey": apiKey, + "username": "api_key", } } diff --git a/api/namespace.go b/api/namespace.go new file mode 100644 index 00000000..906c0e8d --- /dev/null +++ b/api/namespace.go @@ -0,0 +1,20 @@ +package api + +import ( + "net/http" + + "github.com/AlekSi/pointer" + "github.com/labstack/echo/v4" +) + +// ListNamespaces returns the current version information. +func (e *EverestServer) ListNamespaces(ctx echo.Context) error { + namespaces, err := e.kubeClient.GetDBNamespaces(ctx.Request().Context(), e.kubeClient.Namespace()) + if err != nil { + e.l.Error(err) + return ctx.JSON(http.StatusInternalServerError, Error{ + Message: pointer.ToString("Failed to list namespaces"), + }) + } + return ctx.JSON(http.StatusOK, namespaces) +} diff --git a/api/proxy.go b/api/proxy.go index 29b7f684..05340043 100644 --- a/api/proxy.go +++ b/api/proxy.go @@ -53,7 +53,7 @@ var ( } ) -func (e *EverestServer) proxyKubernetes(ctx echo.Context, resourceName string) error { +func (e *EverestServer) proxyKubernetes(ctx echo.Context, namespace, kind, name string) error { config := e.kubeClient.Config() reverseProxy := httputil.NewSingleHostReverseProxy( &url.URL{ @@ -74,27 +74,22 @@ func (e *EverestServer) proxyKubernetes(ctx echo.Context, resourceName string) e // All requests to Everest are protected by authorization. // We need to remove the header, otherwise Kubernetes returns 401 unauthorized response. req.Header.Del("Authorization") - req.URL.Path = buildProxiedURL(ctx.Request().URL.Path, resourceName, e.kubeClient.Namespace()) + if namespace == "" { + namespace = e.kubeClient.Namespace() + } + req.URL.Path = buildProxiedURL(namespace, kind, name) reverseProxy.ServeHTTP(ctx.Response(), req) return nil } -func buildProxiedURL(uri, resourceName, namespace string) string { - // cut the /kubernetes part - uri = strings.TrimPrefix(uri, "/v1/") - - // cut the resource name if present - uri = strings.TrimSuffix(uri, resourceName) - - // remove kebab-case - uri = strings.ReplaceAll(uri, "-", "") +func buildProxiedURL(namespace, kind, name string) string { proxiedURL := fmt.Sprintf( "/apis/everest.percona.com/v1alpha1/namespaces/%s/%s", url.PathEscape(strings.ReplaceAll(namespace, "/", "")), - url.PathEscape(strings.ReplaceAll(uri, "/", "")), + url.PathEscape(strings.ReplaceAll(kind, "/", "")), ) - if resourceName != "" { - proxiedURL += fmt.Sprintf("/%s", url.PathEscape(strings.ReplaceAll(resourceName, "/", ""))) + if name != "" { + proxiedURL += fmt.Sprintf("/%s", url.PathEscape(strings.ReplaceAll(name, "/", ""))) } return proxiedURL } diff --git a/api/telemetry.go b/api/telemetry.go index ca2ece09..5e9f9a1f 100644 --- a/api/telemetry.go +++ b/api/telemetry.go @@ -103,15 +103,23 @@ func (e *EverestServer) collectMetrics(ctx context.Context, url string) error { return err } - clusters, err := e.kubeClient.ListDatabaseClusters(ctx) + namespaces, err := e.kubeClient.GetDBNamespaces(ctx, e.kubeClient.Namespace()) if err != nil { - e.l.Error(errors.Join(err, errors.New("failed to list database clusters"))) + e.l.Error(errors.Join(err, errors.New("failed to get watched namespaces"))) return err } types := make(map[string]int, 3) - for _, cl := range clusters.Items { - types[string(cl.Spec.Engine.Type)]++ + for _, ns := range namespaces { + clusters, err := e.kubeClient.ListDatabaseClusters(ctx, ns) + if err != nil { + e.l.Error(errors.Join(err, errors.New("failed to list database clusters"))) + return err + } + + for _, cl := range clusters.Items { + types[string(cl.Spec.Engine.Type)]++ + } } // key - the engine type, value - the amount of db clusters of that type diff --git a/api/validation.go b/api/validation.go index 8e845eb0..172b8569 100644 --- a/api/validation.go +++ b/api/validation.go @@ -254,7 +254,44 @@ func azureAccess(ctx context.Context, l *zap.SugaredLogger, accountName, account return nil } -func validateUpdateBackupStorageRequest(ctx echo.Context, bs *everestv1alpha1.BackupStorage, secret *corev1.Secret, l *zap.SugaredLogger) (*UpdateBackupStorageParams, error) { +func validateTargetNamespaces(targetNamespaces, namespaces []string) error { + for _, targetNamespace := range targetNamespaces { + found := false + for _, namespace := range namespaces { + if targetNamespace == namespace { + found = true + break + } + } + if !found { + return fmt.Errorf("unknown namespace '%s'", targetNamespace) + } + } + + return nil +} + +func validateBackupStorageAccess(ctx echo.Context, sType string, url *string, bucketName, region, accessKey, secretKey string, l *zap.SugaredLogger) error { + switch sType { + case string(BackupStorageTypeS3): + if region == "" { + return errors.New("region is required when using S3 storage type") + } + if err := s3Access(l, url, accessKey, secretKey, bucketName, region); err != nil { + return err + } + case string(BackupStorageTypeAzure): + if err := azureAccess(ctx.Request().Context(), l, accessKey, secretKey, bucketName); err != nil { + return err + } + default: + return ErrUpdateStorageNotSupported(sType) + } + + return nil +} + +func validateUpdateBackupStorageRequest(ctx echo.Context, bs *everestv1alpha1.BackupStorage, secret *corev1.Secret, namespaces []string, l *zap.SugaredLogger) (*UpdateBackupStorageParams, error) { var params UpdateBackupStorageParams if err := ctx.Bind(¶ms); err != nil { return nil, err @@ -268,6 +305,13 @@ func validateUpdateBackupStorageRequest(ctx echo.Context, bs *everestv1alpha1.Ba } url = params.Url } + + if params.TargetNamespaces != nil { + if err := validateTargetNamespaces(*params.TargetNamespaces, namespaces); err != nil { + return nil, err + } + } + accessKey := string(secret.Data["AWS_ACCESS_KEY_ID"]) if params.AccessKey != nil { accessKey = *params.AccessKey @@ -281,30 +325,21 @@ func validateUpdateBackupStorageRequest(ctx echo.Context, bs *everestv1alpha1.Ba if params.BucketName != nil { bucketName = *params.BucketName } + region := bs.Spec.Region if params.Region != nil { region = *params.Region } - switch string(bs.Spec.Type) { - case string(BackupStorageTypeS3): - if params.Region != nil && *params.Region == "" { - return nil, errors.New("region is required when using S3 storage type") - } - if err := s3Access(l, url, accessKey, secretKey, bucketName, region); err != nil { - return nil, err - } - case string(BackupStorageTypeAzure): - if err := azureAccess(ctx.Request().Context(), l, accessKey, secretKey, bucketName); err != nil { - return nil, err - } - default: - return nil, ErrUpdateStorageNotSupported(string(bs.Spec.Type)) + + err := validateBackupStorageAccess(ctx, string(bs.Spec.Type), url, bucketName, region, accessKey, secretKey, l) + if err != nil { + return nil, err } return ¶ms, nil } -func validateCreateBackupStorageRequest(ctx echo.Context, l *zap.SugaredLogger) (*CreateBackupStorageParams, error) { +func validateCreateBackupStorageRequest(ctx echo.Context, namespaces []string, l *zap.SugaredLogger) (*CreateBackupStorageParams, error) { var params CreateBackupStorageParams if err := ctx.Bind(¶ms); err != nil { return nil, err @@ -327,6 +362,10 @@ func validateCreateBackupStorageRequest(ctx echo.Context, l *zap.SugaredLogger) } } + if err := validateTargetNamespaces(params.TargetNamespaces, namespaces); err != nil { + return nil, err + } + // check data access if err := validateStorageAccessByCreate(ctx.Request().Context(), params, l); err != nil { l.Error(err) @@ -350,6 +389,10 @@ func validateCreateMonitoringInstanceRequest(ctx echo.Context) (*CreateMonitorin return nil, ErrInvalidURL("url") } + if params.TargetNamespaces == nil || len(*params.TargetNamespaces) == 0 { + return nil, errors.New("targetNamespaces is required") + } + switch params.Type { case MonitoringInstanceCreateParamsTypePmm: if params.Pmm == nil { @@ -379,6 +422,10 @@ func validateUpdateMonitoringInstanceRequest(ctx echo.Context) (*UpdateMonitorin } } + if params.TargetNamespaces != nil && len(*params.TargetNamespaces) == 0 { + return nil, errors.New("targetNamespaces cannot be empty") + } + if err := validateUpdateMonitoringInstanceType(params); err != nil { return nil, err } @@ -424,7 +471,7 @@ func validateCreateDatabaseClusterRequest(dbc DatabaseCluster) error { return validateRFC1035(strName, "metadata.name") } -func (e *EverestServer) validateDatabaseClusterCR(ctx echo.Context, databaseCluster *DatabaseCluster) error { //nolint:cyclop +func (e *EverestServer) validateDatabaseClusterCR(ctx echo.Context, namespace string, databaseCluster *DatabaseCluster) error { //nolint:cyclop if err := validateCreateDatabaseClusterRequest(*databaseCluster); err != nil { return err } @@ -433,7 +480,7 @@ func (e *EverestServer) validateDatabaseClusterCR(ctx echo.Context, databaseClus if !ok { return errors.New("unsupported database engine") } - engine, err := e.kubeClient.GetDatabaseEngine(ctx.Request().Context(), engineName) + engine, err := e.kubeClient.GetDatabaseEngine(ctx.Request().Context(), namespace, engineName) if err != nil { return err } @@ -441,7 +488,7 @@ func (e *EverestServer) validateDatabaseClusterCR(ctx echo.Context, databaseClus return err } if databaseCluster.Spec != nil && databaseCluster.Spec.Monitoring != nil && databaseCluster.Spec.Monitoring.MonitoringConfigName != nil { - if _, err := e.kubeClient.GetMonitoringConfig(context.Background(), *databaseCluster.Spec.Monitoring.MonitoringConfigName); err != nil { + if _, err := e.kubeClient.GetMonitoringConfig(context.Background(), MonitoringNamespace, *databaseCluster.Spec.Monitoring.MonitoringConfigName); err != nil { if k8serrors.IsNotFound(err) { return fmt.Errorf("monitoring config %s does not exist", *databaseCluster.Spec.Monitoring.MonitoringConfigName) } @@ -783,7 +830,7 @@ func validateDatabaseClusterOnUpdate(dbc *DatabaseCluster, oldDB *everestv1alpha return nil } -func validateDatabaseClusterBackup(ctx context.Context, backup *DatabaseClusterBackup, kubeClient *kubernetes.Kubernetes) error { +func validateDatabaseClusterBackup(ctx context.Context, namespace string, backup *DatabaseClusterBackup, kubeClient *kubernetes.Kubernetes) error { if backup == nil { return errors.New("backup cannot be empty") } @@ -804,7 +851,7 @@ func validateDatabaseClusterBackup(ctx context.Context, backup *DatabaseClusterB if b.Spec.DBClusterName == "" { return errors.New(".spec.dbClusterName cannot be empty") } - db, err := kubeClient.GetDatabaseCluster(ctx, b.Spec.DBClusterName) + db, err := kubeClient.GetDatabaseCluster(ctx, namespace, b.Spec.DBClusterName) if err != nil { if k8serrors.IsNotFound(err) { return fmt.Errorf("database cluster %s does not exist", b.Spec.DBClusterName) @@ -827,7 +874,7 @@ func validateDatabaseClusterBackup(ctx context.Context, backup *DatabaseClusterB return nil } -func validateDatabaseClusterRestore(ctx context.Context, restore *DatabaseClusterRestore, kubeClient *kubernetes.Kubernetes) error { +func validateDatabaseClusterRestore(ctx context.Context, namespace string, restore *DatabaseClusterRestore, kubeClient *kubernetes.Kubernetes) error { if restore == nil { return errors.New("restore cannot be empty") } @@ -848,14 +895,14 @@ func validateDatabaseClusterRestore(ctx context.Context, restore *DatabaseCluste if r.Spec.DBClusterName == "" { return errors.New(".spec.dbClusterName cannot be empty") } - _, err = kubeClient.GetDatabaseCluster(ctx, r.Spec.DBClusterName) + _, err = kubeClient.GetDatabaseCluster(ctx, namespace, r.Spec.DBClusterName) if err != nil { if k8serrors.IsNotFound(err) { return fmt.Errorf("database cluster %s does not exist", r.Spec.DBClusterName) } return err } - b, err := kubeClient.GetDatabaseClusterBackup(ctx, r.Spec.DataSource.DBClusterBackupName) + b, err := kubeClient.GetDatabaseClusterBackup(ctx, namespace, r.Spec.DataSource.DBClusterBackupName) if err != nil { if k8serrors.IsNotFound(err) { return fmt.Errorf("backup %s does not exist", r.Spec.DataSource.DBClusterBackupName) diff --git a/client/everest-client.gen.go b/client/everest-client.gen.go index 431934a0..00725140 100644 --- a/client/everest-client.gen.go +++ b/client/everest-client.gen.go @@ -88,12 +88,15 @@ const ( // BackupStorage Backup storage information type BackupStorage struct { - BucketName string `json:"bucketName"` - Description *string `json:"description,omitempty"` - Name string `json:"name"` - Region string `json:"region,omitempty"` - Type BackupStorageType `json:"type"` - Url *string `json:"url,omitempty"` + BucketName string `json:"bucketName"` + Description *string `json:"description,omitempty"` + Name string `json:"name"` + Region string `json:"region,omitempty"` + + // TargetNamespaces List of namespaces allowed to use this backup storage + TargetNamespaces []string `json:"targetNamespaces"` + Type BackupStorageType `json:"type"` + Url *string `json:"url,omitempty"` } // BackupStorageType defines model for BackupStorage.Type. @@ -111,11 +114,14 @@ type CreateBackupStorageParams struct { Description *string `json:"description,omitempty"` // Name A user defined string name of the storage in the DNS name format https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names - Name string `json:"name"` - Region string `json:"region,omitempty"` - SecretKey string `json:"secretKey"` - Type CreateBackupStorageParamsType `json:"type"` - Url *string `json:"url,omitempty"` + Name string `json:"name"` + Region string `json:"region,omitempty"` + SecretKey string `json:"secretKey"` + + // TargetNamespaces List of namespaces allowed to use this backup storage + TargetNamespaces []string `json:"targetNamespaces"` + Type CreateBackupStorageParamsType `json:"type"` + Url *string `json:"url,omitempty"` } // CreateBackupStorageParamsType defines model for CreateBackupStorageParams.Type. @@ -615,14 +621,6 @@ type KubernetesClusterInfo struct { StorageClassNames []string `json:"storageClassNames"` } -// KubernetesClusterMonitoring Kubernetes cluster monitoring configuration -type KubernetesClusterMonitoring struct { - Enable bool `json:"enable"` - - // MonitoringInstanceName Name of the monitoring instance to use for monitoring the Kubernetes cluster - MonitoringInstanceName string `json:"monitoringInstanceName,omitempty"` -} - // KubernetesClusterResources kubernetes cluster resources type KubernetesClusterResources struct { Available ResourcesAvailable `json:"available"` @@ -648,8 +646,10 @@ type MonitoringInstance = MonitoringInstanceBaseWithName // MonitoringInstanceBase Monitoring instance information type MonitoringInstanceBase struct { - Type MonitoringInstanceBaseType `json:"type,omitempty"` - Url string `json:"url,omitempty"` + // TargetNamespaces List of namespaces allowed to use this monitoring instance + TargetNamespaces *[]string `json:"targetNamespaces,omitempty"` + Type MonitoringInstanceBaseType `json:"type,omitempty"` + Url string `json:"url,omitempty"` } // MonitoringInstanceBaseType defines model for MonitoringInstanceBase.Type. @@ -658,9 +658,12 @@ type MonitoringInstanceBaseType string // MonitoringInstanceBaseWithName defines model for MonitoringInstanceBaseWithName. type MonitoringInstanceBaseWithName struct { // Name A user defined string name of the storage in the DNS name format https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names - Name string `json:"name,omitempty"` - Type MonitoringInstanceBaseWithNameType `json:"type,omitempty"` - Url string `json:"url,omitempty"` + Name string `json:"name,omitempty"` + + // TargetNamespaces List of namespaces allowed to use this monitoring instance + TargetNamespaces *[]string `json:"targetNamespaces,omitempty"` + Type MonitoringInstanceBaseWithNameType `json:"type,omitempty"` + Url string `json:"url,omitempty"` } // MonitoringInstanceBaseWithNameType defines model for MonitoringInstanceBaseWithName.Type. @@ -669,10 +672,13 @@ type MonitoringInstanceBaseWithNameType string // MonitoringInstanceCreateParams defines model for MonitoringInstanceCreateParams. type MonitoringInstanceCreateParams struct { // Name A user defined string name of the storage in the DNS name format https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names - Name string `json:"name,omitempty"` - Pmm *PMMMonitoringInstanceSpec `json:"pmm,omitempty"` - Type MonitoringInstanceCreateParamsType `json:"type,omitempty"` - Url string `json:"url,omitempty"` + Name string `json:"name,omitempty"` + Pmm *PMMMonitoringInstanceSpec `json:"pmm,omitempty"` + + // TargetNamespaces List of namespaces allowed to use this monitoring instance + TargetNamespaces *[]string `json:"targetNamespaces,omitempty"` + Type MonitoringInstanceCreateParamsType `json:"type,omitempty"` + Url string `json:"url,omitempty"` } // PMMMonitoringInstanceSpec defines model for . @@ -692,9 +698,12 @@ type MonitoringInstancePMM struct { // MonitoringInstanceUpdateParams defines model for MonitoringInstanceUpdateParams. type MonitoringInstanceUpdateParams struct { - Pmm *PMMMonitoringInstanceSpec `json:"pmm,omitempty"` - Type MonitoringInstanceUpdateParamsType `json:"type,omitempty"` - Url string `json:"url,omitempty"` + Pmm *PMMMonitoringInstanceSpec `json:"pmm,omitempty"` + + // TargetNamespaces List of namespaces allowed to use this monitoring instance + TargetNamespaces *[]string `json:"targetNamespaces,omitempty"` + Type MonitoringInstanceUpdateParamsType `json:"type,omitempty"` + Url string `json:"url,omitempty"` } // MonitoringInstanceUpdateParamsType defines model for MonitoringInstanceUpdateParams.Type. @@ -703,6 +712,9 @@ type MonitoringInstanceUpdateParamsType string // MonitoringInstancesList defines model for MonitoringInstancesList. type MonitoringInstancesList = []MonitoringInstance +// NamespaceList defines model for NamespaceList. +type NamespaceList = []string + // UpdateBackupStorageParams Backup storage parameters type UpdateBackupStorageParams struct { AccessKey *string `json:"accessKey,omitempty"` @@ -712,7 +724,10 @@ type UpdateBackupStorageParams struct { Description *string `json:"description,omitempty"` Region *string `json:"region,omitempty"` SecretKey *string `json:"secretKey,omitempty"` - Url *string `json:"url,omitempty"` + + // TargetNamespaces List of namespaces allowed to use this backup storage + TargetNamespaces *[]string `json:"targetNamespaces,omitempty"` + Url *string `json:"url,omitempty"` } // Version Everest version info @@ -809,8 +824,11 @@ type CreateBackupStorageJSONRequestBody = CreateBackupStorageParams // UpdateBackupStorageJSONRequestBody defines body for UpdateBackupStorage for application/json ContentType. type UpdateBackupStorageJSONRequestBody = UpdateBackupStorageParams -// SetKubernetesClusterMonitoringJSONRequestBody defines body for SetKubernetesClusterMonitoring for application/json ContentType. -type SetKubernetesClusterMonitoringJSONRequestBody = KubernetesClusterMonitoring +// CreateMonitoringInstanceJSONRequestBody defines body for CreateMonitoringInstance for application/json ContentType. +type CreateMonitoringInstanceJSONRequestBody = MonitoringInstanceCreateParams + +// UpdateMonitoringInstanceJSONRequestBody defines body for UpdateMonitoringInstance for application/json ContentType. +type UpdateMonitoringInstanceJSONRequestBody = MonitoringInstanceUpdateParams // CreateDatabaseClusterBackupJSONRequestBody defines body for CreateDatabaseClusterBackup for application/json ContentType. type CreateDatabaseClusterBackupJSONRequestBody = DatabaseClusterBackup @@ -830,12 +848,6 @@ type UpdateDatabaseClusterJSONRequestBody = DatabaseCluster // UpdateDatabaseEngineJSONRequestBody defines body for UpdateDatabaseEngine for application/json ContentType. type UpdateDatabaseEngineJSONRequestBody = DatabaseEngine -// CreateMonitoringInstanceJSONRequestBody defines body for CreateMonitoringInstance for application/json ContentType. -type CreateMonitoringInstanceJSONRequestBody = MonitoringInstanceCreateParams - -// UpdateMonitoringInstanceJSONRequestBody defines body for UpdateMonitoringInstance for application/json ContentType. -type UpdateMonitoringInstanceJSONRequestBody = MonitoringInstanceUpdateParams - // AsDatabaseClusterSpecEngineResourcesCpu0 returns the union data inside the DatabaseCluster_Spec_Engine_Resources_Cpu as a DatabaseClusterSpecEngineResourcesCpu0 func (t DatabaseCluster_Spec_Engine_Resources_Cpu) AsDatabaseClusterSpecEngineResourcesCpu0() (DatabaseClusterSpecEngineResourcesCpu0, error) { var body DatabaseClusterSpecEngineResourcesCpu0 @@ -1365,98 +1377,96 @@ type ClientInterface interface { // GetKubernetesClusterInfo request GetKubernetesClusterInfo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // SetKubernetesClusterMonitoringWithBody request with any body - SetKubernetesClusterMonitoringWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListMonitoringInstances request + ListMonitoringInstances(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateMonitoringInstanceWithBody request with any body + CreateMonitoringInstanceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateMonitoringInstance(ctx context.Context, body CreateMonitoringInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteMonitoringInstance request + DeleteMonitoringInstance(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetMonitoringInstance request + GetMonitoringInstance(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateMonitoringInstanceWithBody request with any body + UpdateMonitoringInstanceWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - SetKubernetesClusterMonitoring(ctx context.Context, body SetKubernetesClusterMonitoringJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateMonitoringInstance(ctx context.Context, name string, body UpdateMonitoringInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListNamespaces request + ListNamespaces(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateDatabaseClusterBackupWithBody request with any body - CreateDatabaseClusterBackupWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + CreateDatabaseClusterBackupWithBody(ctx context.Context, namespace string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateDatabaseClusterBackup(ctx context.Context, body CreateDatabaseClusterBackupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + CreateDatabaseClusterBackup(ctx context.Context, namespace string, body CreateDatabaseClusterBackupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteDatabaseClusterBackup request - DeleteDatabaseClusterBackup(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + DeleteDatabaseClusterBackup(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetDatabaseClusterBackup request - GetDatabaseClusterBackup(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetDatabaseClusterBackup(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateDatabaseClusterRestoreWithBody request with any body - CreateDatabaseClusterRestoreWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + CreateDatabaseClusterRestoreWithBody(ctx context.Context, namespace string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateDatabaseClusterRestore(ctx context.Context, body CreateDatabaseClusterRestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + CreateDatabaseClusterRestore(ctx context.Context, namespace string, body CreateDatabaseClusterRestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteDatabaseClusterRestore request - DeleteDatabaseClusterRestore(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + DeleteDatabaseClusterRestore(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetDatabaseClusterRestore request - GetDatabaseClusterRestore(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetDatabaseClusterRestore(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateDatabaseClusterRestoreWithBody request with any body - UpdateDatabaseClusterRestoreWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateDatabaseClusterRestoreWithBody(ctx context.Context, namespace string, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - UpdateDatabaseClusterRestore(ctx context.Context, name string, body UpdateDatabaseClusterRestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateDatabaseClusterRestore(ctx context.Context, namespace string, name string, body UpdateDatabaseClusterRestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListDatabaseClusters request - ListDatabaseClusters(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + ListDatabaseClusters(ctx context.Context, namespace string, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateDatabaseClusterWithBody request with any body - CreateDatabaseClusterWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + CreateDatabaseClusterWithBody(ctx context.Context, namespace string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateDatabaseCluster(ctx context.Context, body CreateDatabaseClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + CreateDatabaseCluster(ctx context.Context, namespace string, body CreateDatabaseClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteDatabaseCluster request - DeleteDatabaseCluster(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + DeleteDatabaseCluster(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetDatabaseCluster request - GetDatabaseCluster(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetDatabaseCluster(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateDatabaseClusterWithBody request with any body - UpdateDatabaseClusterWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateDatabaseClusterWithBody(ctx context.Context, namespace string, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - UpdateDatabaseCluster(ctx context.Context, name string, body UpdateDatabaseClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateDatabaseCluster(ctx context.Context, namespace string, name string, body UpdateDatabaseClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListDatabaseClusterBackups request - ListDatabaseClusterBackups(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + ListDatabaseClusterBackups(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetDatabaseClusterCredentials request - GetDatabaseClusterCredentials(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetDatabaseClusterCredentials(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetDatabaseClusterPitr request - GetDatabaseClusterPitr(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetDatabaseClusterPitr(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) // ListDatabaseClusterRestores request - ListDatabaseClusterRestores(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + ListDatabaseClusterRestores(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) // ListDatabaseEngines request - ListDatabaseEngines(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + ListDatabaseEngines(ctx context.Context, namespace string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetDatabaseEngine request - GetDatabaseEngine(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetDatabaseEngine(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateDatabaseEngineWithBody request with any body - UpdateDatabaseEngineWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - UpdateDatabaseEngine(ctx context.Context, name string, body UpdateDatabaseEngineJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ListMonitoringInstances request - ListMonitoringInstances(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // CreateMonitoringInstanceWithBody request with any body - CreateMonitoringInstanceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - CreateMonitoringInstance(ctx context.Context, body CreateMonitoringInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteMonitoringInstance request - DeleteMonitoringInstance(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetMonitoringInstance request - GetMonitoringInstance(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // UpdateMonitoringInstanceWithBody request with any body - UpdateMonitoringInstanceWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateDatabaseEngineWithBody(ctx context.Context, namespace string, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - UpdateMonitoringInstance(ctx context.Context, name string, body UpdateMonitoringInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateDatabaseEngine(ctx context.Context, namespace string, name string, body UpdateDatabaseEngineJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetKubernetesClusterResources request GetKubernetesClusterResources(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1561,20 +1571,8 @@ func (c *Client) GetKubernetesClusterInfo(ctx context.Context, reqEditors ...Req return c.Client.Do(req) } -func (c *Client) SetKubernetesClusterMonitoringWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSetKubernetesClusterMonitoringRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) SetKubernetesClusterMonitoring(ctx context.Context, body SetKubernetesClusterMonitoringJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewSetKubernetesClusterMonitoringRequest(c.Server, body) +func (c *Client) ListMonitoringInstances(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListMonitoringInstancesRequest(c.Server) if err != nil { return nil, err } @@ -1585,8 +1583,8 @@ func (c *Client) SetKubernetesClusterMonitoring(ctx context.Context, body SetKub return c.Client.Do(req) } -func (c *Client) CreateDatabaseClusterBackupWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateDatabaseClusterBackupRequestWithBody(c.Server, contentType, body) +func (c *Client) CreateMonitoringInstanceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateMonitoringInstanceRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } @@ -1597,8 +1595,8 @@ func (c *Client) CreateDatabaseClusterBackupWithBody(ctx context.Context, conten return c.Client.Do(req) } -func (c *Client) CreateDatabaseClusterBackup(ctx context.Context, body CreateDatabaseClusterBackupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateDatabaseClusterBackupRequest(c.Server, body) +func (c *Client) CreateMonitoringInstance(ctx context.Context, body CreateMonitoringInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateMonitoringInstanceRequest(c.Server, body) if err != nil { return nil, err } @@ -1609,8 +1607,8 @@ func (c *Client) CreateDatabaseClusterBackup(ctx context.Context, body CreateDat return c.Client.Do(req) } -func (c *Client) DeleteDatabaseClusterBackup(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteDatabaseClusterBackupRequest(c.Server, name) +func (c *Client) DeleteMonitoringInstance(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteMonitoringInstanceRequest(c.Server, name) if err != nil { return nil, err } @@ -1621,8 +1619,8 @@ func (c *Client) DeleteDatabaseClusterBackup(ctx context.Context, name string, r return c.Client.Do(req) } -func (c *Client) GetDatabaseClusterBackup(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetDatabaseClusterBackupRequest(c.Server, name) +func (c *Client) GetMonitoringInstance(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetMonitoringInstanceRequest(c.Server, name) if err != nil { return nil, err } @@ -1633,8 +1631,8 @@ func (c *Client) GetDatabaseClusterBackup(ctx context.Context, name string, reqE return c.Client.Do(req) } -func (c *Client) CreateDatabaseClusterRestoreWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateDatabaseClusterRestoreRequestWithBody(c.Server, contentType, body) +func (c *Client) UpdateMonitoringInstanceWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateMonitoringInstanceRequestWithBody(c.Server, name, contentType, body) if err != nil { return nil, err } @@ -1645,8 +1643,8 @@ func (c *Client) CreateDatabaseClusterRestoreWithBody(ctx context.Context, conte return c.Client.Do(req) } -func (c *Client) CreateDatabaseClusterRestore(ctx context.Context, body CreateDatabaseClusterRestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateDatabaseClusterRestoreRequest(c.Server, body) +func (c *Client) UpdateMonitoringInstance(ctx context.Context, name string, body UpdateMonitoringInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateMonitoringInstanceRequest(c.Server, name, body) if err != nil { return nil, err } @@ -1657,8 +1655,8 @@ func (c *Client) CreateDatabaseClusterRestore(ctx context.Context, body CreateDa return c.Client.Do(req) } -func (c *Client) DeleteDatabaseClusterRestore(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteDatabaseClusterRestoreRequest(c.Server, name) +func (c *Client) ListNamespaces(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListNamespacesRequest(c.Server) if err != nil { return nil, err } @@ -1669,8 +1667,8 @@ func (c *Client) DeleteDatabaseClusterRestore(ctx context.Context, name string, return c.Client.Do(req) } -func (c *Client) GetDatabaseClusterRestore(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetDatabaseClusterRestoreRequest(c.Server, name) +func (c *Client) CreateDatabaseClusterBackupWithBody(ctx context.Context, namespace string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateDatabaseClusterBackupRequestWithBody(c.Server, namespace, contentType, body) if err != nil { return nil, err } @@ -1681,8 +1679,8 @@ func (c *Client) GetDatabaseClusterRestore(ctx context.Context, name string, req return c.Client.Do(req) } -func (c *Client) UpdateDatabaseClusterRestoreWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateDatabaseClusterRestoreRequestWithBody(c.Server, name, contentType, body) +func (c *Client) CreateDatabaseClusterBackup(ctx context.Context, namespace string, body CreateDatabaseClusterBackupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateDatabaseClusterBackupRequest(c.Server, namespace, body) if err != nil { return nil, err } @@ -1693,8 +1691,8 @@ func (c *Client) UpdateDatabaseClusterRestoreWithBody(ctx context.Context, name return c.Client.Do(req) } -func (c *Client) UpdateDatabaseClusterRestore(ctx context.Context, name string, body UpdateDatabaseClusterRestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateDatabaseClusterRestoreRequest(c.Server, name, body) +func (c *Client) DeleteDatabaseClusterBackup(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteDatabaseClusterBackupRequest(c.Server, namespace, name) if err != nil { return nil, err } @@ -1705,8 +1703,8 @@ func (c *Client) UpdateDatabaseClusterRestore(ctx context.Context, name string, return c.Client.Do(req) } -func (c *Client) ListDatabaseClusters(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListDatabaseClustersRequest(c.Server) +func (c *Client) GetDatabaseClusterBackup(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetDatabaseClusterBackupRequest(c.Server, namespace, name) if err != nil { return nil, err } @@ -1717,8 +1715,8 @@ func (c *Client) ListDatabaseClusters(ctx context.Context, reqEditors ...Request return c.Client.Do(req) } -func (c *Client) CreateDatabaseClusterWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateDatabaseClusterRequestWithBody(c.Server, contentType, body) +func (c *Client) CreateDatabaseClusterRestoreWithBody(ctx context.Context, namespace string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateDatabaseClusterRestoreRequestWithBody(c.Server, namespace, contentType, body) if err != nil { return nil, err } @@ -1729,8 +1727,8 @@ func (c *Client) CreateDatabaseClusterWithBody(ctx context.Context, contentType return c.Client.Do(req) } -func (c *Client) CreateDatabaseCluster(ctx context.Context, body CreateDatabaseClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateDatabaseClusterRequest(c.Server, body) +func (c *Client) CreateDatabaseClusterRestore(ctx context.Context, namespace string, body CreateDatabaseClusterRestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateDatabaseClusterRestoreRequest(c.Server, namespace, body) if err != nil { return nil, err } @@ -1741,8 +1739,8 @@ func (c *Client) CreateDatabaseCluster(ctx context.Context, body CreateDatabaseC return c.Client.Do(req) } -func (c *Client) DeleteDatabaseCluster(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteDatabaseClusterRequest(c.Server, name) +func (c *Client) DeleteDatabaseClusterRestore(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteDatabaseClusterRestoreRequest(c.Server, namespace, name) if err != nil { return nil, err } @@ -1753,8 +1751,8 @@ func (c *Client) DeleteDatabaseCluster(ctx context.Context, name string, reqEdit return c.Client.Do(req) } -func (c *Client) GetDatabaseCluster(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetDatabaseClusterRequest(c.Server, name) +func (c *Client) GetDatabaseClusterRestore(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetDatabaseClusterRestoreRequest(c.Server, namespace, name) if err != nil { return nil, err } @@ -1765,8 +1763,8 @@ func (c *Client) GetDatabaseCluster(ctx context.Context, name string, reqEditors return c.Client.Do(req) } -func (c *Client) UpdateDatabaseClusterWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateDatabaseClusterRequestWithBody(c.Server, name, contentType, body) +func (c *Client) UpdateDatabaseClusterRestoreWithBody(ctx context.Context, namespace string, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateDatabaseClusterRestoreRequestWithBody(c.Server, namespace, name, contentType, body) if err != nil { return nil, err } @@ -1777,8 +1775,8 @@ func (c *Client) UpdateDatabaseClusterWithBody(ctx context.Context, name string, return c.Client.Do(req) } -func (c *Client) UpdateDatabaseCluster(ctx context.Context, name string, body UpdateDatabaseClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateDatabaseClusterRequest(c.Server, name, body) +func (c *Client) UpdateDatabaseClusterRestore(ctx context.Context, namespace string, name string, body UpdateDatabaseClusterRestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateDatabaseClusterRestoreRequest(c.Server, namespace, name, body) if err != nil { return nil, err } @@ -1789,8 +1787,8 @@ func (c *Client) UpdateDatabaseCluster(ctx context.Context, name string, body Up return c.Client.Do(req) } -func (c *Client) ListDatabaseClusterBackups(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListDatabaseClusterBackupsRequest(c.Server, name) +func (c *Client) ListDatabaseClusters(ctx context.Context, namespace string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListDatabaseClustersRequest(c.Server, namespace) if err != nil { return nil, err } @@ -1801,8 +1799,8 @@ func (c *Client) ListDatabaseClusterBackups(ctx context.Context, name string, re return c.Client.Do(req) } -func (c *Client) GetDatabaseClusterCredentials(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetDatabaseClusterCredentialsRequest(c.Server, name) +func (c *Client) CreateDatabaseClusterWithBody(ctx context.Context, namespace string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateDatabaseClusterRequestWithBody(c.Server, namespace, contentType, body) if err != nil { return nil, err } @@ -1813,8 +1811,8 @@ func (c *Client) GetDatabaseClusterCredentials(ctx context.Context, name string, return c.Client.Do(req) } -func (c *Client) GetDatabaseClusterPitr(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetDatabaseClusterPitrRequest(c.Server, name) +func (c *Client) CreateDatabaseCluster(ctx context.Context, namespace string, body CreateDatabaseClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateDatabaseClusterRequest(c.Server, namespace, body) if err != nil { return nil, err } @@ -1825,8 +1823,8 @@ func (c *Client) GetDatabaseClusterPitr(ctx context.Context, name string, reqEdi return c.Client.Do(req) } -func (c *Client) ListDatabaseClusterRestores(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListDatabaseClusterRestoresRequest(c.Server, name) +func (c *Client) DeleteDatabaseCluster(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteDatabaseClusterRequest(c.Server, namespace, name) if err != nil { return nil, err } @@ -1837,8 +1835,8 @@ func (c *Client) ListDatabaseClusterRestores(ctx context.Context, name string, r return c.Client.Do(req) } -func (c *Client) ListDatabaseEngines(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListDatabaseEnginesRequest(c.Server) +func (c *Client) GetDatabaseCluster(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetDatabaseClusterRequest(c.Server, namespace, name) if err != nil { return nil, err } @@ -1849,8 +1847,8 @@ func (c *Client) ListDatabaseEngines(ctx context.Context, reqEditors ...RequestE return c.Client.Do(req) } -func (c *Client) GetDatabaseEngine(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetDatabaseEngineRequest(c.Server, name) +func (c *Client) UpdateDatabaseClusterWithBody(ctx context.Context, namespace string, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateDatabaseClusterRequestWithBody(c.Server, namespace, name, contentType, body) if err != nil { return nil, err } @@ -1861,8 +1859,8 @@ func (c *Client) GetDatabaseEngine(ctx context.Context, name string, reqEditors return c.Client.Do(req) } -func (c *Client) UpdateDatabaseEngineWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateDatabaseEngineRequestWithBody(c.Server, name, contentType, body) +func (c *Client) UpdateDatabaseCluster(ctx context.Context, namespace string, name string, body UpdateDatabaseClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateDatabaseClusterRequest(c.Server, namespace, name, body) if err != nil { return nil, err } @@ -1873,8 +1871,8 @@ func (c *Client) UpdateDatabaseEngineWithBody(ctx context.Context, name string, return c.Client.Do(req) } -func (c *Client) UpdateDatabaseEngine(ctx context.Context, name string, body UpdateDatabaseEngineJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateDatabaseEngineRequest(c.Server, name, body) +func (c *Client) ListDatabaseClusterBackups(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListDatabaseClusterBackupsRequest(c.Server, namespace, name) if err != nil { return nil, err } @@ -1885,8 +1883,8 @@ func (c *Client) UpdateDatabaseEngine(ctx context.Context, name string, body Upd return c.Client.Do(req) } -func (c *Client) ListMonitoringInstances(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListMonitoringInstancesRequest(c.Server) +func (c *Client) GetDatabaseClusterCredentials(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetDatabaseClusterCredentialsRequest(c.Server, namespace, name) if err != nil { return nil, err } @@ -1897,8 +1895,8 @@ func (c *Client) ListMonitoringInstances(ctx context.Context, reqEditors ...Requ return c.Client.Do(req) } -func (c *Client) CreateMonitoringInstanceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateMonitoringInstanceRequestWithBody(c.Server, contentType, body) +func (c *Client) GetDatabaseClusterPitr(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetDatabaseClusterPitrRequest(c.Server, namespace, name) if err != nil { return nil, err } @@ -1909,8 +1907,8 @@ func (c *Client) CreateMonitoringInstanceWithBody(ctx context.Context, contentTy return c.Client.Do(req) } -func (c *Client) CreateMonitoringInstance(ctx context.Context, body CreateMonitoringInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateMonitoringInstanceRequest(c.Server, body) +func (c *Client) ListDatabaseClusterRestores(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListDatabaseClusterRestoresRequest(c.Server, namespace, name) if err != nil { return nil, err } @@ -1921,8 +1919,8 @@ func (c *Client) CreateMonitoringInstance(ctx context.Context, body CreateMonito return c.Client.Do(req) } -func (c *Client) DeleteMonitoringInstance(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteMonitoringInstanceRequest(c.Server, name) +func (c *Client) ListDatabaseEngines(ctx context.Context, namespace string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListDatabaseEnginesRequest(c.Server, namespace) if err != nil { return nil, err } @@ -1933,8 +1931,8 @@ func (c *Client) DeleteMonitoringInstance(ctx context.Context, name string, reqE return c.Client.Do(req) } -func (c *Client) GetMonitoringInstance(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetMonitoringInstanceRequest(c.Server, name) +func (c *Client) GetDatabaseEngine(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetDatabaseEngineRequest(c.Server, namespace, name) if err != nil { return nil, err } @@ -1945,8 +1943,8 @@ func (c *Client) GetMonitoringInstance(ctx context.Context, name string, reqEdit return c.Client.Do(req) } -func (c *Client) UpdateMonitoringInstanceWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateMonitoringInstanceRequestWithBody(c.Server, name, contentType, body) +func (c *Client) UpdateDatabaseEngineWithBody(ctx context.Context, namespace string, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateDatabaseEngineRequestWithBody(c.Server, namespace, name, contentType, body) if err != nil { return nil, err } @@ -1957,8 +1955,8 @@ func (c *Client) UpdateMonitoringInstanceWithBody(ctx context.Context, name stri return c.Client.Do(req) } -func (c *Client) UpdateMonitoringInstance(ctx context.Context, name string, body UpdateMonitoringInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateMonitoringInstanceRequest(c.Server, name, body) +func (c *Client) UpdateDatabaseEngine(ctx context.Context, namespace string, name string, body UpdateDatabaseEngineJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateDatabaseEngineRequest(c.Server, namespace, name, body) if err != nil { return nil, err } @@ -2202,19 +2200,8 @@ func NewGetKubernetesClusterInfoRequest(server string) (*http.Request, error) { return req, nil } -// NewSetKubernetesClusterMonitoringRequest calls the generic SetKubernetesClusterMonitoring builder with application/json body -func NewSetKubernetesClusterMonitoringRequest(server string, body SetKubernetesClusterMonitoringJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewSetKubernetesClusterMonitoringRequestWithBody(server, "application/json", bodyReader) -} - -// NewSetKubernetesClusterMonitoringRequestWithBody generates requests for SetKubernetesClusterMonitoring with any type of body -func NewSetKubernetesClusterMonitoringRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewListMonitoringInstancesRequest generates requests for ListMonitoringInstances +func NewListMonitoringInstancesRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -2222,7 +2209,7 @@ func NewSetKubernetesClusterMonitoringRequestWithBody(server string, contentType return nil, err } - operationPath := fmt.Sprintf("/cluster-monitoring") + operationPath := fmt.Sprintf("/monitoring-instances") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2232,29 +2219,27 @@ func NewSetKubernetesClusterMonitoringRequestWithBody(server string, contentType return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewCreateDatabaseClusterBackupRequest calls the generic CreateDatabaseClusterBackup builder with application/json body -func NewCreateDatabaseClusterBackupRequest(server string, body CreateDatabaseClusterBackupJSONRequestBody) (*http.Request, error) { +// NewCreateMonitoringInstanceRequest calls the generic CreateMonitoringInstance builder with application/json body +func NewCreateMonitoringInstanceRequest(server string, body CreateMonitoringInstanceJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateDatabaseClusterBackupRequestWithBody(server, "application/json", bodyReader) + return NewCreateMonitoringInstanceRequestWithBody(server, "application/json", bodyReader) } -// NewCreateDatabaseClusterBackupRequestWithBody generates requests for CreateDatabaseClusterBackup with any type of body -func NewCreateDatabaseClusterBackupRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateMonitoringInstanceRequestWithBody generates requests for CreateMonitoringInstance with any type of body +func NewCreateMonitoringInstanceRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -2262,7 +2247,7 @@ func NewCreateDatabaseClusterBackupRequestWithBody(server string, contentType st return nil, err } - operationPath := fmt.Sprintf("/database-cluster-backups") + operationPath := fmt.Sprintf("/monitoring-instances") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2282,8 +2267,8 @@ func NewCreateDatabaseClusterBackupRequestWithBody(server string, contentType st return req, nil } -// NewDeleteDatabaseClusterBackupRequest generates requests for DeleteDatabaseClusterBackup -func NewDeleteDatabaseClusterBackupRequest(server string, name string) (*http.Request, error) { +// NewDeleteMonitoringInstanceRequest generates requests for DeleteMonitoringInstance +func NewDeleteMonitoringInstanceRequest(server string, name string) (*http.Request, error) { var err error var pathParam0 string @@ -2298,7 +2283,7 @@ func NewDeleteDatabaseClusterBackupRequest(server string, name string) (*http.Re return nil, err } - operationPath := fmt.Sprintf("/database-cluster-backups/%s", pathParam0) + operationPath := fmt.Sprintf("/monitoring-instances/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2316,8 +2301,8 @@ func NewDeleteDatabaseClusterBackupRequest(server string, name string) (*http.Re return req, nil } -// NewGetDatabaseClusterBackupRequest generates requests for GetDatabaseClusterBackup -func NewGetDatabaseClusterBackupRequest(server string, name string) (*http.Request, error) { +// NewGetMonitoringInstanceRequest generates requests for GetMonitoringInstance +func NewGetMonitoringInstanceRequest(server string, name string) (*http.Request, error) { var err error var pathParam0 string @@ -2332,7 +2317,7 @@ func NewGetDatabaseClusterBackupRequest(server string, name string) (*http.Reque return nil, err } - operationPath := fmt.Sprintf("/database-cluster-backups/%s", pathParam0) + operationPath := fmt.Sprintf("/monitoring-instances/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2350,27 +2335,34 @@ func NewGetDatabaseClusterBackupRequest(server string, name string) (*http.Reque return req, nil } -// NewCreateDatabaseClusterRestoreRequest calls the generic CreateDatabaseClusterRestore builder with application/json body -func NewCreateDatabaseClusterRestoreRequest(server string, body CreateDatabaseClusterRestoreJSONRequestBody) (*http.Request, error) { +// NewUpdateMonitoringInstanceRequest calls the generic UpdateMonitoringInstance builder with application/json body +func NewUpdateMonitoringInstanceRequest(server string, name string, body UpdateMonitoringInstanceJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateDatabaseClusterRestoreRequestWithBody(server, "application/json", bodyReader) + return NewUpdateMonitoringInstanceRequestWithBody(server, name, "application/json", bodyReader) } -// NewCreateDatabaseClusterRestoreRequestWithBody generates requests for CreateDatabaseClusterRestore with any type of body -func NewCreateDatabaseClusterRestoreRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateMonitoringInstanceRequestWithBody generates requests for UpdateMonitoringInstance with any type of body +func NewUpdateMonitoringInstanceRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/database-cluster-restores") + operationPath := fmt.Sprintf("/monitoring-instances/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2380,7 +2372,7 @@ func NewCreateDatabaseClusterRestoreRequestWithBody(server string, contentType s return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("PATCH", queryURL.String(), body) if err != nil { return nil, err } @@ -2390,23 +2382,16 @@ func NewCreateDatabaseClusterRestoreRequestWithBody(server string, contentType s return req, nil } -// NewDeleteDatabaseClusterRestoreRequest generates requests for DeleteDatabaseClusterRestore -func NewDeleteDatabaseClusterRestoreRequest(server string, name string) (*http.Request, error) { +// NewListNamespacesRequest generates requests for ListNamespaces +func NewListNamespacesRequest(server string) (*http.Request, error) { var err error - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/database-cluster-restores/%s", pathParam0) + operationPath := fmt.Sprintf("/namespaces") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2416,7 +2401,7 @@ func NewDeleteDatabaseClusterRestoreRequest(server string, name string) (*http.R return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -2424,13 +2409,24 @@ func NewDeleteDatabaseClusterRestoreRequest(server string, name string) (*http.R return req, nil } -// NewGetDatabaseClusterRestoreRequest generates requests for GetDatabaseClusterRestore -func NewGetDatabaseClusterRestoreRequest(server string, name string) (*http.Request, error) { +// NewCreateDatabaseClusterBackupRequest calls the generic CreateDatabaseClusterBackup builder with application/json body +func NewCreateDatabaseClusterBackupRequest(server string, namespace string, body CreateDatabaseClusterBackupJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateDatabaseClusterBackupRequestWithBody(server, namespace, "application/json", bodyReader) +} + +// NewCreateDatabaseClusterBackupRequestWithBody generates requests for CreateDatabaseClusterBackup with any type of body +func NewCreateDatabaseClusterBackupRequestWithBody(server string, namespace string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) if err != nil { return nil, err } @@ -2440,7 +2436,7 @@ func NewGetDatabaseClusterRestoreRequest(server string, name string) (*http.Requ return nil, err } - operationPath := fmt.Sprintf("/database-cluster-restores/%s", pathParam0) + operationPath := fmt.Sprintf("/namespaces/%s/database-cluster-backups", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2450,32 +2446,30 @@ func NewGetDatabaseClusterRestoreRequest(server string, name string) (*http.Requ return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewUpdateDatabaseClusterRestoreRequest calls the generic UpdateDatabaseClusterRestore builder with application/json body -func NewUpdateDatabaseClusterRestoreRequest(server string, name string, body UpdateDatabaseClusterRestoreJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// NewDeleteDatabaseClusterBackupRequest generates requests for DeleteDatabaseClusterBackup +func NewDeleteDatabaseClusterBackupRequest(server string, namespace string, name string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewUpdateDatabaseClusterRestoreRequestWithBody(server, name, "application/json", bodyReader) -} - -// NewUpdateDatabaseClusterRestoreRequestWithBody generates requests for UpdateDatabaseClusterRestore with any type of body -func NewUpdateDatabaseClusterRestoreRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error) { - var err error - var pathParam0 string + var pathParam1 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) if err != nil { return nil, err } @@ -2485,7 +2479,7 @@ func NewUpdateDatabaseClusterRestoreRequestWithBody(server string, name string, return nil, err } - operationPath := fmt.Sprintf("/database-cluster-restores/%s", pathParam0) + operationPath := fmt.Sprintf("/namespaces/%s/database-cluster-backups/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2495,26 +2489,38 @@ func NewUpdateDatabaseClusterRestoreRequestWithBody(server string, name string, return nil, err } - req, err := http.NewRequest("PUT", queryURL.String(), body) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewListDatabaseClustersRequest generates requests for ListDatabaseClusters -func NewListDatabaseClustersRequest(server string) (*http.Request, error) { +// NewGetDatabaseClusterBackupRequest generates requests for GetDatabaseClusterBackup +func NewGetDatabaseClusterBackupRequest(server string, namespace string, name string) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/database-clusters") + operationPath := fmt.Sprintf("/namespaces/%s/database-cluster-backups/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2532,27 +2538,34 @@ func NewListDatabaseClustersRequest(server string) (*http.Request, error) { return req, nil } -// NewCreateDatabaseClusterRequest calls the generic CreateDatabaseCluster builder with application/json body -func NewCreateDatabaseClusterRequest(server string, body CreateDatabaseClusterJSONRequestBody) (*http.Request, error) { +// NewCreateDatabaseClusterRestoreRequest calls the generic CreateDatabaseClusterRestore builder with application/json body +func NewCreateDatabaseClusterRestoreRequest(server string, namespace string, body CreateDatabaseClusterRestoreJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateDatabaseClusterRequestWithBody(server, "application/json", bodyReader) + return NewCreateDatabaseClusterRestoreRequestWithBody(server, namespace, "application/json", bodyReader) } -// NewCreateDatabaseClusterRequestWithBody generates requests for CreateDatabaseCluster with any type of body -func NewCreateDatabaseClusterRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateDatabaseClusterRestoreRequestWithBody generates requests for CreateDatabaseClusterRestore with any type of body +func NewCreateDatabaseClusterRestoreRequestWithBody(server string, namespace string, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/database-clusters") + operationPath := fmt.Sprintf("/namespaces/%s/database-cluster-restores", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2572,13 +2585,20 @@ func NewCreateDatabaseClusterRequestWithBody(server string, contentType string, return req, nil } -// NewDeleteDatabaseClusterRequest generates requests for DeleteDatabaseCluster -func NewDeleteDatabaseClusterRequest(server string, name string) (*http.Request, error) { +// NewDeleteDatabaseClusterRestoreRequest generates requests for DeleteDatabaseClusterRestore +func NewDeleteDatabaseClusterRestoreRequest(server string, namespace string, name string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) if err != nil { return nil, err } @@ -2588,7 +2608,7 @@ func NewDeleteDatabaseClusterRequest(server string, name string) (*http.Request, return nil, err } - operationPath := fmt.Sprintf("/database-clusters/%s", pathParam0) + operationPath := fmt.Sprintf("/namespaces/%s/database-cluster-restores/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2606,13 +2626,20 @@ func NewDeleteDatabaseClusterRequest(server string, name string) (*http.Request, return req, nil } -// NewGetDatabaseClusterRequest generates requests for GetDatabaseCluster -func NewGetDatabaseClusterRequest(server string, name string) (*http.Request, error) { +// NewGetDatabaseClusterRestoreRequest generates requests for GetDatabaseClusterRestore +func NewGetDatabaseClusterRestoreRequest(server string, namespace string, name string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) if err != nil { return nil, err } @@ -2622,7 +2649,7 @@ func NewGetDatabaseClusterRequest(server string, name string) (*http.Request, er return nil, err } - operationPath := fmt.Sprintf("/database-clusters/%s", pathParam0) + operationPath := fmt.Sprintf("/namespaces/%s/database-cluster-restores/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2640,24 +2667,31 @@ func NewGetDatabaseClusterRequest(server string, name string) (*http.Request, er return req, nil } -// NewUpdateDatabaseClusterRequest calls the generic UpdateDatabaseCluster builder with application/json body -func NewUpdateDatabaseClusterRequest(server string, name string, body UpdateDatabaseClusterJSONRequestBody) (*http.Request, error) { +// NewUpdateDatabaseClusterRestoreRequest calls the generic UpdateDatabaseClusterRestore builder with application/json body +func NewUpdateDatabaseClusterRestoreRequest(server string, namespace string, name string, body UpdateDatabaseClusterRestoreJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateDatabaseClusterRequestWithBody(server, name, "application/json", bodyReader) + return NewUpdateDatabaseClusterRestoreRequestWithBody(server, namespace, name, "application/json", bodyReader) } -// NewUpdateDatabaseClusterRequestWithBody generates requests for UpdateDatabaseCluster with any type of body -func NewUpdateDatabaseClusterRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateDatabaseClusterRestoreRequestWithBody generates requests for UpdateDatabaseClusterRestore with any type of body +func NewUpdateDatabaseClusterRestoreRequestWithBody(server string, namespace string, name string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) if err != nil { return nil, err } @@ -2667,7 +2701,7 @@ func NewUpdateDatabaseClusterRequestWithBody(server string, name string, content return nil, err } - operationPath := fmt.Sprintf("/database-clusters/%s", pathParam0) + operationPath := fmt.Sprintf("/namespaces/%s/database-cluster-restores/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2687,13 +2721,13 @@ func NewUpdateDatabaseClusterRequestWithBody(server string, name string, content return req, nil } -// NewListDatabaseClusterBackupsRequest generates requests for ListDatabaseClusterBackups -func NewListDatabaseClusterBackupsRequest(server string, name string) (*http.Request, error) { +// NewListDatabaseClustersRequest generates requests for ListDatabaseClusters +func NewListDatabaseClustersRequest(server string, namespace string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) if err != nil { return nil, err } @@ -2703,7 +2737,7 @@ func NewListDatabaseClusterBackupsRequest(server string, name string) (*http.Req return nil, err } - operationPath := fmt.Sprintf("/database-clusters/%s/backups", pathParam0) + operationPath := fmt.Sprintf("/namespaces/%s/database-clusters", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2721,13 +2755,24 @@ func NewListDatabaseClusterBackupsRequest(server string, name string) (*http.Req return req, nil } -// NewGetDatabaseClusterCredentialsRequest generates requests for GetDatabaseClusterCredentials -func NewGetDatabaseClusterCredentialsRequest(server string, name string) (*http.Request, error) { +// NewCreateDatabaseClusterRequest calls the generic CreateDatabaseCluster builder with application/json body +func NewCreateDatabaseClusterRequest(server string, namespace string, body CreateDatabaseClusterJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateDatabaseClusterRequestWithBody(server, namespace, "application/json", bodyReader) +} + +// NewCreateDatabaseClusterRequestWithBody generates requests for CreateDatabaseCluster with any type of body +func NewCreateDatabaseClusterRequestWithBody(server string, namespace string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) if err != nil { return nil, err } @@ -2737,7 +2782,7 @@ func NewGetDatabaseClusterCredentialsRequest(server string, name string) (*http. return nil, err } - operationPath := fmt.Sprintf("/database-clusters/%s/credentials", pathParam0) + operationPath := fmt.Sprintf("/namespaces/%s/database-clusters", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2747,21 +2792,30 @@ func NewGetDatabaseClusterCredentialsRequest(server string, name string) (*http. return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewGetDatabaseClusterPitrRequest generates requests for GetDatabaseClusterPitr -func NewGetDatabaseClusterPitrRequest(server string, name string) (*http.Request, error) { +// NewDeleteDatabaseClusterRequest generates requests for DeleteDatabaseCluster +func NewDeleteDatabaseClusterRequest(server string, namespace string, name string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) if err != nil { return nil, err } @@ -2771,7 +2825,7 @@ func NewGetDatabaseClusterPitrRequest(server string, name string) (*http.Request return nil, err } - operationPath := fmt.Sprintf("/database-clusters/%s/pitr", pathParam0) + operationPath := fmt.Sprintf("/namespaces/%s/database-clusters/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2781,7 +2835,7 @@ func NewGetDatabaseClusterPitrRequest(server string, name string) (*http.Request return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } @@ -2789,13 +2843,20 @@ func NewGetDatabaseClusterPitrRequest(server string, name string) (*http.Request return req, nil } -// NewListDatabaseClusterRestoresRequest generates requests for ListDatabaseClusterRestores -func NewListDatabaseClusterRestoresRequest(server string, name string) (*http.Request, error) { +// NewGetDatabaseClusterRequest generates requests for GetDatabaseCluster +func NewGetDatabaseClusterRequest(server string, namespace string, name string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) if err != nil { return nil, err } @@ -2805,7 +2866,7 @@ func NewListDatabaseClusterRestoresRequest(server string, name string) (*http.Re return nil, err } - operationPath := fmt.Sprintf("/database-clusters/%s/restores", pathParam0) + operationPath := fmt.Sprintf("/namespaces/%s/database-clusters/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2823,16 +2884,41 @@ func NewListDatabaseClusterRestoresRequest(server string, name string) (*http.Re return req, nil } -// NewListDatabaseEnginesRequest generates requests for ListDatabaseEngines -func NewListDatabaseEnginesRequest(server string) (*http.Request, error) { +// NewUpdateDatabaseClusterRequest calls the generic UpdateDatabaseCluster builder with application/json body +func NewUpdateDatabaseClusterRequest(server string, namespace string, name string, body UpdateDatabaseClusterJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateDatabaseClusterRequestWithBody(server, namespace, name, "application/json", bodyReader) +} + +// NewUpdateDatabaseClusterRequestWithBody generates requests for UpdateDatabaseCluster with any type of body +func NewUpdateDatabaseClusterRequestWithBody(server string, namespace string, name string, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/database-engines") + operationPath := fmt.Sprintf("/namespaces/%s/database-clusters/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2842,21 +2928,30 @@ func NewListDatabaseEnginesRequest(server string) (*http.Request, error) { return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("PUT", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewGetDatabaseEngineRequest generates requests for GetDatabaseEngine -func NewGetDatabaseEngineRequest(server string, name string) (*http.Request, error) { +// NewListDatabaseClusterBackupsRequest generates requests for ListDatabaseClusterBackups +func NewListDatabaseClusterBackupsRequest(server string, namespace string, name string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) if err != nil { return nil, err } @@ -2866,7 +2961,7 @@ func NewGetDatabaseEngineRequest(server string, name string) (*http.Request, err return nil, err } - operationPath := fmt.Sprintf("/database-engines/%s", pathParam0) + operationPath := fmt.Sprintf("/namespaces/%s/database-clusters/%s/backups", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2884,24 +2979,20 @@ func NewGetDatabaseEngineRequest(server string, name string) (*http.Request, err return req, nil } -// NewUpdateDatabaseEngineRequest calls the generic UpdateDatabaseEngine builder with application/json body -func NewUpdateDatabaseEngineRequest(server string, name string, body UpdateDatabaseEngineJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// NewGetDatabaseClusterCredentialsRequest generates requests for GetDatabaseClusterCredentials +func NewGetDatabaseClusterCredentialsRequest(server string, namespace string, name string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewUpdateDatabaseEngineRequestWithBody(server, name, "application/json", bodyReader) -} - -// NewUpdateDatabaseEngineRequestWithBody generates requests for UpdateDatabaseEngine with any type of body -func NewUpdateDatabaseEngineRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error) { - var err error - var pathParam0 string + var pathParam1 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) if err != nil { return nil, err } @@ -2911,7 +3002,7 @@ func NewUpdateDatabaseEngineRequestWithBody(server string, name string, contentT return nil, err } - operationPath := fmt.Sprintf("/database-engines/%s", pathParam0) + operationPath := fmt.Sprintf("/namespaces/%s/database-clusters/%s/credentials", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2921,26 +3012,38 @@ func NewUpdateDatabaseEngineRequestWithBody(server string, name string, contentT return nil, err } - req, err := http.NewRequest("PUT", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewListMonitoringInstancesRequest generates requests for ListMonitoringInstances -func NewListMonitoringInstancesRequest(server string) (*http.Request, error) { +// NewGetDatabaseClusterPitrRequest generates requests for GetDatabaseClusterPitr +func NewGetDatabaseClusterPitrRequest(server string, namespace string, name string) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/monitoring-instances") + operationPath := fmt.Sprintf("/namespaces/%s/database-clusters/%s/pitr", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2958,27 +3061,30 @@ func NewListMonitoringInstancesRequest(server string) (*http.Request, error) { return req, nil } -// NewCreateMonitoringInstanceRequest calls the generic CreateMonitoringInstance builder with application/json body -func NewCreateMonitoringInstanceRequest(server string, body CreateMonitoringInstanceJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// NewListDatabaseClusterRestoresRequest generates requests for ListDatabaseClusterRestores +func NewListDatabaseClusterRestoresRequest(server string, namespace string, name string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewCreateMonitoringInstanceRequestWithBody(server, "application/json", bodyReader) -} -// NewCreateMonitoringInstanceRequestWithBody generates requests for CreateMonitoringInstance with any type of body -func NewCreateMonitoringInstanceRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/monitoring-instances") + operationPath := fmt.Sprintf("/namespaces/%s/database-clusters/%s/restores", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2988,23 +3094,21 @@ func NewCreateMonitoringInstanceRequestWithBody(server string, contentType strin return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewDeleteMonitoringInstanceRequest generates requests for DeleteMonitoringInstance -func NewDeleteMonitoringInstanceRequest(server string, name string) (*http.Request, error) { +// NewListDatabaseEnginesRequest generates requests for ListDatabaseEngines +func NewListDatabaseEnginesRequest(server string, namespace string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) if err != nil { return nil, err } @@ -3014,7 +3118,7 @@ func NewDeleteMonitoringInstanceRequest(server string, name string) (*http.Reque return nil, err } - operationPath := fmt.Sprintf("/monitoring-instances/%s", pathParam0) + operationPath := fmt.Sprintf("/namespaces/%s/database-engines", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3024,7 +3128,7 @@ func NewDeleteMonitoringInstanceRequest(server string, name string) (*http.Reque return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -3032,13 +3136,20 @@ func NewDeleteMonitoringInstanceRequest(server string, name string) (*http.Reque return req, nil } -// NewGetMonitoringInstanceRequest generates requests for GetMonitoringInstance -func NewGetMonitoringInstanceRequest(server string, name string) (*http.Request, error) { +// NewGetDatabaseEngineRequest generates requests for GetDatabaseEngine +func NewGetDatabaseEngineRequest(server string, namespace string, name string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) if err != nil { return nil, err } @@ -3048,7 +3159,7 @@ func NewGetMonitoringInstanceRequest(server string, name string) (*http.Request, return nil, err } - operationPath := fmt.Sprintf("/monitoring-instances/%s", pathParam0) + operationPath := fmt.Sprintf("/namespaces/%s/database-engines/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3066,24 +3177,31 @@ func NewGetMonitoringInstanceRequest(server string, name string) (*http.Request, return req, nil } -// NewUpdateMonitoringInstanceRequest calls the generic UpdateMonitoringInstance builder with application/json body -func NewUpdateMonitoringInstanceRequest(server string, name string, body UpdateMonitoringInstanceJSONRequestBody) (*http.Request, error) { +// NewUpdateDatabaseEngineRequest calls the generic UpdateDatabaseEngine builder with application/json body +func NewUpdateDatabaseEngineRequest(server string, namespace string, name string, body UpdateDatabaseEngineJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateMonitoringInstanceRequestWithBody(server, name, "application/json", bodyReader) + return NewUpdateDatabaseEngineRequestWithBody(server, namespace, name, "application/json", bodyReader) } -// NewUpdateMonitoringInstanceRequestWithBody generates requests for UpdateMonitoringInstance with any type of body -func NewUpdateMonitoringInstanceRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateDatabaseEngineRequestWithBody generates requests for UpdateDatabaseEngine with any type of body +func NewUpdateDatabaseEngineRequestWithBody(server string, namespace string, name string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "namespace", runtime.ParamLocationPath, namespace) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) if err != nil { return nil, err } @@ -3093,7 +3211,7 @@ func NewUpdateMonitoringInstanceRequestWithBody(server string, name string, cont return nil, err } - operationPath := fmt.Sprintf("/monitoring-instances/%s", pathParam0) + operationPath := fmt.Sprintf("/namespaces/%s/database-engines/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3103,7 +3221,7 @@ func NewUpdateMonitoringInstanceRequestWithBody(server string, name string, cont return nil, err } - req, err := http.NewRequest("PATCH", queryURL.String(), body) + req, err := http.NewRequest("PUT", queryURL.String(), body) if err != nil { return nil, err } @@ -3232,98 +3350,96 @@ type ClientWithResponsesInterface interface { // GetKubernetesClusterInfoWithResponse request GetKubernetesClusterInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetKubernetesClusterInfoResponse, error) - // SetKubernetesClusterMonitoringWithBodyWithResponse request with any body - SetKubernetesClusterMonitoringWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetKubernetesClusterMonitoringResponse, error) + // ListMonitoringInstancesWithResponse request + ListMonitoringInstancesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListMonitoringInstancesResponse, error) + + // CreateMonitoringInstanceWithBodyWithResponse request with any body + CreateMonitoringInstanceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateMonitoringInstanceResponse, error) + + CreateMonitoringInstanceWithResponse(ctx context.Context, body CreateMonitoringInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMonitoringInstanceResponse, error) + + // DeleteMonitoringInstanceWithResponse request + DeleteMonitoringInstanceWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*DeleteMonitoringInstanceResponse, error) + + // GetMonitoringInstanceWithResponse request + GetMonitoringInstanceWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetMonitoringInstanceResponse, error) + + // UpdateMonitoringInstanceWithBodyWithResponse request with any body + UpdateMonitoringInstanceWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMonitoringInstanceResponse, error) + + UpdateMonitoringInstanceWithResponse(ctx context.Context, name string, body UpdateMonitoringInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMonitoringInstanceResponse, error) - SetKubernetesClusterMonitoringWithResponse(ctx context.Context, body SetKubernetesClusterMonitoringJSONRequestBody, reqEditors ...RequestEditorFn) (*SetKubernetesClusterMonitoringResponse, error) + // ListNamespacesWithResponse request + ListNamespacesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListNamespacesResponse, error) // CreateDatabaseClusterBackupWithBodyWithResponse request with any body - CreateDatabaseClusterBackupWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterBackupResponse, error) + CreateDatabaseClusterBackupWithBodyWithResponse(ctx context.Context, namespace string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterBackupResponse, error) - CreateDatabaseClusterBackupWithResponse(ctx context.Context, body CreateDatabaseClusterBackupJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterBackupResponse, error) + CreateDatabaseClusterBackupWithResponse(ctx context.Context, namespace string, body CreateDatabaseClusterBackupJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterBackupResponse, error) // DeleteDatabaseClusterBackupWithResponse request - DeleteDatabaseClusterBackupWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*DeleteDatabaseClusterBackupResponse, error) + DeleteDatabaseClusterBackupWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*DeleteDatabaseClusterBackupResponse, error) // GetDatabaseClusterBackupWithResponse request - GetDatabaseClusterBackupWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterBackupResponse, error) + GetDatabaseClusterBackupWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterBackupResponse, error) // CreateDatabaseClusterRestoreWithBodyWithResponse request with any body - CreateDatabaseClusterRestoreWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterRestoreResponse, error) + CreateDatabaseClusterRestoreWithBodyWithResponse(ctx context.Context, namespace string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterRestoreResponse, error) - CreateDatabaseClusterRestoreWithResponse(ctx context.Context, body CreateDatabaseClusterRestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterRestoreResponse, error) + CreateDatabaseClusterRestoreWithResponse(ctx context.Context, namespace string, body CreateDatabaseClusterRestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterRestoreResponse, error) // DeleteDatabaseClusterRestoreWithResponse request - DeleteDatabaseClusterRestoreWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*DeleteDatabaseClusterRestoreResponse, error) + DeleteDatabaseClusterRestoreWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*DeleteDatabaseClusterRestoreResponse, error) // GetDatabaseClusterRestoreWithResponse request - GetDatabaseClusterRestoreWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterRestoreResponse, error) + GetDatabaseClusterRestoreWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterRestoreResponse, error) // UpdateDatabaseClusterRestoreWithBodyWithResponse request with any body - UpdateDatabaseClusterRestoreWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDatabaseClusterRestoreResponse, error) + UpdateDatabaseClusterRestoreWithBodyWithResponse(ctx context.Context, namespace string, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDatabaseClusterRestoreResponse, error) - UpdateDatabaseClusterRestoreWithResponse(ctx context.Context, name string, body UpdateDatabaseClusterRestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDatabaseClusterRestoreResponse, error) + UpdateDatabaseClusterRestoreWithResponse(ctx context.Context, namespace string, name string, body UpdateDatabaseClusterRestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDatabaseClusterRestoreResponse, error) // ListDatabaseClustersWithResponse request - ListDatabaseClustersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListDatabaseClustersResponse, error) + ListDatabaseClustersWithResponse(ctx context.Context, namespace string, reqEditors ...RequestEditorFn) (*ListDatabaseClustersResponse, error) // CreateDatabaseClusterWithBodyWithResponse request with any body - CreateDatabaseClusterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterResponse, error) + CreateDatabaseClusterWithBodyWithResponse(ctx context.Context, namespace string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterResponse, error) - CreateDatabaseClusterWithResponse(ctx context.Context, body CreateDatabaseClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterResponse, error) + CreateDatabaseClusterWithResponse(ctx context.Context, namespace string, body CreateDatabaseClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterResponse, error) // DeleteDatabaseClusterWithResponse request - DeleteDatabaseClusterWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*DeleteDatabaseClusterResponse, error) + DeleteDatabaseClusterWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*DeleteDatabaseClusterResponse, error) // GetDatabaseClusterWithResponse request - GetDatabaseClusterWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterResponse, error) + GetDatabaseClusterWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterResponse, error) // UpdateDatabaseClusterWithBodyWithResponse request with any body - UpdateDatabaseClusterWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDatabaseClusterResponse, error) + UpdateDatabaseClusterWithBodyWithResponse(ctx context.Context, namespace string, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDatabaseClusterResponse, error) - UpdateDatabaseClusterWithResponse(ctx context.Context, name string, body UpdateDatabaseClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDatabaseClusterResponse, error) + UpdateDatabaseClusterWithResponse(ctx context.Context, namespace string, name string, body UpdateDatabaseClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDatabaseClusterResponse, error) // ListDatabaseClusterBackupsWithResponse request - ListDatabaseClusterBackupsWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*ListDatabaseClusterBackupsResponse, error) + ListDatabaseClusterBackupsWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*ListDatabaseClusterBackupsResponse, error) // GetDatabaseClusterCredentialsWithResponse request - GetDatabaseClusterCredentialsWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterCredentialsResponse, error) + GetDatabaseClusterCredentialsWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterCredentialsResponse, error) // GetDatabaseClusterPitrWithResponse request - GetDatabaseClusterPitrWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterPitrResponse, error) + GetDatabaseClusterPitrWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterPitrResponse, error) // ListDatabaseClusterRestoresWithResponse request - ListDatabaseClusterRestoresWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*ListDatabaseClusterRestoresResponse, error) + ListDatabaseClusterRestoresWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*ListDatabaseClusterRestoresResponse, error) // ListDatabaseEnginesWithResponse request - ListDatabaseEnginesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListDatabaseEnginesResponse, error) + ListDatabaseEnginesWithResponse(ctx context.Context, namespace string, reqEditors ...RequestEditorFn) (*ListDatabaseEnginesResponse, error) // GetDatabaseEngineWithResponse request - GetDatabaseEngineWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetDatabaseEngineResponse, error) + GetDatabaseEngineWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*GetDatabaseEngineResponse, error) // UpdateDatabaseEngineWithBodyWithResponse request with any body - UpdateDatabaseEngineWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDatabaseEngineResponse, error) - - UpdateDatabaseEngineWithResponse(ctx context.Context, name string, body UpdateDatabaseEngineJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDatabaseEngineResponse, error) - - // ListMonitoringInstancesWithResponse request - ListMonitoringInstancesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListMonitoringInstancesResponse, error) - - // CreateMonitoringInstanceWithBodyWithResponse request with any body - CreateMonitoringInstanceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateMonitoringInstanceResponse, error) - - CreateMonitoringInstanceWithResponse(ctx context.Context, body CreateMonitoringInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMonitoringInstanceResponse, error) - - // DeleteMonitoringInstanceWithResponse request - DeleteMonitoringInstanceWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*DeleteMonitoringInstanceResponse, error) - - // GetMonitoringInstanceWithResponse request - GetMonitoringInstanceWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetMonitoringInstanceResponse, error) + UpdateDatabaseEngineWithBodyWithResponse(ctx context.Context, namespace string, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDatabaseEngineResponse, error) - // UpdateMonitoringInstanceWithBodyWithResponse request with any body - UpdateMonitoringInstanceWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMonitoringInstanceResponse, error) - - UpdateMonitoringInstanceWithResponse(ctx context.Context, name string, body UpdateMonitoringInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMonitoringInstanceResponse, error) + UpdateDatabaseEngineWithResponse(ctx context.Context, namespace string, name string, body UpdateDatabaseEngineJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDatabaseEngineResponse, error) // GetKubernetesClusterResourcesWithResponse request GetKubernetesClusterResourcesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetKubernetesClusterResourcesResponse, error) @@ -3475,15 +3591,16 @@ func (r GetKubernetesClusterInfoResponse) StatusCode() int { return 0 } -type SetKubernetesClusterMonitoringResponse struct { +type ListMonitoringInstancesResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *MonitoringInstancesList JSON400 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r SetKubernetesClusterMonitoringResponse) Status() string { +func (r ListMonitoringInstancesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3491,25 +3608,23 @@ func (r SetKubernetesClusterMonitoringResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r SetKubernetesClusterMonitoringResponse) StatusCode() int { +func (r ListMonitoringInstancesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateDatabaseClusterBackupResponse struct { +type CreateMonitoringInstanceResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DatabaseClusterBackup - JSON201 *DatabaseClusterBackup - JSON202 *DatabaseClusterBackup + JSON200 *MonitoringInstance JSON400 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r CreateDatabaseClusterBackupResponse) Status() string { +func (r CreateMonitoringInstanceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3517,23 +3632,23 @@ func (r CreateDatabaseClusterBackupResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateDatabaseClusterBackupResponse) StatusCode() int { +func (r CreateMonitoringInstanceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteDatabaseClusterBackupResponse struct { +type DeleteMonitoringInstanceResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *IoK8sApimachineryPkgApisMetaV1StatusV2 JSON400 *Error + JSON404 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r DeleteDatabaseClusterBackupResponse) Status() string { +func (r DeleteMonitoringInstanceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3541,23 +3656,24 @@ func (r DeleteDatabaseClusterBackupResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteDatabaseClusterBackupResponse) StatusCode() int { +func (r DeleteMonitoringInstanceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetDatabaseClusterBackupResponse struct { +type GetMonitoringInstanceResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DatabaseClusterBackup + JSON200 *MonitoringInstance JSON400 *Error + JSON404 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r GetDatabaseClusterBackupResponse) Status() string { +func (r GetMonitoringInstanceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3565,25 +3681,24 @@ func (r GetDatabaseClusterBackupResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetDatabaseClusterBackupResponse) StatusCode() int { +func (r GetMonitoringInstanceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateDatabaseClusterRestoreResponse struct { +type UpdateMonitoringInstanceResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DatabaseClusterRestore - JSON201 *DatabaseClusterRestore - JSON202 *DatabaseClusterRestore + JSON200 *MonitoringInstance JSON400 *Error + JSON404 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r CreateDatabaseClusterRestoreResponse) Status() string { +func (r UpdateMonitoringInstanceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3591,23 +3706,21 @@ func (r CreateDatabaseClusterRestoreResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateDatabaseClusterRestoreResponse) StatusCode() int { +func (r UpdateMonitoringInstanceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteDatabaseClusterRestoreResponse struct { +type ListNamespacesResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *IoK8sApimachineryPkgApisMetaV1StatusV2 - JSON400 *Error - JSON500 *Error + JSON200 *NamespaceList } // Status returns HTTPResponse.Status -func (r DeleteDatabaseClusterRestoreResponse) Status() string { +func (r ListNamespacesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3615,23 +3728,25 @@ func (r DeleteDatabaseClusterRestoreResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteDatabaseClusterRestoreResponse) StatusCode() int { +func (r ListNamespacesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetDatabaseClusterRestoreResponse struct { +type CreateDatabaseClusterBackupResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DatabaseClusterRestore + JSON200 *DatabaseClusterBackup + JSON201 *DatabaseClusterBackup + JSON202 *DatabaseClusterBackup JSON400 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r GetDatabaseClusterRestoreResponse) Status() string { +func (r CreateDatabaseClusterBackupResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3639,24 +3754,23 @@ func (r GetDatabaseClusterRestoreResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetDatabaseClusterRestoreResponse) StatusCode() int { +func (r CreateDatabaseClusterBackupResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateDatabaseClusterRestoreResponse struct { +type DeleteDatabaseClusterBackupResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DatabaseClusterRestore - JSON201 *DatabaseClusterRestore + JSON200 *IoK8sApimachineryPkgApisMetaV1StatusV2 JSON400 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r UpdateDatabaseClusterRestoreResponse) Status() string { +func (r DeleteDatabaseClusterBackupResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3664,23 +3778,23 @@ func (r UpdateDatabaseClusterRestoreResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateDatabaseClusterRestoreResponse) StatusCode() int { +func (r DeleteDatabaseClusterBackupResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListDatabaseClustersResponse struct { +type GetDatabaseClusterBackupResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DatabaseClusterList + JSON200 *DatabaseClusterBackup JSON400 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r ListDatabaseClustersResponse) Status() string { +func (r GetDatabaseClusterBackupResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3688,25 +3802,25 @@ func (r ListDatabaseClustersResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListDatabaseClustersResponse) StatusCode() int { +func (r GetDatabaseClusterBackupResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateDatabaseClusterResponse struct { +type CreateDatabaseClusterRestoreResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DatabaseCluster - JSON201 *DatabaseCluster - JSON202 *DatabaseCluster + JSON200 *DatabaseClusterRestore + JSON201 *DatabaseClusterRestore + JSON202 *DatabaseClusterRestore JSON400 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r CreateDatabaseClusterResponse) Status() string { +func (r CreateDatabaseClusterRestoreResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3714,14 +3828,14 @@ func (r CreateDatabaseClusterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateDatabaseClusterResponse) StatusCode() int { +func (r CreateDatabaseClusterRestoreResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteDatabaseClusterResponse struct { +type DeleteDatabaseClusterRestoreResponse struct { Body []byte HTTPResponse *http.Response JSON200 *IoK8sApimachineryPkgApisMetaV1StatusV2 @@ -3730,7 +3844,7 @@ type DeleteDatabaseClusterResponse struct { } // Status returns HTTPResponse.Status -func (r DeleteDatabaseClusterResponse) Status() string { +func (r DeleteDatabaseClusterRestoreResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3738,23 +3852,23 @@ func (r DeleteDatabaseClusterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteDatabaseClusterResponse) StatusCode() int { +func (r DeleteDatabaseClusterRestoreResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetDatabaseClusterResponse struct { +type GetDatabaseClusterRestoreResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DatabaseCluster + JSON200 *DatabaseClusterRestore JSON400 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r GetDatabaseClusterResponse) Status() string { +func (r GetDatabaseClusterRestoreResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3762,23 +3876,24 @@ func (r GetDatabaseClusterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetDatabaseClusterResponse) StatusCode() int { +func (r GetDatabaseClusterRestoreResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateDatabaseClusterResponse struct { +type UpdateDatabaseClusterRestoreResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DatabaseCluster + JSON200 *DatabaseClusterRestore + JSON201 *DatabaseClusterRestore JSON400 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r UpdateDatabaseClusterResponse) Status() string { +func (r UpdateDatabaseClusterRestoreResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3786,23 +3901,23 @@ func (r UpdateDatabaseClusterResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateDatabaseClusterResponse) StatusCode() int { +func (r UpdateDatabaseClusterRestoreResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListDatabaseClusterBackupsResponse struct { +type ListDatabaseClustersResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DatabaseClusterBackupList + JSON200 *DatabaseClusterList JSON400 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r ListDatabaseClusterBackupsResponse) Status() string { +func (r ListDatabaseClustersResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3810,23 +3925,25 @@ func (r ListDatabaseClusterBackupsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListDatabaseClusterBackupsResponse) StatusCode() int { +func (r ListDatabaseClustersResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetDatabaseClusterCredentialsResponse struct { +type CreateDatabaseClusterResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DatabaseClusterCredential + JSON200 *DatabaseCluster + JSON201 *DatabaseCluster + JSON202 *DatabaseCluster JSON400 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r GetDatabaseClusterCredentialsResponse) Status() string { +func (r CreateDatabaseClusterResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3834,23 +3951,23 @@ func (r GetDatabaseClusterCredentialsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetDatabaseClusterCredentialsResponse) StatusCode() int { +func (r CreateDatabaseClusterResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetDatabaseClusterPitrResponse struct { +type DeleteDatabaseClusterResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DatabaseClusterPitr + JSON200 *IoK8sApimachineryPkgApisMetaV1StatusV2 JSON400 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r GetDatabaseClusterPitrResponse) Status() string { +func (r DeleteDatabaseClusterResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3858,23 +3975,23 @@ func (r GetDatabaseClusterPitrResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetDatabaseClusterPitrResponse) StatusCode() int { +func (r DeleteDatabaseClusterResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListDatabaseClusterRestoresResponse struct { +type GetDatabaseClusterResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DatabaseClusterRestoreList + JSON200 *DatabaseCluster JSON400 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r ListDatabaseClusterRestoresResponse) Status() string { +func (r GetDatabaseClusterResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3882,23 +3999,23 @@ func (r ListDatabaseClusterRestoresResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListDatabaseClusterRestoresResponse) StatusCode() int { +func (r GetDatabaseClusterResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListDatabaseEnginesResponse struct { +type UpdateDatabaseClusterResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DatabaseEngineList + JSON200 *DatabaseCluster JSON400 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r ListDatabaseEnginesResponse) Status() string { +func (r UpdateDatabaseClusterResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3906,23 +4023,23 @@ func (r ListDatabaseEnginesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListDatabaseEnginesResponse) StatusCode() int { +func (r UpdateDatabaseClusterResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetDatabaseEngineResponse struct { +type ListDatabaseClusterBackupsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DatabaseEngine + JSON200 *DatabaseClusterBackupList JSON400 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r GetDatabaseEngineResponse) Status() string { +func (r ListDatabaseClusterBackupsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3930,23 +4047,23 @@ func (r GetDatabaseEngineResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetDatabaseEngineResponse) StatusCode() int { +func (r ListDatabaseClusterBackupsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateDatabaseEngineResponse struct { +type GetDatabaseClusterCredentialsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DatabaseEngine + JSON200 *DatabaseClusterCredential JSON400 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r UpdateDatabaseEngineResponse) Status() string { +func (r GetDatabaseClusterCredentialsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3954,23 +4071,23 @@ func (r UpdateDatabaseEngineResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateDatabaseEngineResponse) StatusCode() int { +func (r GetDatabaseClusterCredentialsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListMonitoringInstancesResponse struct { +type GetDatabaseClusterPitrResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *MonitoringInstancesList + JSON200 *DatabaseClusterPitr JSON400 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r ListMonitoringInstancesResponse) Status() string { +func (r GetDatabaseClusterPitrResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -3978,23 +4095,23 @@ func (r ListMonitoringInstancesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListMonitoringInstancesResponse) StatusCode() int { +func (r GetDatabaseClusterPitrResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateMonitoringInstanceResponse struct { +type ListDatabaseClusterRestoresResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *MonitoringInstance + JSON200 *DatabaseClusterRestoreList JSON400 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r CreateMonitoringInstanceResponse) Status() string { +func (r ListDatabaseClusterRestoresResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4002,23 +4119,23 @@ func (r CreateMonitoringInstanceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateMonitoringInstanceResponse) StatusCode() int { +func (r ListDatabaseClusterRestoresResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteMonitoringInstanceResponse struct { +type ListDatabaseEnginesResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *DatabaseEngineList JSON400 *Error - JSON404 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r DeleteMonitoringInstanceResponse) Status() string { +func (r ListDatabaseEnginesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4026,24 +4143,23 @@ func (r DeleteMonitoringInstanceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteMonitoringInstanceResponse) StatusCode() int { +func (r ListDatabaseEnginesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetMonitoringInstanceResponse struct { +type GetDatabaseEngineResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *MonitoringInstance + JSON200 *DatabaseEngine JSON400 *Error - JSON404 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r GetMonitoringInstanceResponse) Status() string { +func (r GetDatabaseEngineResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4051,24 +4167,23 @@ func (r GetMonitoringInstanceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetMonitoringInstanceResponse) StatusCode() int { +func (r GetDatabaseEngineResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateMonitoringInstanceResponse struct { +type UpdateDatabaseEngineResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *MonitoringInstance + JSON200 *DatabaseEngine JSON400 *Error - JSON404 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r UpdateMonitoringInstanceResponse) Status() string { +func (r UpdateDatabaseEngineResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4076,7 +4191,7 @@ func (r UpdateMonitoringInstanceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateMonitoringInstanceResponse) StatusCode() int { +func (r UpdateDatabaseEngineResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -4199,34 +4314,87 @@ func (c *ClientWithResponses) GetKubernetesClusterInfoWithResponse(ctx context.C return ParseGetKubernetesClusterInfoResponse(rsp) } -// SetKubernetesClusterMonitoringWithBodyWithResponse request with arbitrary body returning *SetKubernetesClusterMonitoringResponse -func (c *ClientWithResponses) SetKubernetesClusterMonitoringWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetKubernetesClusterMonitoringResponse, error) { - rsp, err := c.SetKubernetesClusterMonitoringWithBody(ctx, contentType, body, reqEditors...) +// ListMonitoringInstancesWithResponse request returning *ListMonitoringInstancesResponse +func (c *ClientWithResponses) ListMonitoringInstancesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListMonitoringInstancesResponse, error) { + rsp, err := c.ListMonitoringInstances(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseListMonitoringInstancesResponse(rsp) +} + +// CreateMonitoringInstanceWithBodyWithResponse request with arbitrary body returning *CreateMonitoringInstanceResponse +func (c *ClientWithResponses) CreateMonitoringInstanceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateMonitoringInstanceResponse, error) { + rsp, err := c.CreateMonitoringInstanceWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateMonitoringInstanceResponse(rsp) +} + +func (c *ClientWithResponses) CreateMonitoringInstanceWithResponse(ctx context.Context, body CreateMonitoringInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMonitoringInstanceResponse, error) { + rsp, err := c.CreateMonitoringInstance(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateMonitoringInstanceResponse(rsp) +} + +// DeleteMonitoringInstanceWithResponse request returning *DeleteMonitoringInstanceResponse +func (c *ClientWithResponses) DeleteMonitoringInstanceWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*DeleteMonitoringInstanceResponse, error) { + rsp, err := c.DeleteMonitoringInstance(ctx, name, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteMonitoringInstanceResponse(rsp) +} + +// GetMonitoringInstanceWithResponse request returning *GetMonitoringInstanceResponse +func (c *ClientWithResponses) GetMonitoringInstanceWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetMonitoringInstanceResponse, error) { + rsp, err := c.GetMonitoringInstance(ctx, name, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetMonitoringInstanceResponse(rsp) +} + +// UpdateMonitoringInstanceWithBodyWithResponse request with arbitrary body returning *UpdateMonitoringInstanceResponse +func (c *ClientWithResponses) UpdateMonitoringInstanceWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMonitoringInstanceResponse, error) { + rsp, err := c.UpdateMonitoringInstanceWithBody(ctx, name, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateMonitoringInstanceResponse(rsp) +} + +func (c *ClientWithResponses) UpdateMonitoringInstanceWithResponse(ctx context.Context, name string, body UpdateMonitoringInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMonitoringInstanceResponse, error) { + rsp, err := c.UpdateMonitoringInstance(ctx, name, body, reqEditors...) if err != nil { return nil, err } - return ParseSetKubernetesClusterMonitoringResponse(rsp) + return ParseUpdateMonitoringInstanceResponse(rsp) } -func (c *ClientWithResponses) SetKubernetesClusterMonitoringWithResponse(ctx context.Context, body SetKubernetesClusterMonitoringJSONRequestBody, reqEditors ...RequestEditorFn) (*SetKubernetesClusterMonitoringResponse, error) { - rsp, err := c.SetKubernetesClusterMonitoring(ctx, body, reqEditors...) +// ListNamespacesWithResponse request returning *ListNamespacesResponse +func (c *ClientWithResponses) ListNamespacesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListNamespacesResponse, error) { + rsp, err := c.ListNamespaces(ctx, reqEditors...) if err != nil { return nil, err } - return ParseSetKubernetesClusterMonitoringResponse(rsp) + return ParseListNamespacesResponse(rsp) } // CreateDatabaseClusterBackupWithBodyWithResponse request with arbitrary body returning *CreateDatabaseClusterBackupResponse -func (c *ClientWithResponses) CreateDatabaseClusterBackupWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterBackupResponse, error) { - rsp, err := c.CreateDatabaseClusterBackupWithBody(ctx, contentType, body, reqEditors...) +func (c *ClientWithResponses) CreateDatabaseClusterBackupWithBodyWithResponse(ctx context.Context, namespace string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterBackupResponse, error) { + rsp, err := c.CreateDatabaseClusterBackupWithBody(ctx, namespace, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCreateDatabaseClusterBackupResponse(rsp) } -func (c *ClientWithResponses) CreateDatabaseClusterBackupWithResponse(ctx context.Context, body CreateDatabaseClusterBackupJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterBackupResponse, error) { - rsp, err := c.CreateDatabaseClusterBackup(ctx, body, reqEditors...) +func (c *ClientWithResponses) CreateDatabaseClusterBackupWithResponse(ctx context.Context, namespace string, body CreateDatabaseClusterBackupJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterBackupResponse, error) { + rsp, err := c.CreateDatabaseClusterBackup(ctx, namespace, body, reqEditors...) if err != nil { return nil, err } @@ -4234,8 +4402,8 @@ func (c *ClientWithResponses) CreateDatabaseClusterBackupWithResponse(ctx contex } // DeleteDatabaseClusterBackupWithResponse request returning *DeleteDatabaseClusterBackupResponse -func (c *ClientWithResponses) DeleteDatabaseClusterBackupWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*DeleteDatabaseClusterBackupResponse, error) { - rsp, err := c.DeleteDatabaseClusterBackup(ctx, name, reqEditors...) +func (c *ClientWithResponses) DeleteDatabaseClusterBackupWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*DeleteDatabaseClusterBackupResponse, error) { + rsp, err := c.DeleteDatabaseClusterBackup(ctx, namespace, name, reqEditors...) if err != nil { return nil, err } @@ -4243,8 +4411,8 @@ func (c *ClientWithResponses) DeleteDatabaseClusterBackupWithResponse(ctx contex } // GetDatabaseClusterBackupWithResponse request returning *GetDatabaseClusterBackupResponse -func (c *ClientWithResponses) GetDatabaseClusterBackupWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterBackupResponse, error) { - rsp, err := c.GetDatabaseClusterBackup(ctx, name, reqEditors...) +func (c *ClientWithResponses) GetDatabaseClusterBackupWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterBackupResponse, error) { + rsp, err := c.GetDatabaseClusterBackup(ctx, namespace, name, reqEditors...) if err != nil { return nil, err } @@ -4252,16 +4420,16 @@ func (c *ClientWithResponses) GetDatabaseClusterBackupWithResponse(ctx context.C } // CreateDatabaseClusterRestoreWithBodyWithResponse request with arbitrary body returning *CreateDatabaseClusterRestoreResponse -func (c *ClientWithResponses) CreateDatabaseClusterRestoreWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterRestoreResponse, error) { - rsp, err := c.CreateDatabaseClusterRestoreWithBody(ctx, contentType, body, reqEditors...) +func (c *ClientWithResponses) CreateDatabaseClusterRestoreWithBodyWithResponse(ctx context.Context, namespace string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterRestoreResponse, error) { + rsp, err := c.CreateDatabaseClusterRestoreWithBody(ctx, namespace, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCreateDatabaseClusterRestoreResponse(rsp) } -func (c *ClientWithResponses) CreateDatabaseClusterRestoreWithResponse(ctx context.Context, body CreateDatabaseClusterRestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterRestoreResponse, error) { - rsp, err := c.CreateDatabaseClusterRestore(ctx, body, reqEditors...) +func (c *ClientWithResponses) CreateDatabaseClusterRestoreWithResponse(ctx context.Context, namespace string, body CreateDatabaseClusterRestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterRestoreResponse, error) { + rsp, err := c.CreateDatabaseClusterRestore(ctx, namespace, body, reqEditors...) if err != nil { return nil, err } @@ -4269,8 +4437,8 @@ func (c *ClientWithResponses) CreateDatabaseClusterRestoreWithResponse(ctx conte } // DeleteDatabaseClusterRestoreWithResponse request returning *DeleteDatabaseClusterRestoreResponse -func (c *ClientWithResponses) DeleteDatabaseClusterRestoreWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*DeleteDatabaseClusterRestoreResponse, error) { - rsp, err := c.DeleteDatabaseClusterRestore(ctx, name, reqEditors...) +func (c *ClientWithResponses) DeleteDatabaseClusterRestoreWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*DeleteDatabaseClusterRestoreResponse, error) { + rsp, err := c.DeleteDatabaseClusterRestore(ctx, namespace, name, reqEditors...) if err != nil { return nil, err } @@ -4278,8 +4446,8 @@ func (c *ClientWithResponses) DeleteDatabaseClusterRestoreWithResponse(ctx conte } // GetDatabaseClusterRestoreWithResponse request returning *GetDatabaseClusterRestoreResponse -func (c *ClientWithResponses) GetDatabaseClusterRestoreWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterRestoreResponse, error) { - rsp, err := c.GetDatabaseClusterRestore(ctx, name, reqEditors...) +func (c *ClientWithResponses) GetDatabaseClusterRestoreWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterRestoreResponse, error) { + rsp, err := c.GetDatabaseClusterRestore(ctx, namespace, name, reqEditors...) if err != nil { return nil, err } @@ -4287,16 +4455,16 @@ func (c *ClientWithResponses) GetDatabaseClusterRestoreWithResponse(ctx context. } // UpdateDatabaseClusterRestoreWithBodyWithResponse request with arbitrary body returning *UpdateDatabaseClusterRestoreResponse -func (c *ClientWithResponses) UpdateDatabaseClusterRestoreWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDatabaseClusterRestoreResponse, error) { - rsp, err := c.UpdateDatabaseClusterRestoreWithBody(ctx, name, contentType, body, reqEditors...) +func (c *ClientWithResponses) UpdateDatabaseClusterRestoreWithBodyWithResponse(ctx context.Context, namespace string, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDatabaseClusterRestoreResponse, error) { + rsp, err := c.UpdateDatabaseClusterRestoreWithBody(ctx, namespace, name, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateDatabaseClusterRestoreResponse(rsp) } -func (c *ClientWithResponses) UpdateDatabaseClusterRestoreWithResponse(ctx context.Context, name string, body UpdateDatabaseClusterRestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDatabaseClusterRestoreResponse, error) { - rsp, err := c.UpdateDatabaseClusterRestore(ctx, name, body, reqEditors...) +func (c *ClientWithResponses) UpdateDatabaseClusterRestoreWithResponse(ctx context.Context, namespace string, name string, body UpdateDatabaseClusterRestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDatabaseClusterRestoreResponse, error) { + rsp, err := c.UpdateDatabaseClusterRestore(ctx, namespace, name, body, reqEditors...) if err != nil { return nil, err } @@ -4304,8 +4472,8 @@ func (c *ClientWithResponses) UpdateDatabaseClusterRestoreWithResponse(ctx conte } // ListDatabaseClustersWithResponse request returning *ListDatabaseClustersResponse -func (c *ClientWithResponses) ListDatabaseClustersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListDatabaseClustersResponse, error) { - rsp, err := c.ListDatabaseClusters(ctx, reqEditors...) +func (c *ClientWithResponses) ListDatabaseClustersWithResponse(ctx context.Context, namespace string, reqEditors ...RequestEditorFn) (*ListDatabaseClustersResponse, error) { + rsp, err := c.ListDatabaseClusters(ctx, namespace, reqEditors...) if err != nil { return nil, err } @@ -4313,16 +4481,16 @@ func (c *ClientWithResponses) ListDatabaseClustersWithResponse(ctx context.Conte } // CreateDatabaseClusterWithBodyWithResponse request with arbitrary body returning *CreateDatabaseClusterResponse -func (c *ClientWithResponses) CreateDatabaseClusterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterResponse, error) { - rsp, err := c.CreateDatabaseClusterWithBody(ctx, contentType, body, reqEditors...) +func (c *ClientWithResponses) CreateDatabaseClusterWithBodyWithResponse(ctx context.Context, namespace string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterResponse, error) { + rsp, err := c.CreateDatabaseClusterWithBody(ctx, namespace, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCreateDatabaseClusterResponse(rsp) } -func (c *ClientWithResponses) CreateDatabaseClusterWithResponse(ctx context.Context, body CreateDatabaseClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterResponse, error) { - rsp, err := c.CreateDatabaseCluster(ctx, body, reqEditors...) +func (c *ClientWithResponses) CreateDatabaseClusterWithResponse(ctx context.Context, namespace string, body CreateDatabaseClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDatabaseClusterResponse, error) { + rsp, err := c.CreateDatabaseCluster(ctx, namespace, body, reqEditors...) if err != nil { return nil, err } @@ -4330,8 +4498,8 @@ func (c *ClientWithResponses) CreateDatabaseClusterWithResponse(ctx context.Cont } // DeleteDatabaseClusterWithResponse request returning *DeleteDatabaseClusterResponse -func (c *ClientWithResponses) DeleteDatabaseClusterWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*DeleteDatabaseClusterResponse, error) { - rsp, err := c.DeleteDatabaseCluster(ctx, name, reqEditors...) +func (c *ClientWithResponses) DeleteDatabaseClusterWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*DeleteDatabaseClusterResponse, error) { + rsp, err := c.DeleteDatabaseCluster(ctx, namespace, name, reqEditors...) if err != nil { return nil, err } @@ -4339,8 +4507,8 @@ func (c *ClientWithResponses) DeleteDatabaseClusterWithResponse(ctx context.Cont } // GetDatabaseClusterWithResponse request returning *GetDatabaseClusterResponse -func (c *ClientWithResponses) GetDatabaseClusterWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterResponse, error) { - rsp, err := c.GetDatabaseCluster(ctx, name, reqEditors...) +func (c *ClientWithResponses) GetDatabaseClusterWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterResponse, error) { + rsp, err := c.GetDatabaseCluster(ctx, namespace, name, reqEditors...) if err != nil { return nil, err } @@ -4348,16 +4516,16 @@ func (c *ClientWithResponses) GetDatabaseClusterWithResponse(ctx context.Context } // UpdateDatabaseClusterWithBodyWithResponse request with arbitrary body returning *UpdateDatabaseClusterResponse -func (c *ClientWithResponses) UpdateDatabaseClusterWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDatabaseClusterResponse, error) { - rsp, err := c.UpdateDatabaseClusterWithBody(ctx, name, contentType, body, reqEditors...) +func (c *ClientWithResponses) UpdateDatabaseClusterWithBodyWithResponse(ctx context.Context, namespace string, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDatabaseClusterResponse, error) { + rsp, err := c.UpdateDatabaseClusterWithBody(ctx, namespace, name, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateDatabaseClusterResponse(rsp) } -func (c *ClientWithResponses) UpdateDatabaseClusterWithResponse(ctx context.Context, name string, body UpdateDatabaseClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDatabaseClusterResponse, error) { - rsp, err := c.UpdateDatabaseCluster(ctx, name, body, reqEditors...) +func (c *ClientWithResponses) UpdateDatabaseClusterWithResponse(ctx context.Context, namespace string, name string, body UpdateDatabaseClusterJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDatabaseClusterResponse, error) { + rsp, err := c.UpdateDatabaseCluster(ctx, namespace, name, body, reqEditors...) if err != nil { return nil, err } @@ -4365,8 +4533,8 @@ func (c *ClientWithResponses) UpdateDatabaseClusterWithResponse(ctx context.Cont } // ListDatabaseClusterBackupsWithResponse request returning *ListDatabaseClusterBackupsResponse -func (c *ClientWithResponses) ListDatabaseClusterBackupsWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*ListDatabaseClusterBackupsResponse, error) { - rsp, err := c.ListDatabaseClusterBackups(ctx, name, reqEditors...) +func (c *ClientWithResponses) ListDatabaseClusterBackupsWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*ListDatabaseClusterBackupsResponse, error) { + rsp, err := c.ListDatabaseClusterBackups(ctx, namespace, name, reqEditors...) if err != nil { return nil, err } @@ -4374,8 +4542,8 @@ func (c *ClientWithResponses) ListDatabaseClusterBackupsWithResponse(ctx context } // GetDatabaseClusterCredentialsWithResponse request returning *GetDatabaseClusterCredentialsResponse -func (c *ClientWithResponses) GetDatabaseClusterCredentialsWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterCredentialsResponse, error) { - rsp, err := c.GetDatabaseClusterCredentials(ctx, name, reqEditors...) +func (c *ClientWithResponses) GetDatabaseClusterCredentialsWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterCredentialsResponse, error) { + rsp, err := c.GetDatabaseClusterCredentials(ctx, namespace, name, reqEditors...) if err != nil { return nil, err } @@ -4383,8 +4551,8 @@ func (c *ClientWithResponses) GetDatabaseClusterCredentialsWithResponse(ctx cont } // GetDatabaseClusterPitrWithResponse request returning *GetDatabaseClusterPitrResponse -func (c *ClientWithResponses) GetDatabaseClusterPitrWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterPitrResponse, error) { - rsp, err := c.GetDatabaseClusterPitr(ctx, name, reqEditors...) +func (c *ClientWithResponses) GetDatabaseClusterPitrWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*GetDatabaseClusterPitrResponse, error) { + rsp, err := c.GetDatabaseClusterPitr(ctx, namespace, name, reqEditors...) if err != nil { return nil, err } @@ -4392,8 +4560,8 @@ func (c *ClientWithResponses) GetDatabaseClusterPitrWithResponse(ctx context.Con } // ListDatabaseClusterRestoresWithResponse request returning *ListDatabaseClusterRestoresResponse -func (c *ClientWithResponses) ListDatabaseClusterRestoresWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*ListDatabaseClusterRestoresResponse, error) { - rsp, err := c.ListDatabaseClusterRestores(ctx, name, reqEditors...) +func (c *ClientWithResponses) ListDatabaseClusterRestoresWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*ListDatabaseClusterRestoresResponse, error) { + rsp, err := c.ListDatabaseClusterRestores(ctx, namespace, name, reqEditors...) if err != nil { return nil, err } @@ -4401,8 +4569,8 @@ func (c *ClientWithResponses) ListDatabaseClusterRestoresWithResponse(ctx contex } // ListDatabaseEnginesWithResponse request returning *ListDatabaseEnginesResponse -func (c *ClientWithResponses) ListDatabaseEnginesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListDatabaseEnginesResponse, error) { - rsp, err := c.ListDatabaseEngines(ctx, reqEditors...) +func (c *ClientWithResponses) ListDatabaseEnginesWithResponse(ctx context.Context, namespace string, reqEditors ...RequestEditorFn) (*ListDatabaseEnginesResponse, error) { + rsp, err := c.ListDatabaseEngines(ctx, namespace, reqEditors...) if err != nil { return nil, err } @@ -4410,8 +4578,8 @@ func (c *ClientWithResponses) ListDatabaseEnginesWithResponse(ctx context.Contex } // GetDatabaseEngineWithResponse request returning *GetDatabaseEngineResponse -func (c *ClientWithResponses) GetDatabaseEngineWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetDatabaseEngineResponse, error) { - rsp, err := c.GetDatabaseEngine(ctx, name, reqEditors...) +func (c *ClientWithResponses) GetDatabaseEngineWithResponse(ctx context.Context, namespace string, name string, reqEditors ...RequestEditorFn) (*GetDatabaseEngineResponse, error) { + rsp, err := c.GetDatabaseEngine(ctx, namespace, name, reqEditors...) if err != nil { return nil, err } @@ -4419,117 +4587,209 @@ func (c *ClientWithResponses) GetDatabaseEngineWithResponse(ctx context.Context, } // UpdateDatabaseEngineWithBodyWithResponse request with arbitrary body returning *UpdateDatabaseEngineResponse -func (c *ClientWithResponses) UpdateDatabaseEngineWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDatabaseEngineResponse, error) { - rsp, err := c.UpdateDatabaseEngineWithBody(ctx, name, contentType, body, reqEditors...) +func (c *ClientWithResponses) UpdateDatabaseEngineWithBodyWithResponse(ctx context.Context, namespace string, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDatabaseEngineResponse, error) { + rsp, err := c.UpdateDatabaseEngineWithBody(ctx, namespace, name, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateDatabaseEngineResponse(rsp) } -func (c *ClientWithResponses) UpdateDatabaseEngineWithResponse(ctx context.Context, name string, body UpdateDatabaseEngineJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDatabaseEngineResponse, error) { - rsp, err := c.UpdateDatabaseEngine(ctx, name, body, reqEditors...) +func (c *ClientWithResponses) UpdateDatabaseEngineWithResponse(ctx context.Context, namespace string, name string, body UpdateDatabaseEngineJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDatabaseEngineResponse, error) { + rsp, err := c.UpdateDatabaseEngine(ctx, namespace, name, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateDatabaseEngineResponse(rsp) } -// ListMonitoringInstancesWithResponse request returning *ListMonitoringInstancesResponse -func (c *ClientWithResponses) ListMonitoringInstancesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListMonitoringInstancesResponse, error) { - rsp, err := c.ListMonitoringInstances(ctx, reqEditors...) +// GetKubernetesClusterResourcesWithResponse request returning *GetKubernetesClusterResourcesResponse +func (c *ClientWithResponses) GetKubernetesClusterResourcesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetKubernetesClusterResourcesResponse, error) { + rsp, err := c.GetKubernetesClusterResources(ctx, reqEditors...) if err != nil { return nil, err } - return ParseListMonitoringInstancesResponse(rsp) + return ParseGetKubernetesClusterResourcesResponse(rsp) } -// CreateMonitoringInstanceWithBodyWithResponse request with arbitrary body returning *CreateMonitoringInstanceResponse -func (c *ClientWithResponses) CreateMonitoringInstanceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateMonitoringInstanceResponse, error) { - rsp, err := c.CreateMonitoringInstanceWithBody(ctx, contentType, body, reqEditors...) +// VersionInfoWithResponse request returning *VersionInfoResponse +func (c *ClientWithResponses) VersionInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*VersionInfoResponse, error) { + rsp, err := c.VersionInfo(ctx, reqEditors...) if err != nil { return nil, err } - return ParseCreateMonitoringInstanceResponse(rsp) + return ParseVersionInfoResponse(rsp) } -func (c *ClientWithResponses) CreateMonitoringInstanceWithResponse(ctx context.Context, body CreateMonitoringInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMonitoringInstanceResponse, error) { - rsp, err := c.CreateMonitoringInstance(ctx, body, reqEditors...) +// ParseListBackupStoragesResponse parses an HTTP response from a ListBackupStoragesWithResponse call +func ParseListBackupStoragesResponse(rsp *http.Response) (*ListBackupStoragesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseCreateMonitoringInstanceResponse(rsp) -} -// DeleteMonitoringInstanceWithResponse request returning *DeleteMonitoringInstanceResponse -func (c *ClientWithResponses) DeleteMonitoringInstanceWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*DeleteMonitoringInstanceResponse, error) { - rsp, err := c.DeleteMonitoringInstance(ctx, name, reqEditors...) - if err != nil { - return nil, err + response := &ListBackupStoragesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseDeleteMonitoringInstanceResponse(rsp) -} -// GetMonitoringInstanceWithResponse request returning *GetMonitoringInstanceResponse -func (c *ClientWithResponses) GetMonitoringInstanceWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*GetMonitoringInstanceResponse, error) { - rsp, err := c.GetMonitoringInstance(ctx, name, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest BackupStoragesList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseGetMonitoringInstanceResponse(rsp) + + return response, nil } -// UpdateMonitoringInstanceWithBodyWithResponse request with arbitrary body returning *UpdateMonitoringInstanceResponse -func (c *ClientWithResponses) UpdateMonitoringInstanceWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMonitoringInstanceResponse, error) { - rsp, err := c.UpdateMonitoringInstanceWithBody(ctx, name, contentType, body, reqEditors...) +// ParseCreateBackupStorageResponse parses an HTTP response from a CreateBackupStorageWithResponse call +func ParseCreateBackupStorageResponse(rsp *http.Response) (*CreateBackupStorageResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseUpdateMonitoringInstanceResponse(rsp) -} -func (c *ClientWithResponses) UpdateMonitoringInstanceWithResponse(ctx context.Context, name string, body UpdateMonitoringInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMonitoringInstanceResponse, error) { - rsp, err := c.UpdateMonitoringInstance(ctx, name, body, reqEditors...) - if err != nil { - return nil, err + response := &CreateBackupStorageResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseUpdateMonitoringInstanceResponse(rsp) + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest BackupStorage + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil } -// GetKubernetesClusterResourcesWithResponse request returning *GetKubernetesClusterResourcesResponse -func (c *ClientWithResponses) GetKubernetesClusterResourcesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetKubernetesClusterResourcesResponse, error) { - rsp, err := c.GetKubernetesClusterResources(ctx, reqEditors...) +// ParseDeleteBackupStorageResponse parses an HTTP response from a DeleteBackupStorageWithResponse call +func ParseDeleteBackupStorageResponse(rsp *http.Response) (*DeleteBackupStorageResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseGetKubernetesClusterResourcesResponse(rsp) + + response := &DeleteBackupStorageResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil } -// VersionInfoWithResponse request returning *VersionInfoResponse -func (c *ClientWithResponses) VersionInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*VersionInfoResponse, error) { - rsp, err := c.VersionInfo(ctx, reqEditors...) +// ParseGetBackupStorageResponse parses an HTTP response from a GetBackupStorageWithResponse call +func ParseGetBackupStorageResponse(rsp *http.Response) (*GetBackupStorageResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseVersionInfoResponse(rsp) + + response := &GetBackupStorageResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest BackupStorage + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil } -// ParseListBackupStoragesResponse parses an HTTP response from a ListBackupStoragesWithResponse call -func ParseListBackupStoragesResponse(rsp *http.Response) (*ListBackupStoragesResponse, error) { +// ParseUpdateBackupStorageResponse parses an HTTP response from a UpdateBackupStorageWithResponse call +func ParseUpdateBackupStorageResponse(rsp *http.Response) (*UpdateBackupStorageResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListBackupStoragesResponse{ + response := &UpdateBackupStorageResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BackupStoragesList + var dest BackupStorage if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -4554,22 +4814,22 @@ func ParseListBackupStoragesResponse(rsp *http.Response) (*ListBackupStoragesRes return response, nil } -// ParseCreateBackupStorageResponse parses an HTTP response from a CreateBackupStorageWithResponse call -func ParseCreateBackupStorageResponse(rsp *http.Response) (*CreateBackupStorageResponse, error) { +// ParseGetKubernetesClusterInfoResponse parses an HTTP response from a GetKubernetesClusterInfoWithResponse call +func ParseGetKubernetesClusterInfoResponse(rsp *http.Response) (*GetKubernetesClusterInfoResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateBackupStorageResponse{ + response := &GetKubernetesClusterInfoResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BackupStorage + var dest KubernetesClusterInfo if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -4594,20 +4854,27 @@ func ParseCreateBackupStorageResponse(rsp *http.Response) (*CreateBackupStorageR return response, nil } -// ParseDeleteBackupStorageResponse parses an HTTP response from a DeleteBackupStorageWithResponse call -func ParseDeleteBackupStorageResponse(rsp *http.Response) (*DeleteBackupStorageResponse, error) { +// ParseListMonitoringInstancesResponse parses an HTTP response from a ListMonitoringInstancesWithResponse call +func ParseListMonitoringInstancesResponse(rsp *http.Response) (*ListMonitoringInstancesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteBackupStorageResponse{ + response := &ListMonitoringInstancesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest MonitoringInstancesList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -4627,22 +4894,22 @@ func ParseDeleteBackupStorageResponse(rsp *http.Response) (*DeleteBackupStorageR return response, nil } -// ParseGetBackupStorageResponse parses an HTTP response from a GetBackupStorageWithResponse call -func ParseGetBackupStorageResponse(rsp *http.Response) (*GetBackupStorageResponse, error) { +// ParseCreateMonitoringInstanceResponse parses an HTTP response from a CreateMonitoringInstanceWithResponse call +func ParseCreateMonitoringInstanceResponse(rsp *http.Response) (*CreateMonitoringInstanceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetBackupStorageResponse{ + response := &CreateMonitoringInstanceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BackupStorage + var dest MonitoringInstance if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -4667,22 +4934,62 @@ func ParseGetBackupStorageResponse(rsp *http.Response) (*GetBackupStorageRespons return response, nil } -// ParseUpdateBackupStorageResponse parses an HTTP response from a UpdateBackupStorageWithResponse call -func ParseUpdateBackupStorageResponse(rsp *http.Response) (*UpdateBackupStorageResponse, error) { +// ParseDeleteMonitoringInstanceResponse parses an HTTP response from a DeleteMonitoringInstanceWithResponse call +func ParseDeleteMonitoringInstanceResponse(rsp *http.Response) (*DeleteMonitoringInstanceResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteMonitoringInstanceResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseGetMonitoringInstanceResponse parses an HTTP response from a GetMonitoringInstanceWithResponse call +func ParseGetMonitoringInstanceResponse(rsp *http.Response) (*GetMonitoringInstanceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateBackupStorageResponse{ + response := &GetMonitoringInstanceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest BackupStorage + var dest MonitoringInstance if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -4695,6 +5002,13 @@ func ParseUpdateBackupStorageResponse(rsp *http.Response) (*UpdateBackupStorageR } response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -4707,22 +5021,22 @@ func ParseUpdateBackupStorageResponse(rsp *http.Response) (*UpdateBackupStorageR return response, nil } -// ParseGetKubernetesClusterInfoResponse parses an HTTP response from a GetKubernetesClusterInfoWithResponse call -func ParseGetKubernetesClusterInfoResponse(rsp *http.Response) (*GetKubernetesClusterInfoResponse, error) { +// ParseUpdateMonitoringInstanceResponse parses an HTTP response from a UpdateMonitoringInstanceWithResponse call +func ParseUpdateMonitoringInstanceResponse(rsp *http.Response) (*UpdateMonitoringInstanceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetKubernetesClusterInfoResponse{ + response := &UpdateMonitoringInstanceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest KubernetesClusterInfo + var dest MonitoringInstance if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -4735,6 +5049,13 @@ func ParseGetKubernetesClusterInfoResponse(rsp *http.Response) (*GetKubernetesCl } response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -4747,34 +5068,26 @@ func ParseGetKubernetesClusterInfoResponse(rsp *http.Response) (*GetKubernetesCl return response, nil } -// ParseSetKubernetesClusterMonitoringResponse parses an HTTP response from a SetKubernetesClusterMonitoringWithResponse call -func ParseSetKubernetesClusterMonitoringResponse(rsp *http.Response) (*SetKubernetesClusterMonitoringResponse, error) { +// ParseListNamespacesResponse parses an HTTP response from a ListNamespacesWithResponse call +func ParseListNamespacesResponse(rsp *http.Response) (*ListNamespacesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &SetKubernetesClusterMonitoringResponse{ + response := &ListNamespacesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: - var dest Error + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest NamespaceList if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON500 = &dest - + response.JSON200 = &dest } return response, nil @@ -5589,220 +5902,6 @@ func ParseUpdateDatabaseEngineResponse(rsp *http.Response) (*UpdateDatabaseEngin return response, nil } -// ParseListMonitoringInstancesResponse parses an HTTP response from a ListMonitoringInstancesWithResponse call -func ParseListMonitoringInstancesResponse(rsp *http.Response) (*ListMonitoringInstancesResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ListMonitoringInstancesResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest MonitoringInstancesList - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON500 = &dest - - } - - return response, nil -} - -// ParseCreateMonitoringInstanceResponse parses an HTTP response from a CreateMonitoringInstanceWithResponse call -func ParseCreateMonitoringInstanceResponse(rsp *http.Response) (*CreateMonitoringInstanceResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &CreateMonitoringInstanceResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest MonitoringInstance - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON500 = &dest - - } - - return response, nil -} - -// ParseDeleteMonitoringInstanceResponse parses an HTTP response from a DeleteMonitoringInstanceWithResponse call -func ParseDeleteMonitoringInstanceResponse(rsp *http.Response) (*DeleteMonitoringInstanceResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DeleteMonitoringInstanceResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON500 = &dest - - } - - return response, nil -} - -// ParseGetMonitoringInstanceResponse parses an HTTP response from a GetMonitoringInstanceWithResponse call -func ParseGetMonitoringInstanceResponse(rsp *http.Response) (*GetMonitoringInstanceResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetMonitoringInstanceResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest MonitoringInstance - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON500 = &dest - - } - - return response, nil -} - -// ParseUpdateMonitoringInstanceResponse parses an HTTP response from a UpdateMonitoringInstanceWithResponse call -func ParseUpdateMonitoringInstanceResponse(rsp *http.Response) (*UpdateMonitoringInstanceResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &UpdateMonitoringInstanceResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest MonitoringInstance - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON500 = &dest - - } - - return response, nil -} - // ParseGetKubernetesClusterResourcesResponse parses an HTTP response from a GetKubernetesClusterResourcesWithResponse call func ParseGetKubernetesClusterResourcesResponse(rsp *http.Response) (*GetKubernetesClusterResourcesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -5870,138 +5969,139 @@ func ParseVersionInfoResponse(rsp *http.Response) (*VersionInfoResponse, error) // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+x9bXPbNtboX8Gwz0yTrkTbSbuz6y87tuNt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f45f/ePHi3f747+//8uLmJoR/", - "ffPyHy//KP76y8uXL168+/H8++uL0/f05R/vWJ7emr/+ePGOnL7vP87Ll//4H4iAlFGZsWZ0LsZ2Xy74", - "kZKUi+XOQDmHYRxczKB/btD4+FyWEeKG7eFiZDWudObeamkaJVh6OORE/+wGLEaCHxXXGrGI4GRESCq1", - "0YUWPMlT6Ea9CkHS38nOuL6ivxc71QMWDljnOv4sCK9qegBVt533cYXCseiHjqWqye4jDQou1UwQ+Vui", - "/5BpPPGHESURVxAFlH6z4W29g9eKh2ZkI8cudARhBNPkDaYsusJ8LsZX36Trvs5wcqyzIqCZckYVNxhp", - "Tn5etBUypvxlNX+VHY3q9MPz3NOrCVSMmmOhk8vQr257aD5n0NeVmA3nOOYuZwx9koOmftFBUwnudLkB", - "aUwgO/moiPhTBoZI6JrMxyPjvGp9Csb3ZGlih8UxRIhuGLrWP2l/lCGcZHNsI1iYxU7k2ziII743S4ZT", - "GjkYHCXOE0ZTglUuCJphRcqxzXh6kjTNlXahQnSmIArGWbJEE03lJupVrAy8g454wWV1k0iQKRGEaVxw", - "pilaaRXG0AWPrzRIar1lG/4rnOo0lwqlWEXzGgXVpsl4HHpA79j3gsdFWKkKCo0PgEKKbyGugFVJQniB", - "aQIhAcokjQnCFZStZVLY0FrftiFLNZmNU5yNb8lSVkdp97LDpDjTgxqbrfsQbmM19Scxuerk8pOxXM2P", - "ExsoSvG9tqsRTnnOICYW8TTLVWkmSwQBZ00KnuD7qsO4mrTcSzHDMzIuhh2XfLQXeCjBnQt86Wi7dOcj", - "DcQZh2gl4hzHgStTjEMl4ilV1jGu8u0IUQgjan8XjD9LMnRqmJ9KRO61c0RVsnReJYlHiKs5EXdUghuO", - "mfaKEjDCAfVjpwHgjCksVxKZ0x5yHxES28melMr6Od0Z1pLQF/EBjVULk0rFM3vK5eJinnMHwe+XnvH0", - "z0W8BP6oee51j1SrwkyrCUGx8vZHdzRJtObCWZZQi2499owuCLN2VYiONOWk5gwHRdja+5Ioewh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04P", - "zbroWZq2Dwn7F2G3ddNTyn4ibKYN7IMdZEYPtNVAvyMK4Wpqn9owz7na/uOAfgua7oE8c4ui8orDg/Df", - "aNPPL87Pe+7Q1uzenXn1lC3ZrHmv9SPOqH3T4CEwO6rlPm/N5dI8VPBA1OUR9Rfn522gXWUkCnrKhbdg", - "0j8MaT0qSRnfo0ZS3g1t9pqKR7953DUDpC/+SZWut0fWPirS+UpIi0A7wxanCyKIVC5O4XeUpnmSnPA0", - "pWoXrs0E18vxJ+z2H2bRFbXa0hmoLqscfVTdtM+CoxwccZzRFEdzjf9lmN3O9A8y1L5zuDgINc+cE+ND", - "N+t1mZZK4SfncJt4lVwyNSeKRpWST1AObo4XZIQoi5I81pxs6vNhFqMFFpTnsrhCblR1iI7KoEaKlzCA", - "OYnjDAyGj79AT72cEXIL++St66Moyz3M4VpgfFtNj06rhSIVFOZPqUKcNe7og0BBgqhcMBKboFWZQF48", - "XAFncALNsUQpFyaKWx6Vmcw3E9ihEvEM/5aTIv41IcV7GFRKaDCHijYg48JoldiNRoE59YPwDkQMTZF5", - "QcnC1DFg5B4qt0D0rji0K+B+YqBiyqlHnLmypjCWXpYN/2RcSgrF9qbVndafp9D7juaYzUiMwFc2j3ow", - "hNGU3KGUslyDC5CrdSyJDUgc6l1w0lR7ctA2t1RzWRSDKjBpQOmKTJlLmRFOHKQspA0up1RIVQR5Rihn", - "CZESLXlu1iNIRGgBSsVvCTPxMswQgQCRjQN1VMFMTeHRM0XSE54zTwi43addC0LmE6nRrduA5OzqAR13", - "cxrNy4I7wF3umqlDv9sgFO0pvnQk5PRAjMAg1kgysJYkgeRXqIZJWKtChV25W5REObtl/I4B9Rrw6mEc", - "KhIyVShnwFIsLqq9xTnodUkExQn9vawpViyUlleQ0QtCgf4nJMK5JIgqU5BKoWieM23u6/W7VmULdJpI", - "s7SdXpb7sfc7GDd02dyT2UhRamyrnbiwK09iCLlihhYH4cF3KOaugFJlDkP7WuozjUa9CesZ+SnlGyIV", - "1eYPm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usD4DmtFlWQK/5qLG9+7zFLm9fonceXaNpjjuFms3I5cr1X+6f2n/w0AAP//w1uTHe3yAAA=", + "H4sIAAAAAAAC/+x9+3PbNvbvv4JRvzNNuhJtJ+3Orn/ZsR1v69u69djO3rkb5zYQCUlYkwALgLKVNP/7", + "d3AA8AlK1MOOveEvbSyCeByc5wcHh58GIU9SzghTcnD4aSDDGUkw/PMYh7dZeqW4wFOif8BRRBXlDMcX", + "gqdEKErk4HCCY0mGg4jIUNBUPx8c2neRNC8jyiZcJBgeDgdp6e1Pg3EW3hL1K05gDLVIyeBwIJWgbDr4", + "XOvX85y1vSjI1PvOcHA/mvKR/nEkb2k64qlZ1CjllCkiBodKZOTzcKCwmJqZyRSHZrbVZf5CpUJ8glje", + "BuE45nckQoqjTBKkZlSicYUag+GAKpJI76ztD1gIvCj+/jQgLEsGh+8G8vVgOMAfM0EG74fN1zMRe7oF", + "avyRUUEi3QeQbFgmvO3Js+RiED7+DwmVHqTCGFLTQI+Zr+l/BJkMDgff7BWctWfZaq/KU571ngiCFak0", + "u8ACm543Z8BU90EUEbLBfzgMiZQ/k4V3P6rcWR3jekZQGPMsyocxrfdCzhSmjAjEStTdhKurAx5plhIo", + "IhPKiB5VN4cxNBOqGSkJHPz55tcr89iIH5oplcrDvb3bbEwEI4rIgPK9iIdSzzkkqZJ7fE7EnJK7vTsu", + "bimbju6omo3M7ss94PS9byImRzEek3gEPwyGA3KPkzSGvbyTo4jMfcveXiYlCQVRbbv1NUlswbdlqqwn", + "yW+wwmMsyUmcSaBynVy1BohK4KsrEGfNVfBnZFuFppVERxdnQVPQUvovIqRlgBpnX5zZZ5a7zThz85vm", + "dTMisDmVSJBUEEmYApuif8YMmXUF6IoI/SKSM57FEQo5mxOhkCAhnzL6Me9N6i3Xw8RYEakQcBrDMZrj", + "OCNDhFmEErxAguh+UcZKPUATGaBzLox5O8yFa0pVcPs3kKyQJ0nGqFqAShB0nCku5F5E5iTek3Q6wiKc", + "UUVClQmyh1M6gskyv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8OBxklKm/fg+YPZW3", + "V/Y+Rbc3zEWr44UinYdpsEm5jrTJmiou5x3l6/s8HIQ4xSFVi//StZ645TU4zj0Ylvbbx2ZFLZMzpkN+", + "c56J49jeq1umqpvvHmNJ/i9VMzhB8dy4K1VmsW/UPhnQiPFN4WxPmWtbaPG9dw16HssLw/iHr7LIzqqM", + "J82Btyo1niZJ85Cte211W4o8oewXwqbaQT3YtLPPnViqwhZbshdc7exSW+UpF9F/GNJvIG8dNs/cQih9", + "nGEnumG47usX5+cdV2hrXj+IYtGzaJgSLY6NH3FK7dcLdrHZw0o68caCL03t/x0xnMcyXZyfN4l2lZJw", + "0FFVvAUveTfc9qBcZtz5Cpd5F7Ted1M85thjD3JubfS90pQY+n71311p+0DJs/jySOunRBry1QpknM6J", + "IFI55MIfOk2yOD7hSULVNkonFVxPx5/C272beRuOtYb6KhuB8rSK3oflRfv8ZcohNMcpTXA40zy4CNLb", + "qf5BBjqaDuYHgWaBc2Ki6iZz6CelUlAuBDcIllwwNSOKhqUiUFAgbobnZIgoC+Ms0orIVOzDLEJzLCjP", + "ZH6p3DgfAToqYI4EL6ADczbHGbhAn36Dlno6Q+Qm9tlb6UdRlnkE1D2B/m19PTopl45UUKo/oQpxVru1", + "D/yOBFGZYCQyMFaRUp5/ygJO5QSaYe1GC4PrFodnJhfOQD1UIp7iPzKSI2Jjkn8hg0oJD8wxo4VoHLBW", + "QnP0FphzQJBSwBBN2XlBydxUNmDkHmq5AJ6XH+PldD8xVDEF1kPOXKFT6EtPywJCKZeSQvm9SXml1Q9W", + "6HWHM8ymJEJcGBKoGWYIowm5QwllmSYXbK52EUhkSOK23sGVpv6To7a5t5rJvDxUvpOGlK7slLmmGeLY", + "UcpS2uzlhAqpcthniDIWEynRgmdmPoKEhOakVPyWMIOgYYYIQEYWGWqpi5mYUqRniiQnPGMeULjZplkd", + "QmZjqbdbPwOWs7OH7bib0XBWlOAB6XIXT932uwVCGZ/8TcdCzhZFCFx8vUmG1pLEkA4L9TEJ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r1iFhvbM54Z5F9p3KS", + "LyHRxcSyMNSr/X13gkfM+Ql8SMRs7d5/rIzbta1QItWRIPMA+KhuB0EKJllcSImm0fc7nInJQvYM/pbJ", + "luF/eIzhz5wnYwEIYhsOBzJLEiwWnfdZ4als1EmBlKSU+y5HmBwt+z3nanfOP9MC9d13DpP77jtA5T58", + "+KD/90n/p8DotDaTrx3P3gyG7rHWIu5x6ecih8M8NH8flFrkOSCmgfnz91v9d94mz7uwI8CftTYmbcM0", + "INkoJEwJHI8Obga6xed8ScvXhj9mgixdHrRYssI8AWXJIm3/v+MQQOXfzfity621LtZdrKqhAMy2VwRz", + "kH9265ibEvo74XnPSDZtyCMH16V6RxUmtEcKruBxOSHDZnk8jvbqFdf6imu1ilmitz4PG5Zw75MWiM9G", + "l8XEWwoJfjcm2iEmzbypqkiYd+oiUUpPO3zn/QijVcnNrCwoxYjVzOWFHroP/Fd5d1jag7r79b7B19/7", + "Asie/5bxXzdmaDecXq/rR6LWY68fiXrqvNXrzCfDsx3Ya4mnh1XorcQnFMWxyz92sEHLCAEyCb+2Kke1", + "qTmPChpM7skRfhp8vnu/pj0duptfA0SRAfqtjbr5qaCDqnqv5zlJ8HrStsIDsnczRw55WWqS3EVOOA+G", + "w9/yd/3NJ7oxat789Jks/5XaB+Q7/4A9/21sQbbgBseRt3+Tlg+L64gjd51lPWDKc5/Rj055rsM8JNu1", + "3b7pGW8nOFXLtjsGSzyb3Q5ZHfm6K46NwEJK9EEz/IcinTa4YcdYksjle7nn5pg4JfDNRnRLFgZhrubS", + "M0IiWenrKgtnCMshohPT1SFKk+SDzXD+oP8NnZXftHkqkcOwK2MErSiN52bXw7g0K25wtvg15+2b8eVA", + "G99tuF6Ut0Ju2oVupSS3mY5NkZxz7614H5zjlZ3O8UjL7fuvHNj53sz1YYf3aRXGFZrwjEVPH17yc+gq", + "e9cRaUo6sP+PRG3H++ePyPu93u8FqwsGlmwkVS1wmAFwNrAs5sUnbVkewzes1Fto8Q2TVb7hF8G2e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VM+H", + "vnJxebhznXZJedrHOr2E77Qs1xpCri1o8S3VlRXvcYpDqhZQ37ww2XkHW1W8vyx90vXxyt4Xo/bct3nt", + "+835oln7fl58C7mVGd03H49xeEtY5L6HDJ/wbDCb/YDyQ39RwX3DefNacEtXBd2avTDWMhPx4HCwNz8Y", + "aLNi6Vgnlu5yoWaUTXMsyX5Ss5AEVLomYA2b3o2mfWzvzClyT1d1IGqjbougstarsxxbzBWVICf/nPP7", + "NNuMUhxM+wdxFVHWGOO4/mkT23P1yyaf33/+3wAAAP//6jMNuFv8AAA=", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/deploy/quickstart-k8s.yaml b/deploy/quickstart-k8s.yaml index e7c9ebb2..83f63a85 100644 --- a/deploy/quickstart-k8s.yaml +++ b/deploy/quickstart-k8s.yaml @@ -8,27 +8,39 @@ kind: Role metadata: name: everest-admin-role rules: - - apiGroups: ["everest.percona.com"] - resources: ["*"] - verbs: ["*"] - - apiGroups: ["operator.victoriametrics.com"] - resources: ["vmagents"] - verbs: ["*"] - apiGroups: [""] - resources: ["namespaces", "secrets"] - verbs: ["*"] + resources: ["namespaces"] + verbs: ["get", "list"] + - apiGroups: ["apps"] + resources: ["deployments"] + verbs: ["get"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: everest-admin-cluster-role rules: + - apiGroups: ["everest.percona.com"] + resources: ["databaseengines"] + verbs: ["get", "list"] + - apiGroups: ["everest.percona.com"] + resources: ["databaseclusters", "databaseclusterbackups", "databaseclusterrestores", "backupstorages", "monitoringconfigs"] + verbs: ["*"] + - apiGroups: [""] + resources: ["secrets"] + verbs: ["*"] + - apiGroups: [""] + resources: ["secrets"] + verbs: ["*"] - apiGroups: [""] resources: ["nodes", "pods", "persistentvolumes"] verbs: ["get", "list"] - apiGroups: ["storage.k8s.io"] resources: ["storageclasses"] verbs: ["list"] + - apiGroups: ["everest.percona.com"] + resources: ["*"] + verbs: ["*"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding diff --git a/docs/spec/openapi.yml b/docs/spec/openapi.yml index 509caa16..6ef1de6a 100644 --- a/docs/spec/openapi.yml +++ b/docs/spec/openapi.yml @@ -24,47 +24,30 @@ tags: description: Everything related to the Backup storage paths: - '/version': + '/namespaces': get: - summary: Get Everest Backend version info - description: Get Everest Backend version info - operationId: versionInfo + summary: Get all namespaces managed by Everest + description: Get all namespaces managed by Everest + operationId: listNamespaces responses: '200': description: Successful operation content: application/json: schema: - $ref: '#/components/schemas/Version' - '/cluster-monitoring': - post: - tags: - - k8s - summary: Manage Kubernetes cluster monitoring configuration - description: Manage Kubernetes cluster monitoring configuration - operationId: setKubernetesClusterMonitoring - requestBody: - description: The database cluster object to be created - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/KubernetesClusterMonitoring' + $ref: '#/components/schemas/NamespaceList' + '/version': + get: + summary: Get Everest Backend version info + description: Get Everest Backend version info + operationId: versionInfo responses: '200': description: Successful operation - '400': - description: Unsuccessful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '500': - description: Internal server error content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/Version' '/resources': get: tags: @@ -117,13 +100,20 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '/database-clusters': + '/namespaces/{namespace}/database-clusters': post: tags: - databaseCluster summary: Create a database cluster description: Create a database cluster operationId: createDatabaseCluster + parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string responses: '200': description: Successful operation @@ -168,6 +158,13 @@ paths: summary: List of the created database clusters description: List of the created database clusters operationId: listDatabaseClusters + parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string responses: '200': description: Successful operation @@ -187,7 +184,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '/database-clusters/{name}': + '/namespaces/{namespace}/database-clusters/{name}': get: tags: - databaseCluster @@ -195,6 +192,12 @@ paths: description: Get the specified database cluster operationId: getDatabaseCluster parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string - name: name in: path description: Name of the database cluster. Can be found under Metadata["name"] of the DatabaseCluster object. @@ -227,6 +230,12 @@ paths: description: Replace the specified database cluster operationId: updateDatabaseCluster parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string - name: name in: path description: Name of the database cluster. Can be found under Metadata["name"] of the DatabaseCluster object. @@ -266,6 +275,12 @@ paths: description: Delete the specified database cluster operationId: deleteDatabaseCluster parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string - name: name in: path description: Name of the database cluster. Can be found under Metadata["name"] of the DatabaseCluster object. @@ -291,7 +306,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '/database-clusters/{name}/backups': + '/namespaces/{namespace}/database-clusters/{name}/backups': get: tags: - databaseClusterBackup @@ -299,6 +314,12 @@ paths: description: List of the created database cluster backups operationId: listDatabaseClusterBackups parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string - name: name in: path description: Name of the database cluster. Can be found under Metadata["name"] of the DatabaseCluster object. @@ -324,7 +345,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '/database-clusters/{name}/restores': + '/namespaces/{namespace}/database-clusters/{name}/restores': get: tags: - databaseClusterRestore @@ -332,6 +353,12 @@ paths: description: List of the created database cluster restores operationId: listDatabaseClusterRestores parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string - name: name in: path description: Name of the database cluster. Can be found under Metadata["name"] of the DatabaseCluster object. @@ -357,7 +384,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '/database-clusters/{name}/credentials': + '/namespaces/{namespace}/database-clusters/{name}/credentials': get: tags: - databaseCluster @@ -365,6 +392,12 @@ paths: description: Get the specified database cluster credentials operationId: getDatabaseClusterCredentials parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string - name: name in: path description: Name of the database cluster. Can be found under Metadata["name"] of the DatabaseCluster object. @@ -390,7 +423,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '/database-clusters/{name}/pitr': + '/namespaces/{namespace}/database-clusters/{name}/pitr': get: tags: - databaseCluster @@ -398,6 +431,12 @@ paths: description: Get the Point-in-Time related data for the specified database cluster operationId: getDatabaseClusterPitr parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string - name: name in: path description: Name of the database cluster. Can be found under Metadata["name"] of the DatabaseCluster object. @@ -423,13 +462,20 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '/database-engines': + '/namespaces/{namespace}/database-engines': get: tags: - databaseEngine summary: List of the available database engines description: List of available database engines operationId: listDatabaseEngines + parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string responses: '200': description: Successful operation @@ -449,7 +495,7 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '/database-engines/{name}': + '/namespaces/{namespace}/database-engines/{name}': get: tags: - databaseEngine @@ -457,6 +503,12 @@ paths: description: Get the specified database engine operationId: getDatabaseEngine parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string - name: name in: path description: Name of the database engine @@ -489,6 +541,12 @@ paths: description: Update the specified database engine operationId: updateDatabaseEngine parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string - name: name in: path description: Name of the database engine @@ -521,13 +579,20 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '/database-cluster-restores': + '/namespaces/{namespace}/database-cluster-restores': post: tags: - databaseClusterRestore summary: Create a database cluster restore description: Create a database cluster restore operationId: createDatabaseClusterRestore + parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string responses: '200': description: Successful operation @@ -566,7 +631,7 @@ paths: application/json: schema: $ref: '#/components/schemas/DatabaseClusterRestore' - '/database-cluster-restores/{name}': + '/namespaces/{namespace}/database-cluster-restores/{name}': get: tags: - databaseClusterRestore @@ -574,6 +639,12 @@ paths: description: Returns the specified cluster restore operationId: getDatabaseClusterRestore parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string - name: name in: path description: Name of the database cluster restore. Can be found under Metadata["name"] of the DatabaseClusterRestore object. @@ -606,6 +677,12 @@ paths: description: Replace the specified cluster restore operationId: updateDatabaseClusterRestore parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string - name: name in: path description: Name of the database cluster restore. Can be found under Metadata["name"] of the DatabaseClusterRestore object. @@ -651,6 +728,12 @@ paths: description: Delete the specified cluster restore operationId: deleteDatabaseClusterRestore parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string - name: name in: path description: Name of the database cluster restore. Can be found under Metadata["name"] of the DatabaseClusterRestore object. @@ -676,13 +759,20 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '/database-cluster-backups': + '/namespaces/{namespace}/database-cluster-backups': post: tags: - databaseClusterBackup summary: Create a database cluster backup description: Create a database cluster backup operationId: createDatabaseClusterBackup + parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string responses: '200': description: Successful operation @@ -721,7 +811,7 @@ paths: application/json: schema: $ref: '#/components/schemas/DatabaseClusterBackup' - '/database-cluster-backups/{name}': + '/namespaces/{namespace}/database-cluster-backups/{name}': get: tags: - databaseClusterBackup @@ -729,7 +819,14 @@ paths: description: Returns the specified cluster backup operationId: getDatabaseClusterBackup parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string - name: name + in: path description: Name of the database cluster backup. Can be found under Metadata["name"] of the DatabaseClusterBackup object. required: true @@ -761,6 +858,12 @@ paths: description: Delete the specified cluster backup operationId: deleteDatabaseClusterBackup parameters: + - name: namespace + in: path + description: Name of the namespace + required: true + schema: + type: string - name: name in: path description: Name of the database cluster backup. Can be found under Metadata["name"] of the DatabaseClusterBackup object. @@ -1155,6 +1258,10 @@ components: properties: message: type: string + NamespaceList: + type: array + items: + type: string CreateBackupStorageParams: type: object description: Backup storage parameters @@ -1182,12 +1289,18 @@ components: region: type: string x-go-type-skip-optional-pointer: true + targetNamespaces: + type: array + description: List of namespaces allowed to use this backup storage + items: + type: string required: - name - bucketName - accessKey - secretKey - type + - targetNamespaces additionalProperties: false UpdateBackupStorageParams: type: object @@ -1206,6 +1319,11 @@ components: type: string region: type: string + targetNamespaces: + type: array + description: List of namespaces allowed to use this backup storage + items: + type: string additionalProperties: false BackupStorage: type: object @@ -1227,11 +1345,17 @@ components: region: type: string x-go-type-skip-optional-pointer: true + targetNamespaces: + type: array + description: List of namespaces allowed to use this backup storage + items: + type: string additionalProperties: false required: - name - bucketName - type + - targetNamespaces BackupStoragesList: type: array items: @@ -1250,6 +1374,11 @@ components: type: string minLength: 1 x-go-type-skip-optional-pointer: true + targetNamespaces: + type: array + description: List of namespaces allowed to use this monitoring instance + items: + type: string MonitoringInstanceBaseWithName: type: object description: Monitoring instance information @@ -1287,6 +1416,7 @@ components: required: - type - url + - targetNamespaces - name MonitoringInstanceUpdateParams: description: Monitoring instance update information @@ -1300,6 +1430,7 @@ components: required: - type - url + - targetNamespaces - name MonitoringInstancesList: type: array @@ -1366,18 +1497,6 @@ components: required: - capacity - available - KubernetesClusterMonitoring: - type: object - description: Kubernetes cluster monitoring configuration - properties: - enable: - type: boolean - monitoringInstanceName: - type: string - description: Name of the monitoring instance to use for monitoring the Kubernetes cluster - x-go-type-skip-optional-pointer: true - required: - - enable KubernetesClusterInfo: type: object description: kubernetes cluster info diff --git a/go.mod b/go.mod index bd4eb782..2e3b6d91 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/labstack/echo/v4 v4.11.4 github.com/oapi-codegen/echo-middleware v1.0.1 github.com/oapi-codegen/runtime v1.1.1 - github.com/percona/everest-operator v0.6.0-dev1.0.20240202093727-ceb0bb0fb02f + github.com/percona/everest-operator v0.6.0-dev1.0.20240207144724-d5253b875e28 github.com/stretchr/testify v1.8.4 go.uber.org/zap v1.26.0 golang.org/x/crypto v0.18.0 diff --git a/go.sum b/go.sum index b1e2c2d5..258256d5 100644 --- a/go.sum +++ b/go.sum @@ -420,8 +420,8 @@ github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8P github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/percona/everest-operator v0.6.0-dev1.0.20240202093727-ceb0bb0fb02f h1:ueUTTEw7Fc2yJyIq9pugBB8qai8LuO5uOBsuDMmJL70= -github.com/percona/everest-operator v0.6.0-dev1.0.20240202093727-ceb0bb0fb02f/go.mod h1:45pGpvWrPy495qiQqxNuOJor4wif+vTTTJP4Qee8qZk= +github.com/percona/everest-operator v0.6.0-dev1.0.20240207144724-d5253b875e28 h1:N9dZVyeXzUTK+xRdz9DBcaWj3X6oUPpezEwdH2jT4cg= +github.com/percona/everest-operator v0.6.0-dev1.0.20240207144724-d5253b875e28/go.mod h1:45pGpvWrPy495qiQqxNuOJor4wif+vTTTJP4Qee8qZk= github.com/percona/percona-backup-mongodb v1.8.1-0.20230920143330-3b1c2e263901 h1:BDgsZRCjEuxl2/z4yWBqB0s8d20shuIDks7/RVdZiLs= github.com/percona/percona-backup-mongodb v1.8.1-0.20230920143330-3b1c2e263901/go.mod h1:fZRCMpUqkWlLVdRKqqaj001LoVP2eo6F0ZhoMPeXDng= github.com/percona/percona-postgresql-operator v0.0.0-20231220140959-ad5eef722609 h1:+UOK4gcHrRgqjo4smgfwT7/0apF6PhAJdQIdAV4ub/M= diff --git a/pkg/auth/token.go b/pkg/auth/token.go index 835a1929..ebbbab20 100644 --- a/pkg/auth/token.go +++ b/pkg/auth/token.go @@ -43,7 +43,7 @@ type Token struct { } type kubeClient interface { - GetSecret(ctx context.Context, name string) (*corev1.Secret, error) + GetSecret(ctx context.Context, namespace, name string) (*corev1.Secret, error) } const hashExpiration = 3 * time.Second @@ -106,7 +106,7 @@ func (p *Token) hashFromSecret(ctx context.Context) (string, error) { func (p *Token) hashFromK8s(ctx context.Context) ([]byte, error) { p.l.Debug("Getting token hash from k8s") - secret, err := p.kubeClient.GetSecret(ctx, "everest-token") + secret, err := p.kubeClient.GetSecret(ctx, "percona-everest", "everest-token") if err != nil { return nil, errors.Join(err, errors.New("could not get stored token from Kubernetes")) } diff --git a/pkg/kubernetes/backup_storage.go b/pkg/kubernetes/backup_storage.go index 286246c2..4565f8a0 100644 --- a/pkg/kubernetes/backup_storage.go +++ b/pkg/kubernetes/backup_storage.go @@ -60,6 +60,12 @@ func (k *Kubernetes) IsBackupStorageUsed(ctx context.Context, backupStorageName if err != nil { return false, err } + + namespaces, err := k.GetDBNamespaces(ctx, k.Namespace()) + if err != nil { + return false, err + } + options := metav1.ListOptions{ LabelSelector: metav1.FormatLabelSelector(&metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -67,26 +73,30 @@ func (k *Kubernetes) IsBackupStorageUsed(ctx context.Context, backupStorageName }, }), } - list, err := k.client.ListDatabaseClusters(ctx, options) - if err != nil { - return false, err - } - if len(list.Items) > 0 { - return true, nil - } - bList, err := k.client.ListDatabaseClusterBackups(ctx, options) - if err != nil { - return false, err - } - if len(bList.Items) > 0 { - return true, nil - } - rList, err := k.client.ListDatabaseClusterRestores(ctx, options) - if err != nil { - return false, err - } - if len(rList.Items) > 0 { - return true, nil + + for _, namespace := range namespaces { + list, err := k.client.ListDatabaseClusters(ctx, namespace, options) + if err != nil { + return false, err + } + if len(list.Items) > 0 { + return true, nil + } + bList, err := k.client.ListDatabaseClusterBackups(ctx, namespace, options) + if err != nil { + return false, err + } + if len(bList.Items) > 0 { + return true, nil + } + rList, err := k.client.ListDatabaseClusterRestores(ctx, namespace, options) + if err != nil { + return false, err + } + if len(rList.Items) > 0 { + return true, nil + } } + return false, nil } diff --git a/pkg/kubernetes/client/client.go b/pkg/kubernetes/client/client.go index 1041525e..30e248f5 100644 --- a/pkg/kubernetes/client/client.go +++ b/pkg/kubernetes/client/client.go @@ -17,10 +17,13 @@ package client import ( + "context" "errors" "os" "time" + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -269,3 +272,16 @@ func (c *Client) helperForGVK(gvk schema.GroupVersionKind) (*resource.Helper, er return resource.NewHelper(cli, mapping), nil } + +// GetConfigMap fetches the config map in the provided namespace. +func (c *Client) GetConfigMap(ctx context.Context, namespace, name string) (*corev1.ConfigMap, error) { + return c.clientset.CoreV1().ConfigMaps(namespace).Get(ctx, name, metav1.GetOptions{}) +} + +// GetDeployment returns deployment by name. +func (c *Client) GetDeployment(ctx context.Context, name string, namespace string) (*appsv1.Deployment, error) { + if namespace == "" { + namespace = c.namespace + } + return c.clientset.AppsV1().Deployments(namespace).Get(ctx, name, metav1.GetOptions{}) +} diff --git a/pkg/kubernetes/client/database_cluster.go b/pkg/kubernetes/client/database_cluster.go index 36e90fad..5ccfaca8 100644 --- a/pkg/kubernetes/client/database_cluster.go +++ b/pkg/kubernetes/client/database_cluster.go @@ -8,11 +8,11 @@ import ( ) // ListDatabaseClusters returns list of managed database clusters. -func (c *Client) ListDatabaseClusters(ctx context.Context, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterList, error) { - return c.customClientSet.DBClusters(c.namespace).List(ctx, options) +func (c *Client) ListDatabaseClusters(ctx context.Context, namespace string, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterList, error) { + return c.customClientSet.DBClusters(namespace).List(ctx, options) } // GetDatabaseCluster returns database clusters by provided name. -func (c *Client) GetDatabaseCluster(ctx context.Context, name string) (*everestv1alpha1.DatabaseCluster, error) { - return c.customClientSet.DBClusters(c.namespace).Get(ctx, name, metav1.GetOptions{}) +func (c *Client) GetDatabaseCluster(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseCluster, error) { + return c.customClientSet.DBClusters(namespace).Get(ctx, name, metav1.GetOptions{}) } diff --git a/pkg/kubernetes/client/database_cluster_backup.go b/pkg/kubernetes/client/database_cluster_backup.go index 2ae089a0..83dbfc0d 100644 --- a/pkg/kubernetes/client/database_cluster_backup.go +++ b/pkg/kubernetes/client/database_cluster_backup.go @@ -8,11 +8,11 @@ import ( ) // ListDatabaseClusterBackups returns list of managed database cluster backups. -func (c *Client) ListDatabaseClusterBackups(ctx context.Context, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterBackupList, error) { - return c.customClientSet.DBClusterBackups(c.namespace).List(ctx, options) +func (c *Client) ListDatabaseClusterBackups(ctx context.Context, namespace string, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterBackupList, error) { + return c.customClientSet.DBClusterBackups(namespace).List(ctx, options) } // GetDatabaseClusterBackup returns database cluster backups by provided name. -func (c *Client) GetDatabaseClusterBackup(ctx context.Context, name string) (*everestv1alpha1.DatabaseClusterBackup, error) { - return c.customClientSet.DBClusterBackups(c.namespace).Get(ctx, name, metav1.GetOptions{}) +func (c *Client) GetDatabaseClusterBackup(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseClusterBackup, error) { + return c.customClientSet.DBClusterBackups(namespace).Get(ctx, name, metav1.GetOptions{}) } diff --git a/pkg/kubernetes/client/database_cluster_restore.go b/pkg/kubernetes/client/database_cluster_restore.go index e341b064..c0a70ce6 100644 --- a/pkg/kubernetes/client/database_cluster_restore.go +++ b/pkg/kubernetes/client/database_cluster_restore.go @@ -8,11 +8,11 @@ import ( ) // ListDatabaseClusterRestores returns list of managed database clusters. -func (c *Client) ListDatabaseClusterRestores(ctx context.Context, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterRestoreList, error) { - return c.customClientSet.DBClusterRestores(c.namespace).List(ctx, options) +func (c *Client) ListDatabaseClusterRestores(ctx context.Context, namespace string, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterRestoreList, error) { + return c.customClientSet.DBClusterRestores(namespace).List(ctx, options) } // GetDatabaseClusterRestore returns database clusters by provided name. -func (c *Client) GetDatabaseClusterRestore(ctx context.Context, name string) (*everestv1alpha1.DatabaseClusterRestore, error) { - return c.customClientSet.DBClusterRestores(c.namespace).Get(ctx, name, metav1.GetOptions{}) +func (c *Client) GetDatabaseClusterRestore(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseClusterRestore, error) { + return c.customClientSet.DBClusterRestores(namespace).Get(ctx, name, metav1.GetOptions{}) } diff --git a/pkg/kubernetes/client/database_engine.go b/pkg/kubernetes/client/database_engine.go index 452598df..3cc4ca16 100644 --- a/pkg/kubernetes/client/database_engine.go +++ b/pkg/kubernetes/client/database_engine.go @@ -8,11 +8,11 @@ import ( ) // ListDatabaseEngines returns list of managed database clusters. -func (c *Client) ListDatabaseEngines(ctx context.Context) (*everestv1alpha1.DatabaseEngineList, error) { - return c.customClientSet.DBEngines(c.namespace).List(ctx, metav1.ListOptions{}) +func (c *Client) ListDatabaseEngines(ctx context.Context, namespace string) (*everestv1alpha1.DatabaseEngineList, error) { + return c.customClientSet.DBEngines(namespace).List(ctx, metav1.ListOptions{}) } // GetDatabaseEngine returns database clusters by provided name. -func (c *Client) GetDatabaseEngine(ctx context.Context, name string) (*everestv1alpha1.DatabaseEngine, error) { - return c.customClientSet.DBEngines(c.namespace).Get(ctx, name, metav1.GetOptions{}) +func (c *Client) GetDatabaseEngine(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseEngine, error) { + return c.customClientSet.DBEngines(namespace).Get(ctx, name, metav1.GetOptions{}) } diff --git a/pkg/kubernetes/client/kubeclient_interface.go b/pkg/kubernetes/client/kubeclient_interface.go index 0fa4b29f..002325d7 100644 --- a/pkg/kubernetes/client/kubeclient_interface.go +++ b/pkg/kubernetes/client/kubeclient_interface.go @@ -6,6 +6,7 @@ import ( "context" everestv1alpha1 "github.com/percona/everest-operator/api/v1alpha1" + appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -44,32 +45,36 @@ type KubeClientConnector interface { ListObjects(gvk schema.GroupVersionKind, into runtime.Object) error // GetObject retrieves an object by provided group, version, kind and name. GetObject(gvk schema.GroupVersionKind, name string, into runtime.Object) error + // GetConfigMap fetches the config map in the provided namespace. + GetConfigMap(ctx context.Context, namespace, name string) (*corev1.ConfigMap, error) + // GetDeployment returns deployment by name. + GetDeployment(ctx context.Context, name string, namespace string) (*appsv1.Deployment, error) // ListDatabaseClusters returns list of managed database clusters. - ListDatabaseClusters(ctx context.Context, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterList, error) + ListDatabaseClusters(ctx context.Context, namespace string, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterList, error) // GetDatabaseCluster returns database clusters by provided name. - GetDatabaseCluster(ctx context.Context, name string) (*everestv1alpha1.DatabaseCluster, error) + GetDatabaseCluster(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseCluster, error) // ListDatabaseClusterBackups returns list of managed database cluster backups. - ListDatabaseClusterBackups(ctx context.Context, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterBackupList, error) + ListDatabaseClusterBackups(ctx context.Context, namespace string, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterBackupList, error) // GetDatabaseClusterBackup returns database cluster backups by provided name. - GetDatabaseClusterBackup(ctx context.Context, name string) (*everestv1alpha1.DatabaseClusterBackup, error) + GetDatabaseClusterBackup(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseClusterBackup, error) // ListDatabaseClusterRestores returns list of managed database clusters. - ListDatabaseClusterRestores(ctx context.Context, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterRestoreList, error) + ListDatabaseClusterRestores(ctx context.Context, namespace string, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterRestoreList, error) // GetDatabaseClusterRestore returns database clusters by provided name. - GetDatabaseClusterRestore(ctx context.Context, name string) (*everestv1alpha1.DatabaseClusterRestore, error) + GetDatabaseClusterRestore(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseClusterRestore, error) // ListDatabaseEngines returns list of managed database clusters. - ListDatabaseEngines(ctx context.Context) (*everestv1alpha1.DatabaseEngineList, error) + ListDatabaseEngines(ctx context.Context, namespace string) (*everestv1alpha1.DatabaseEngineList, error) // GetDatabaseEngine returns database clusters by provided name. - GetDatabaseEngine(ctx context.Context, name string) (*everestv1alpha1.DatabaseEngine, error) + GetDatabaseEngine(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseEngine, error) // CreateMonitoringConfig creates an monitoringConfig. CreateMonitoringConfig(ctx context.Context, config *everestv1alpha1.MonitoringConfig) error // UpdateMonitoringConfig updates an monitoringConfig. UpdateMonitoringConfig(ctx context.Context, config *everestv1alpha1.MonitoringConfig) error // GetMonitoringConfig returns the monitoringConfig. - GetMonitoringConfig(ctx context.Context, name string) (*everestv1alpha1.MonitoringConfig, error) + GetMonitoringConfig(ctx context.Context, namespace, name string) (*everestv1alpha1.MonitoringConfig, error) // ListMonitoringConfigs returns the monitoringConfig. - ListMonitoringConfigs(ctx context.Context) (*everestv1alpha1.MonitoringConfigList, error) + ListMonitoringConfigs(ctx context.Context, namespace string) (*everestv1alpha1.MonitoringConfigList, error) // DeleteMonitoringConfig deletes the monitoringConfig. - DeleteMonitoringConfig(ctx context.Context, name string) error + DeleteMonitoringConfig(ctx context.Context, namespace, name string) error // GetNamespace returns a namespace. GetNamespace(ctx context.Context, name string) (*corev1.Namespace, error) // GetNodes returns list of nodes. @@ -77,13 +82,13 @@ type KubeClientConnector interface { // GetPods returns list of pods. GetPods(ctx context.Context, namespace string, labelSelector *metav1.LabelSelector) (*corev1.PodList, error) // GetSecret returns secret by name. - GetSecret(ctx context.Context, name string) (*corev1.Secret, error) + GetSecret(ctx context.Context, namespace, name string) (*corev1.Secret, error) // UpdateSecret updates k8s Secret. UpdateSecret(ctx context.Context, secret *corev1.Secret) (*corev1.Secret, error) // CreateSecret creates k8s Secret. CreateSecret(ctx context.Context, secret *corev1.Secret) (*corev1.Secret, error) // DeleteSecret deletes the k8s Secret. - DeleteSecret(ctx context.Context, name string) error + DeleteSecret(ctx context.Context, namespace, name string) error // GetStorageClasses returns all storage classes available in the cluster. GetStorageClasses(ctx context.Context) (*storagev1.StorageClassList, error) // GetPersistentVolumes returns Persistent Volumes available in the cluster. diff --git a/pkg/kubernetes/client/mock_kube_client_connector.go b/pkg/kubernetes/client/mock_kube_client_connector.go index d9691256..d77a86fa 100644 --- a/pkg/kubernetes/client/mock_kube_client_connector.go +++ b/pkg/kubernetes/client/mock_kube_client_connector.go @@ -7,6 +7,7 @@ import ( v1alpha1 "github.com/percona/everest-operator/api/v1alpha1" mock "github.com/stretchr/testify/mock" + appsv1 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -161,17 +162,17 @@ func (_m *MockKubeClientConnector) DeleteBackupStorage(ctx context.Context, name return r0 } -// DeleteMonitoringConfig provides a mock function with given fields: ctx, name -func (_m *MockKubeClientConnector) DeleteMonitoringConfig(ctx context.Context, name string) error { - ret := _m.Called(ctx, name) +// DeleteMonitoringConfig provides a mock function with given fields: ctx, namespace, name +func (_m *MockKubeClientConnector) DeleteMonitoringConfig(ctx context.Context, namespace string, name string) error { + ret := _m.Called(ctx, namespace, name) if len(ret) == 0 { panic("no return value specified for DeleteMonitoringConfig") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, name) + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, namespace, name) } else { r0 = ret.Error(0) } @@ -197,17 +198,17 @@ func (_m *MockKubeClientConnector) DeleteObject(obj runtime.Object) error { return r0 } -// DeleteSecret provides a mock function with given fields: ctx, name -func (_m *MockKubeClientConnector) DeleteSecret(ctx context.Context, name string) error { - ret := _m.Called(ctx, name) +// DeleteSecret provides a mock function with given fields: ctx, namespace, name +func (_m *MockKubeClientConnector) DeleteSecret(ctx context.Context, namespace string, name string) error { + ret := _m.Called(ctx, namespace, name) if len(ret) == 0 { panic("no return value specified for DeleteSecret") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, name) + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, namespace, name) } else { r0 = ret.Error(0) } @@ -245,9 +246,39 @@ func (_m *MockKubeClientConnector) GetBackupStorage(ctx context.Context, name st return r0, r1 } -// GetDatabaseCluster provides a mock function with given fields: ctx, name -func (_m *MockKubeClientConnector) GetDatabaseCluster(ctx context.Context, name string) (*v1alpha1.DatabaseCluster, error) { - ret := _m.Called(ctx, name) +// GetConfigMap provides a mock function with given fields: ctx, namespace, name +func (_m *MockKubeClientConnector) GetConfigMap(ctx context.Context, namespace string, name string) (*v1.ConfigMap, error) { + ret := _m.Called(ctx, namespace, name) + + if len(ret) == 0 { + panic("no return value specified for GetConfigMap") + } + + var r0 *v1.ConfigMap + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*v1.ConfigMap, error)); ok { + return rf(ctx, namespace, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) *v1.ConfigMap); ok { + r0 = rf(ctx, namespace, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.ConfigMap) + } + } + + 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 +} + +// GetDatabaseCluster provides a mock function with given fields: ctx, namespace, name +func (_m *MockKubeClientConnector) GetDatabaseCluster(ctx context.Context, namespace string, name string) (*v1alpha1.DatabaseCluster, error) { + ret := _m.Called(ctx, namespace, name) if len(ret) == 0 { panic("no return value specified for GetDatabaseCluster") @@ -255,19 +286,19 @@ func (_m *MockKubeClientConnector) GetDatabaseCluster(ctx context.Context, name var r0 *v1alpha1.DatabaseCluster var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*v1alpha1.DatabaseCluster, error)); ok { - return rf(ctx, name) + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*v1alpha1.DatabaseCluster, error)); ok { + return rf(ctx, namespace, name) } - if rf, ok := ret.Get(0).(func(context.Context, string) *v1alpha1.DatabaseCluster); ok { - r0 = rf(ctx, name) + if rf, ok := ret.Get(0).(func(context.Context, string, string) *v1alpha1.DatabaseCluster); ok { + r0 = rf(ctx, namespace, name) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1alpha1.DatabaseCluster) } } - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, namespace, name) } else { r1 = ret.Error(1) } @@ -275,9 +306,9 @@ func (_m *MockKubeClientConnector) GetDatabaseCluster(ctx context.Context, name return r0, r1 } -// GetDatabaseClusterBackup provides a mock function with given fields: ctx, name -func (_m *MockKubeClientConnector) GetDatabaseClusterBackup(ctx context.Context, name string) (*v1alpha1.DatabaseClusterBackup, error) { - ret := _m.Called(ctx, name) +// GetDatabaseClusterBackup provides a mock function with given fields: ctx, namespace, name +func (_m *MockKubeClientConnector) GetDatabaseClusterBackup(ctx context.Context, namespace string, name string) (*v1alpha1.DatabaseClusterBackup, error) { + ret := _m.Called(ctx, namespace, name) if len(ret) == 0 { panic("no return value specified for GetDatabaseClusterBackup") @@ -285,19 +316,19 @@ func (_m *MockKubeClientConnector) GetDatabaseClusterBackup(ctx context.Context, var r0 *v1alpha1.DatabaseClusterBackup var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*v1alpha1.DatabaseClusterBackup, error)); ok { - return rf(ctx, name) + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*v1alpha1.DatabaseClusterBackup, error)); ok { + return rf(ctx, namespace, name) } - if rf, ok := ret.Get(0).(func(context.Context, string) *v1alpha1.DatabaseClusterBackup); ok { - r0 = rf(ctx, name) + if rf, ok := ret.Get(0).(func(context.Context, string, string) *v1alpha1.DatabaseClusterBackup); ok { + r0 = rf(ctx, namespace, name) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1alpha1.DatabaseClusterBackup) } } - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, namespace, name) } else { r1 = ret.Error(1) } @@ -305,9 +336,9 @@ func (_m *MockKubeClientConnector) GetDatabaseClusterBackup(ctx context.Context, return r0, r1 } -// GetDatabaseClusterRestore provides a mock function with given fields: ctx, name -func (_m *MockKubeClientConnector) GetDatabaseClusterRestore(ctx context.Context, name string) (*v1alpha1.DatabaseClusterRestore, error) { - ret := _m.Called(ctx, name) +// GetDatabaseClusterRestore provides a mock function with given fields: ctx, namespace, name +func (_m *MockKubeClientConnector) GetDatabaseClusterRestore(ctx context.Context, namespace string, name string) (*v1alpha1.DatabaseClusterRestore, error) { + ret := _m.Called(ctx, namespace, name) if len(ret) == 0 { panic("no return value specified for GetDatabaseClusterRestore") @@ -315,19 +346,19 @@ func (_m *MockKubeClientConnector) GetDatabaseClusterRestore(ctx context.Context var r0 *v1alpha1.DatabaseClusterRestore var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*v1alpha1.DatabaseClusterRestore, error)); ok { - return rf(ctx, name) + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*v1alpha1.DatabaseClusterRestore, error)); ok { + return rf(ctx, namespace, name) } - if rf, ok := ret.Get(0).(func(context.Context, string) *v1alpha1.DatabaseClusterRestore); ok { - r0 = rf(ctx, name) + if rf, ok := ret.Get(0).(func(context.Context, string, string) *v1alpha1.DatabaseClusterRestore); ok { + r0 = rf(ctx, namespace, name) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1alpha1.DatabaseClusterRestore) } } - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, namespace, name) } else { r1 = ret.Error(1) } @@ -335,9 +366,9 @@ func (_m *MockKubeClientConnector) GetDatabaseClusterRestore(ctx context.Context return r0, r1 } -// GetDatabaseEngine provides a mock function with given fields: ctx, name -func (_m *MockKubeClientConnector) GetDatabaseEngine(ctx context.Context, name string) (*v1alpha1.DatabaseEngine, error) { - ret := _m.Called(ctx, name) +// GetDatabaseEngine provides a mock function with given fields: ctx, namespace, name +func (_m *MockKubeClientConnector) GetDatabaseEngine(ctx context.Context, namespace string, name string) (*v1alpha1.DatabaseEngine, error) { + ret := _m.Called(ctx, namespace, name) if len(ret) == 0 { panic("no return value specified for GetDatabaseEngine") @@ -345,19 +376,19 @@ func (_m *MockKubeClientConnector) GetDatabaseEngine(ctx context.Context, name s var r0 *v1alpha1.DatabaseEngine var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*v1alpha1.DatabaseEngine, error)); ok { - return rf(ctx, name) + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*v1alpha1.DatabaseEngine, error)); ok { + return rf(ctx, namespace, name) } - if rf, ok := ret.Get(0).(func(context.Context, string) *v1alpha1.DatabaseEngine); ok { - r0 = rf(ctx, name) + if rf, ok := ret.Get(0).(func(context.Context, string, string) *v1alpha1.DatabaseEngine); ok { + r0 = rf(ctx, namespace, name) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1alpha1.DatabaseEngine) } } - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, namespace, name) } else { r1 = ret.Error(1) } @@ -365,9 +396,39 @@ func (_m *MockKubeClientConnector) GetDatabaseEngine(ctx context.Context, name s return r0, r1 } -// GetMonitoringConfig provides a mock function with given fields: ctx, name -func (_m *MockKubeClientConnector) GetMonitoringConfig(ctx context.Context, name string) (*v1alpha1.MonitoringConfig, error) { - ret := _m.Called(ctx, name) +// GetDeployment provides a mock function with given fields: ctx, name, namespace +func (_m *MockKubeClientConnector) GetDeployment(ctx context.Context, name string, namespace string) (*appsv1.Deployment, error) { + ret := _m.Called(ctx, name, namespace) + + if len(ret) == 0 { + panic("no return value specified for GetDeployment") + } + + var r0 *appsv1.Deployment + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*appsv1.Deployment, error)); ok { + return rf(ctx, name, namespace) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) *appsv1.Deployment); ok { + r0 = rf(ctx, name, namespace) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*appsv1.Deployment) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, name, namespace) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetMonitoringConfig provides a mock function with given fields: ctx, namespace, name +func (_m *MockKubeClientConnector) GetMonitoringConfig(ctx context.Context, namespace string, name string) (*v1alpha1.MonitoringConfig, error) { + ret := _m.Called(ctx, namespace, name) if len(ret) == 0 { panic("no return value specified for GetMonitoringConfig") @@ -375,19 +436,19 @@ func (_m *MockKubeClientConnector) GetMonitoringConfig(ctx context.Context, name var r0 *v1alpha1.MonitoringConfig var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*v1alpha1.MonitoringConfig, error)); ok { - return rf(ctx, name) + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*v1alpha1.MonitoringConfig, error)); ok { + return rf(ctx, namespace, name) } - if rf, ok := ret.Get(0).(func(context.Context, string) *v1alpha1.MonitoringConfig); ok { - r0 = rf(ctx, name) + if rf, ok := ret.Get(0).(func(context.Context, string, string) *v1alpha1.MonitoringConfig); ok { + r0 = rf(ctx, namespace, name) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1alpha1.MonitoringConfig) } } - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, namespace, name) } else { r1 = ret.Error(1) } @@ -533,9 +594,9 @@ func (_m *MockKubeClientConnector) GetPods(ctx context.Context, namespace string return r0, r1 } -// GetSecret provides a mock function with given fields: ctx, name -func (_m *MockKubeClientConnector) GetSecret(ctx context.Context, name string) (*v1.Secret, error) { - ret := _m.Called(ctx, name) +// GetSecret provides a mock function with given fields: ctx, namespace, name +func (_m *MockKubeClientConnector) GetSecret(ctx context.Context, namespace string, name string) (*v1.Secret, error) { + ret := _m.Called(ctx, namespace, name) if len(ret) == 0 { panic("no return value specified for GetSecret") @@ -543,19 +604,19 @@ func (_m *MockKubeClientConnector) GetSecret(ctx context.Context, name string) ( var r0 *v1.Secret var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*v1.Secret, error)); ok { - return rf(ctx, name) + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*v1.Secret, error)); ok { + return rf(ctx, namespace, name) } - if rf, ok := ret.Get(0).(func(context.Context, string) *v1.Secret); ok { - r0 = rf(ctx, name) + if rf, ok := ret.Get(0).(func(context.Context, string, string) *v1.Secret); ok { + r0 = rf(ctx, namespace, name) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1.Secret) } } - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, namespace, name) } else { r1 = ret.Error(1) } @@ -653,9 +714,9 @@ func (_m *MockKubeClientConnector) ListBackupStorages(ctx context.Context, optio return r0, r1 } -// ListDatabaseClusterBackups provides a mock function with given fields: ctx, options -func (_m *MockKubeClientConnector) ListDatabaseClusterBackups(ctx context.Context, options metav1.ListOptions) (*v1alpha1.DatabaseClusterBackupList, error) { - ret := _m.Called(ctx, options) +// ListDatabaseClusterBackups provides a mock function with given fields: ctx, namespace, options +func (_m *MockKubeClientConnector) ListDatabaseClusterBackups(ctx context.Context, namespace string, options metav1.ListOptions) (*v1alpha1.DatabaseClusterBackupList, error) { + ret := _m.Called(ctx, namespace, options) if len(ret) == 0 { panic("no return value specified for ListDatabaseClusterBackups") @@ -663,19 +724,19 @@ func (_m *MockKubeClientConnector) ListDatabaseClusterBackups(ctx context.Contex var r0 *v1alpha1.DatabaseClusterBackupList var r1 error - if rf, ok := ret.Get(0).(func(context.Context, metav1.ListOptions) (*v1alpha1.DatabaseClusterBackupList, error)); ok { - return rf(ctx, options) + if rf, ok := ret.Get(0).(func(context.Context, string, metav1.ListOptions) (*v1alpha1.DatabaseClusterBackupList, error)); ok { + return rf(ctx, namespace, options) } - if rf, ok := ret.Get(0).(func(context.Context, metav1.ListOptions) *v1alpha1.DatabaseClusterBackupList); ok { - r0 = rf(ctx, options) + if rf, ok := ret.Get(0).(func(context.Context, string, metav1.ListOptions) *v1alpha1.DatabaseClusterBackupList); ok { + r0 = rf(ctx, namespace, options) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1alpha1.DatabaseClusterBackupList) } } - if rf, ok := ret.Get(1).(func(context.Context, metav1.ListOptions) error); ok { - r1 = rf(ctx, options) + if rf, ok := ret.Get(1).(func(context.Context, string, metav1.ListOptions) error); ok { + r1 = rf(ctx, namespace, options) } else { r1 = ret.Error(1) } @@ -683,9 +744,9 @@ func (_m *MockKubeClientConnector) ListDatabaseClusterBackups(ctx context.Contex return r0, r1 } -// ListDatabaseClusterRestores provides a mock function with given fields: ctx, options -func (_m *MockKubeClientConnector) ListDatabaseClusterRestores(ctx context.Context, options metav1.ListOptions) (*v1alpha1.DatabaseClusterRestoreList, error) { - ret := _m.Called(ctx, options) +// ListDatabaseClusterRestores provides a mock function with given fields: ctx, namespace, options +func (_m *MockKubeClientConnector) ListDatabaseClusterRestores(ctx context.Context, namespace string, options metav1.ListOptions) (*v1alpha1.DatabaseClusterRestoreList, error) { + ret := _m.Called(ctx, namespace, options) if len(ret) == 0 { panic("no return value specified for ListDatabaseClusterRestores") @@ -693,19 +754,19 @@ func (_m *MockKubeClientConnector) ListDatabaseClusterRestores(ctx context.Conte var r0 *v1alpha1.DatabaseClusterRestoreList var r1 error - if rf, ok := ret.Get(0).(func(context.Context, metav1.ListOptions) (*v1alpha1.DatabaseClusterRestoreList, error)); ok { - return rf(ctx, options) + if rf, ok := ret.Get(0).(func(context.Context, string, metav1.ListOptions) (*v1alpha1.DatabaseClusterRestoreList, error)); ok { + return rf(ctx, namespace, options) } - if rf, ok := ret.Get(0).(func(context.Context, metav1.ListOptions) *v1alpha1.DatabaseClusterRestoreList); ok { - r0 = rf(ctx, options) + if rf, ok := ret.Get(0).(func(context.Context, string, metav1.ListOptions) *v1alpha1.DatabaseClusterRestoreList); ok { + r0 = rf(ctx, namespace, options) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1alpha1.DatabaseClusterRestoreList) } } - if rf, ok := ret.Get(1).(func(context.Context, metav1.ListOptions) error); ok { - r1 = rf(ctx, options) + if rf, ok := ret.Get(1).(func(context.Context, string, metav1.ListOptions) error); ok { + r1 = rf(ctx, namespace, options) } else { r1 = ret.Error(1) } @@ -713,9 +774,9 @@ func (_m *MockKubeClientConnector) ListDatabaseClusterRestores(ctx context.Conte return r0, r1 } -// ListDatabaseClusters provides a mock function with given fields: ctx, options -func (_m *MockKubeClientConnector) ListDatabaseClusters(ctx context.Context, options metav1.ListOptions) (*v1alpha1.DatabaseClusterList, error) { - ret := _m.Called(ctx, options) +// ListDatabaseClusters provides a mock function with given fields: ctx, namespace, options +func (_m *MockKubeClientConnector) ListDatabaseClusters(ctx context.Context, namespace string, options metav1.ListOptions) (*v1alpha1.DatabaseClusterList, error) { + ret := _m.Called(ctx, namespace, options) if len(ret) == 0 { panic("no return value specified for ListDatabaseClusters") @@ -723,19 +784,19 @@ func (_m *MockKubeClientConnector) ListDatabaseClusters(ctx context.Context, opt var r0 *v1alpha1.DatabaseClusterList var r1 error - if rf, ok := ret.Get(0).(func(context.Context, metav1.ListOptions) (*v1alpha1.DatabaseClusterList, error)); ok { - return rf(ctx, options) + if rf, ok := ret.Get(0).(func(context.Context, string, metav1.ListOptions) (*v1alpha1.DatabaseClusterList, error)); ok { + return rf(ctx, namespace, options) } - if rf, ok := ret.Get(0).(func(context.Context, metav1.ListOptions) *v1alpha1.DatabaseClusterList); ok { - r0 = rf(ctx, options) + if rf, ok := ret.Get(0).(func(context.Context, string, metav1.ListOptions) *v1alpha1.DatabaseClusterList); ok { + r0 = rf(ctx, namespace, options) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1alpha1.DatabaseClusterList) } } - if rf, ok := ret.Get(1).(func(context.Context, metav1.ListOptions) error); ok { - r1 = rf(ctx, options) + if rf, ok := ret.Get(1).(func(context.Context, string, metav1.ListOptions) error); ok { + r1 = rf(ctx, namespace, options) } else { r1 = ret.Error(1) } @@ -743,9 +804,9 @@ func (_m *MockKubeClientConnector) ListDatabaseClusters(ctx context.Context, opt return r0, r1 } -// ListDatabaseEngines provides a mock function with given fields: ctx -func (_m *MockKubeClientConnector) ListDatabaseEngines(ctx context.Context) (*v1alpha1.DatabaseEngineList, error) { - ret := _m.Called(ctx) +// ListDatabaseEngines provides a mock function with given fields: ctx, namespace +func (_m *MockKubeClientConnector) ListDatabaseEngines(ctx context.Context, namespace string) (*v1alpha1.DatabaseEngineList, error) { + ret := _m.Called(ctx, namespace) if len(ret) == 0 { panic("no return value specified for ListDatabaseEngines") @@ -753,19 +814,19 @@ func (_m *MockKubeClientConnector) ListDatabaseEngines(ctx context.Context) (*v1 var r0 *v1alpha1.DatabaseEngineList var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*v1alpha1.DatabaseEngineList, error)); ok { - return rf(ctx) + if rf, ok := ret.Get(0).(func(context.Context, string) (*v1alpha1.DatabaseEngineList, error)); ok { + return rf(ctx, namespace) } - if rf, ok := ret.Get(0).(func(context.Context) *v1alpha1.DatabaseEngineList); ok { - r0 = rf(ctx) + if rf, ok := ret.Get(0).(func(context.Context, string) *v1alpha1.DatabaseEngineList); ok { + r0 = rf(ctx, namespace) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1alpha1.DatabaseEngineList) } } - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, namespace) } else { r1 = ret.Error(1) } @@ -773,9 +834,9 @@ func (_m *MockKubeClientConnector) ListDatabaseEngines(ctx context.Context) (*v1 return r0, r1 } -// ListMonitoringConfigs provides a mock function with given fields: ctx -func (_m *MockKubeClientConnector) ListMonitoringConfigs(ctx context.Context) (*v1alpha1.MonitoringConfigList, error) { - ret := _m.Called(ctx) +// ListMonitoringConfigs provides a mock function with given fields: ctx, namespace +func (_m *MockKubeClientConnector) ListMonitoringConfigs(ctx context.Context, namespace string) (*v1alpha1.MonitoringConfigList, error) { + ret := _m.Called(ctx, namespace) if len(ret) == 0 { panic("no return value specified for ListMonitoringConfigs") @@ -783,19 +844,19 @@ func (_m *MockKubeClientConnector) ListMonitoringConfigs(ctx context.Context) (* var r0 *v1alpha1.MonitoringConfigList var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*v1alpha1.MonitoringConfigList, error)); ok { - return rf(ctx) + if rf, ok := ret.Get(0).(func(context.Context, string) (*v1alpha1.MonitoringConfigList, error)); ok { + return rf(ctx, namespace) } - if rf, ok := ret.Get(0).(func(context.Context) *v1alpha1.MonitoringConfigList); ok { - r0 = rf(ctx) + if rf, ok := ret.Get(0).(func(context.Context, string) *v1alpha1.MonitoringConfigList); ok { + r0 = rf(ctx, namespace) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1alpha1.MonitoringConfigList) } } - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, namespace) } else { r1 = ret.Error(1) } diff --git a/pkg/kubernetes/client/monitoring_config.go b/pkg/kubernetes/client/monitoring_config.go index c81ec291..12eb81d4 100644 --- a/pkg/kubernetes/client/monitoring_config.go +++ b/pkg/kubernetes/client/monitoring_config.go @@ -36,16 +36,16 @@ func (c *Client) UpdateMonitoringConfig(ctx context.Context, config *everestv1al } // GetMonitoringConfig returns the monitoringConfig. -func (c *Client) GetMonitoringConfig(ctx context.Context, name string) (*everestv1alpha1.MonitoringConfig, error) { - return c.customClientSet.MonitoringConfig(c.namespace).Get(ctx, name, metav1.GetOptions{}) +func (c *Client) GetMonitoringConfig(ctx context.Context, namespace, name string) (*everestv1alpha1.MonitoringConfig, error) { + return c.customClientSet.MonitoringConfig(namespace).Get(ctx, name, metav1.GetOptions{}) } // ListMonitoringConfigs returns the monitoringConfig. -func (c *Client) ListMonitoringConfigs(ctx context.Context) (*everestv1alpha1.MonitoringConfigList, error) { - return c.customClientSet.MonitoringConfig(c.namespace).List(ctx, metav1.ListOptions{}) +func (c *Client) ListMonitoringConfigs(ctx context.Context, namespace string) (*everestv1alpha1.MonitoringConfigList, error) { + return c.customClientSet.MonitoringConfig(namespace).List(ctx, metav1.ListOptions{}) } // DeleteMonitoringConfig deletes the monitoringConfig. -func (c *Client) DeleteMonitoringConfig(ctx context.Context, name string) error { - return c.customClientSet.MonitoringConfig(c.namespace).Delete(ctx, name, metav1.DeleteOptions{}) +func (c *Client) DeleteMonitoringConfig(ctx context.Context, namespace, name string) error { + return c.customClientSet.MonitoringConfig(namespace).Delete(ctx, name, metav1.DeleteOptions{}) } diff --git a/pkg/kubernetes/client/secret.go b/pkg/kubernetes/client/secret.go index a29d52d7..057866e1 100644 --- a/pkg/kubernetes/client/secret.go +++ b/pkg/kubernetes/client/secret.go @@ -8,21 +8,21 @@ import ( ) // 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{}) +func (c *Client) GetSecret(ctx context.Context, namespace, name string) (*corev1.Secret, error) { + return c.clientset.CoreV1().Secrets(namespace).Get(ctx, name, metav1.GetOptions{}) } // UpdateSecret updates k8s Secret. func (c *Client) UpdateSecret(ctx context.Context, secret *corev1.Secret) (*corev1.Secret, error) { - return c.clientset.CoreV1().Secrets(c.namespace).Update(ctx, secret, metav1.UpdateOptions{}) + return c.clientset.CoreV1().Secrets(secret.Namespace).Update(ctx, secret, metav1.UpdateOptions{}) } // CreateSecret creates k8s Secret. func (c *Client) CreateSecret(ctx context.Context, secret *corev1.Secret) (*corev1.Secret, error) { - return c.clientset.CoreV1().Secrets(c.namespace).Create(ctx, secret, metav1.CreateOptions{}) + return c.clientset.CoreV1().Secrets(secret.Namespace).Create(ctx, secret, metav1.CreateOptions{}) } // DeleteSecret deletes the k8s Secret. -func (c *Client) DeleteSecret(ctx context.Context, name string) error { - return c.clientset.CoreV1().Secrets(c.namespace).Delete(ctx, name, metav1.DeleteOptions{}) +func (c *Client) DeleteSecret(ctx context.Context, namespace, name string) error { + return c.clientset.CoreV1().Secrets(namespace).Delete(ctx, name, metav1.DeleteOptions{}) } diff --git a/pkg/kubernetes/database_cluster.go b/pkg/kubernetes/database_cluster.go index 1aebc859..edeac38a 100644 --- a/pkg/kubernetes/database_cluster.go +++ b/pkg/kubernetes/database_cluster.go @@ -24,11 +24,11 @@ import ( ) // ListDatabaseClusters returns list of managed database clusters. -func (k *Kubernetes) ListDatabaseClusters(ctx context.Context) (*everestv1alpha1.DatabaseClusterList, error) { - return k.client.ListDatabaseClusters(ctx, metav1.ListOptions{}) +func (k *Kubernetes) ListDatabaseClusters(ctx context.Context, namespace string) (*everestv1alpha1.DatabaseClusterList, error) { + return k.client.ListDatabaseClusters(ctx, namespace, metav1.ListOptions{}) } // GetDatabaseCluster returns database clusters by provided name. -func (k *Kubernetes) GetDatabaseCluster(ctx context.Context, name string) (*everestv1alpha1.DatabaseCluster, error) { - return k.client.GetDatabaseCluster(ctx, name) +func (k *Kubernetes) GetDatabaseCluster(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseCluster, error) { + return k.client.GetDatabaseCluster(ctx, namespace, name) } diff --git a/pkg/kubernetes/database_cluster_backup.go b/pkg/kubernetes/database_cluster_backup.go index 7c3c2338..b8e0432f 100644 --- a/pkg/kubernetes/database_cluster_backup.go +++ b/pkg/kubernetes/database_cluster_backup.go @@ -23,11 +23,11 @@ import ( ) // GetDatabaseClusterBackup returns database cluster backup by name. -func (k *Kubernetes) GetDatabaseClusterBackup(ctx context.Context, name string) (*everestv1alpha1.DatabaseClusterBackup, error) { - return k.client.GetDatabaseClusterBackup(ctx, name) +func (k *Kubernetes) GetDatabaseClusterBackup(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseClusterBackup, error) { + return k.client.GetDatabaseClusterBackup(ctx, namespace, name) } // ListDatabaseClusterBackups returns database cluster backups. -func (k *Kubernetes) ListDatabaseClusterBackups(ctx context.Context, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterBackupList, error) { - return k.client.ListDatabaseClusterBackups(ctx, options) +func (k *Kubernetes) ListDatabaseClusterBackups(ctx context.Context, namespace string, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterBackupList, error) { + return k.client.ListDatabaseClusterBackups(ctx, namespace, options) } diff --git a/pkg/kubernetes/database_cluster_restore.go b/pkg/kubernetes/database_cluster_restore.go index cced895e..f46d7e96 100644 --- a/pkg/kubernetes/database_cluster_restore.go +++ b/pkg/kubernetes/database_cluster_restore.go @@ -23,11 +23,11 @@ import ( ) // GetDatabaseClusterRestore returns database cluster restore by name. -func (k *Kubernetes) GetDatabaseClusterRestore(ctx context.Context, name string) (*everestv1alpha1.DatabaseClusterRestore, error) { - return k.client.GetDatabaseClusterRestore(ctx, name) +func (k *Kubernetes) GetDatabaseClusterRestore(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseClusterRestore, error) { + return k.client.GetDatabaseClusterRestore(ctx, namespace, name) } // ListDatabaseClusterRestores returns database cluster restores. -func (k *Kubernetes) ListDatabaseClusterRestores(ctx context.Context, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterRestoreList, error) { - return k.client.ListDatabaseClusterRestores(ctx, options) +func (k *Kubernetes) ListDatabaseClusterRestores(ctx context.Context, namespace string, options metav1.ListOptions) (*everestv1alpha1.DatabaseClusterRestoreList, error) { + return k.client.ListDatabaseClusterRestores(ctx, namespace, options) } diff --git a/pkg/kubernetes/database_engine.go b/pkg/kubernetes/database_engine.go index b14ee9be..862742ae 100644 --- a/pkg/kubernetes/database_engine.go +++ b/pkg/kubernetes/database_engine.go @@ -23,11 +23,11 @@ import ( ) // ListDatabaseEngines returns list of managed database clusters. -func (k *Kubernetes) ListDatabaseEngines(ctx context.Context) (*everestv1alpha1.DatabaseEngineList, error) { - return k.client.ListDatabaseEngines(ctx) +func (k *Kubernetes) ListDatabaseEngines(ctx context.Context, namespace string) (*everestv1alpha1.DatabaseEngineList, error) { + return k.client.ListDatabaseEngines(ctx, namespace) } // GetDatabaseEngine returns database clusters by provided name. -func (k *Kubernetes) GetDatabaseEngine(ctx context.Context, name string) (*everestv1alpha1.DatabaseEngine, error) { - return k.client.GetDatabaseEngine(ctx, name) +func (k *Kubernetes) GetDatabaseEngine(ctx context.Context, namespace, name string) (*everestv1alpha1.DatabaseEngine, error) { + return k.client.GetDatabaseEngine(ctx, namespace, name) } diff --git a/pkg/kubernetes/kubernetes.go b/pkg/kubernetes/kubernetes.go index 5872f277..c2c8220e 100644 --- a/pkg/kubernetes/kubernetes.go +++ b/pkg/kubernetes/kubernetes.go @@ -18,9 +18,11 @@ package kubernetes import ( "context" + "errors" "strings" "go.uber.org/zap" + appsv1 "k8s.io/api/apps/v1" "k8s.io/client-go/rest" "github.com/percona/percona-everest-backend/pkg/kubernetes/client" @@ -40,6 +42,13 @@ const ( ClusterTypeEKS ClusterType = "eks" // ClusterTypeGeneric is a generic type. ClusterTypeGeneric ClusterType = "generic" + + // EverestOperatorDeploymentName is the name of the deployment for everest operator. + EverestOperatorDeploymentName = "everest-operator-controller-manager" + + // EverestDBNamespacesEnvVar is the name of the environment variable that + // contains the list of monitored namespaces. + EverestDBNamespacesEnvVar = "DB_NAMESPACES" ) // Kubernetes is a client for Kubernetes. @@ -104,3 +113,30 @@ func (k *Kubernetes) GetClusterType(ctx context.Context) (ClusterType, error) { } return ClusterTypeGeneric, nil } + +// GetDBNamespaces returns a list of namespaces that are monitored by the Everest operator. +func (k *Kubernetes) GetDBNamespaces(ctx context.Context, namespace string) ([]string, error) { + deployment, err := k.GetDeployment(ctx, EverestOperatorDeploymentName, namespace) + if err != nil { + return nil, err + } + + for _, container := range deployment.Spec.Template.Spec.Containers { + if container.Name != "manager" { + continue + } + for _, envVar := range container.Env { + if envVar.Name != EverestDBNamespacesEnvVar { + continue + } + return strings.Split(envVar.Value, ","), nil + } + } + + return nil, errors.New("failed to get watched namespaces") +} + +// GetDeployment returns k8s deployment by provided name and namespace. +func (k *Kubernetes) GetDeployment(ctx context.Context, name, namespace string) (*appsv1.Deployment, error) { + return k.client.GetDeployment(ctx, name, namespace) +} diff --git a/pkg/kubernetes/monitoring_config.go b/pkg/kubernetes/monitoring_config.go index ee0faa28..cbf0435f 100644 --- a/pkg/kubernetes/monitoring_config.go +++ b/pkg/kubernetes/monitoring_config.go @@ -18,12 +18,9 @@ package kubernetes import ( "context" - "errors" everestv1alpha1 "github.com/percona/everest-operator/api/v1alpha1" - "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) const ( @@ -31,13 +28,13 @@ const ( ) // ListMonitoringConfigs returns list of managed monitoring configs. -func (k *Kubernetes) ListMonitoringConfigs(ctx context.Context) (*everestv1alpha1.MonitoringConfigList, error) { - return k.client.ListMonitoringConfigs(ctx) +func (k *Kubernetes) ListMonitoringConfigs(ctx context.Context, namespace string) (*everestv1alpha1.MonitoringConfigList, error) { + return k.client.ListMonitoringConfigs(ctx, namespace) } // GetMonitoringConfig returns monitoring configs by provided name. -func (k *Kubernetes) GetMonitoringConfig(ctx context.Context, name string) (*everestv1alpha1.MonitoringConfig, error) { - return k.client.GetMonitoringConfig(ctx, name) +func (k *Kubernetes) GetMonitoringConfig(ctx context.Context, namespace, name string) (*everestv1alpha1.MonitoringConfig, error) { + return k.client.GetMonitoringConfig(ctx, namespace, name) } // CreateMonitoringConfig returns monitoring configs by provided name. @@ -51,23 +48,16 @@ func (k *Kubernetes) UpdateMonitoringConfig(ctx context.Context, storage *everes } // DeleteMonitoringConfig returns monitoring configs by provided name. -func (k *Kubernetes) DeleteMonitoringConfig(ctx context.Context, name string) error { - return k.client.DeleteMonitoringConfig(ctx, name) +func (k *Kubernetes) DeleteMonitoringConfig(ctx context.Context, namespace, name string) error { + return k.client.DeleteMonitoringConfig(ctx, namespace, name) } // IsMonitoringConfigUsed checks that a backup storage by provided name is used across k8s cluster. -func (k *Kubernetes) IsMonitoringConfigUsed(ctx context.Context, monitoringConfigName string) (bool, error) { - _, err := k.client.GetMonitoringConfig(ctx, monitoringConfigName) +func (k *Kubernetes) IsMonitoringConfigUsed(ctx context.Context, namespace, monitoringConfigName string) (bool, error) { + _, err := k.client.GetMonitoringConfig(ctx, namespace, monitoringConfigName) if err != nil { return false, err } - inUse, err := k.isMonitoringConfigUsedByVMAgent(ctx, monitoringConfigName) - if err != nil { - return false, err - } - if inUse { - return true, nil - } options := metav1.ListOptions{ LabelSelector: metav1.FormatLabelSelector(&metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -75,7 +65,7 @@ func (k *Kubernetes) IsMonitoringConfigUsed(ctx context.Context, monitoringConfi }, }), } - list, err := k.client.ListDatabaseClusters(ctx, options) + list, err := k.client.ListDatabaseClusters(ctx, "percona-everest", options) if err != nil { return false, err } @@ -85,76 +75,12 @@ func (k *Kubernetes) IsMonitoringConfigUsed(ctx context.Context, monitoringConfi return false, nil } -func (k *Kubernetes) isMonitoringConfigUsedByVMAgent(ctx context.Context, name string) (bool, error) { - vmAgents, err := k.ListVMAgents() - if err != nil { - if errors.Is(err, &meta.NoKindMatchError{}) { - return false, nil - } - return false, errors.Join(err, errors.New("could not list VM agents in Kubernetes")) - } - secretNames := make([]string, 0, len(vmAgents.Items)) - - for _, vm := range vmAgents.Items { - vm := vm - secretNames = append(secretNames, k.SecretNamesFromVMAgent(&vm)...) - } - - for _, secretName := range secretNames { - mcs, err := k.GetMonitoringConfigsBySecretName(ctx, secretName) - if err != nil { - return false, err - } - - for _, mc := range mcs { - if mc.Name == name { - return true, nil - } - } - } - - return false, nil -} - -// SecretNamesFromVMAgent returns a list of secret names as used by VMAgent's remoteWrite password field. -func (k *Kubernetes) SecretNamesFromVMAgent(vmAgent *unstructured.Unstructured) []string { - rws, ok, err := unstructured.NestedSlice(vmAgent.Object, "spec", "remoteWrite") - if err != nil { - // We can ignore the error because it has to be an interface. - k.l.Debug(err) - } - if !ok { - return []string{} - } - - res := make([]string, 0, len(rws)) - for _, rw := range rws { - rw, ok := rw.(map[string]interface{}) - if !ok { - continue - } - - secretName, ok, err := unstructured.NestedString(rw, "basicAuth", "password", "name") - if err != nil { - // We can ignore the error because it has to be a string. - k.l.Debug(err) - continue - } - if !ok { - continue - } - res = append(res, secretName) - } - - return res -} - // GetMonitoringConfigsBySecretName returns a list of monitoring configs which use // the provided secret name. func (k *Kubernetes) GetMonitoringConfigsBySecretName( - ctx context.Context, secretName string, + ctx context.Context, namespace, secretName string, ) ([]*everestv1alpha1.MonitoringConfig, error) { - mcs, err := k.client.ListMonitoringConfigs(ctx) + mcs, err := k.client.ListMonitoringConfigs(ctx, namespace) if err != nil { return nil, err } diff --git a/pkg/kubernetes/secret.go b/pkg/kubernetes/secret.go index 65db4f34..02e57188 100644 --- a/pkg/kubernetes/secret.go +++ b/pkg/kubernetes/secret.go @@ -7,8 +7,8 @@ import ( ) // GetSecret returns a secret by name. -func (k *Kubernetes) GetSecret(ctx context.Context, name string) (*corev1.Secret, error) { - return k.client.GetSecret(ctx, name) +func (k *Kubernetes) GetSecret(ctx context.Context, namespace, name string) (*corev1.Secret, error) { + return k.client.GetSecret(ctx, namespace, name) } // CreateSecret creates a secret. @@ -22,6 +22,6 @@ func (k *Kubernetes) UpdateSecret(ctx context.Context, secret *corev1.Secret) (* } // DeleteSecret deletes a secret. -func (k *Kubernetes) DeleteSecret(ctx context.Context, name string) error { - return k.client.DeleteSecret(ctx, name) +func (k *Kubernetes) DeleteSecret(ctx context.Context, namespace, name string) error { + return k.client.DeleteSecret(ctx, namespace, name) } diff --git a/pkg/kubernetes/vmagent.go b/pkg/kubernetes/vmagent.go deleted file mode 100644 index c1e9d9b7..00000000 --- a/pkg/kubernetes/vmagent.go +++ /dev/null @@ -1,197 +0,0 @@ -// percona-everest-backend -// Copyright (C) 2023 Percona LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package kubernetes - -import ( - "context" - "encoding/json" - "errors" - "fmt" - - corev1 "k8s.io/api/core/v1" - k8serrors "k8s.io/apimachinery/pkg/api/errors" - 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" -) - -const ( - // VMAgentResourceName is the name of the VMAgent resource in k8s. - VMAgentResourceName = "everest-cluster-monitoring" - vmAgentUsernameSecretName = "everest-cluster-vmagent-username" -) - -// DeployVMAgent deploys a default VMAgent used by Everest. -func (k *Kubernetes) DeployVMAgent(ctx context.Context, secretName, monitoringURL string) error { - k.l.Debug("Creating VMAgent username secret") - _, err := k.CreateSecret(ctx, &corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: vmAgentUsernameSecretName, - Namespace: k.namespace, - }, - StringData: map[string]string{ - "username": "api_key", - }, - }) - - if err != nil && !k8serrors.IsAlreadyExists(err) { - return errors.Join(err, errors.New("could not create VMAgent username secret")) - } - - k.l.Debug("Applying VMAgent spec") - vmagent, err := vmAgentSpec(k.namespace, secretName, monitoringURL) - if err != nil { - return errors.Join(err, errors.New("cannot generate VMAgent spec")) - } - - err = k.client.ApplyObject(vmagent) - if err != nil && !k8serrors.IsAlreadyExists(err) { - return errors.Join(err, errors.New("cannot apply VMAgent spec")) - } - k.l.Debug("VMAgent spec has been applied") - - return nil -} - -// DeleteVMAgent deletes the default VMAgent as installed by Everest. -func (k *Kubernetes) DeleteVMAgent() error { - vmagent, err := vmAgentSpec(k.namespace, "", "") - if err != nil { - return errors.Join(err, errors.New("cannot generate VMAgent spec")) - } - - err = k.client.DeleteObject(vmagent) - if err != nil { - return errors.Join(err, errors.New("cannot delete VMAgent")) - } - - return nil -} - -// ListVMAgents returns list of VMAgents. -func (k *Kubernetes) ListVMAgents() (*unstructured.UnstructuredList, error) { - vmAgents := &unstructured.UnstructuredList{} - err := k.client.ListObjects(schema.FromAPIVersionAndKind("operator.victoriametrics.com/v1beta1", "VMAgent"), vmAgents) - return vmAgents, err -} - -// GetVMAgent returns VMAgent by name. -func (k *Kubernetes) GetVMAgent(name string) (*unstructured.Unstructured, error) { - vmAgent := &unstructured.Unstructured{} - err := k.client.GetObject( - schema.FromAPIVersionAndKind("operator.victoriametrics.com/v1beta1", "VMAgent"), name, vmAgent, - ) - return vmAgent, err -} - -const specVMAgent = ` -{ - "kind": "VMAgent", - "apiVersion": "operator.victoriametrics.com/v1beta1", - "metadata": { - "name": %[4]s, - "namespace": %[3]s, - "creationTimestamp": null, - "labels": { - "app.kubernetes.io/managed-by": "everest", - "everest.percona.com/type": "monitoring" - } - }, - "spec": { - "image": {}, - "replicaCount": 1, - "resources": { - "limits": { - "cpu": "500m", - "memory": "850Mi" - }, - "requests": { - "cpu": "250m", - "memory": "350Mi" - } - }, - "remoteWrite": [ - { - "url": %[2]s, - "basicAuth": { - "username": { - "name": %[5]s, - "key": "username" - }, - "password": { - "name": %[1]s, - "key": "apiKey" - } - }, - "tlsConfig": { - "ca": {}, - "cert": {}, - "insecureSkipVerify": true - } - } - ], - "selectAllByDefault": true, - "serviceScrapeSelector": {}, - "serviceScrapeNamespaceSelector": {}, - "podScrapeSelector": {}, - "podScrapeNamespaceSelector": {}, - "probeSelector": {}, - "probeNamespaceSelector": {}, - "staticScrapeSelector": {}, - "staticScrapeNamespaceSelector": {}, - "arbitraryFSAccessThroughSMs": {}, - "extraArgs": { - "memory.allowedPercent": "40" - } - } -}` - -func vmAgentSpec(namespace, secretName, address string) (runtime.Object, error) { //nolint:ireturn - jName, err := json.Marshal(VMAgentResourceName) - if err != nil { - return nil, err - } - - jSecret, err := json.Marshal(secretName) - if err != nil { - return nil, err - } - - jAddress, err := json.Marshal(address + "/victoriametrics/api/v1/write") - if err != nil { - return nil, err - } - - jNamespace, err := json.Marshal(namespace) - if err != nil { - return nil, err - } - - jUser, err := json.Marshal(vmAgentUsernameSecretName) - if err != nil { - return nil, err - } - - manifest := fmt.Sprintf(specVMAgent, jSecret, jAddress, jNamespace, jName, jUser) - - o, _, err := unstructured.UnstructuredJSONScheme.Decode([]byte(manifest), nil, nil) - if err != nil { - return nil, err - } - - return o, nil -}