postgrescluster

package
v1.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCreateClusterInput

func GenerateCreateClusterInput(cr *v1alpha1.PostgresCluster) (*ionoscloud.CreateClusterRequest, error)

GenerateCreateClusterInput returns CreateClusterRequest based on the CR spec

func GenerateCreateUserInput added in v1.0.8

func GenerateCreateUserInput(cr *v1alpha1.PostgresUser) *ionoscloud.User

GenerateCreateUserInput returns psql User based on the CR spec

func GenerateUpdateClusterInput

func GenerateUpdateClusterInput(cr *v1alpha1.PostgresCluster) (*ionoscloud.PatchClusterRequest, error)

GenerateUpdateClusterInput returns PatchClusterRequest based on the CR spec modifications

func GenerateUpdateUserInput added in v1.0.8

func GenerateUpdateUserInput(cr *v1alpha1.PostgresUser) *ionoscloud.UsersPatchRequest

GenerateUpdateUserInput returns PatchClusterRequest based on the CR spec modifications

func IsClusterUpToDate

func IsClusterUpToDate(cr *v1alpha1.PostgresCluster, clusterResponse ionoscloud.ClusterResponse) bool

IsClusterUpToDate returns true if the cluster is up-to-date or false if it does not

func IsUserUpToDate added in v1.0.8

func IsUserUpToDate(cr *v1alpha1.PostgresUser, user ionoscloud.UserResource) bool

IsUserUpToDate returns true if the user is up-to-date or false if it does not

func LateInitializer

func LateInitializer(in *v1alpha1.ClusterParameters, sg *ionoscloud.ClusterResponse)

LateInitializer fills the empty fields in *v1alpha1.ClusterParameters with the values seen in ionoscloud.ClusterResponse.

Types

type ClusterAPIClient

type ClusterAPIClient struct {
	*clients.IonosServices
}

ClusterAPIClient is a wrapper around IONOS Service DBaaS Postgres Cluster

func (*ClusterAPIClient) CheckDuplicateCluster

func (cp *ClusterAPIClient) CheckDuplicateCluster(ctx context.Context, clusterName string, cr *v1alpha1.PostgresCluster) (*ionoscloud.ClusterResponse, error)

CheckDuplicateCluster based on clusterName and on multiple properties from CR spec

func (*ClusterAPIClient) CheckDuplicateUser added in v1.0.8

func (cp *ClusterAPIClient) CheckDuplicateUser(ctx context.Context, clusterID, userName string) (*ionoscloud.UserResource, error)

CheckDuplicateUser based on clusterName and on multiple properties from CR spec

func (*ClusterAPIClient) CreateCluster

CreateCluster based on cluster properties

func (*ClusterAPIClient) CreateUser added in v1.0.8

CreateUser based on clusterID and user properties

func (*ClusterAPIClient) DeleteCluster

func (cp *ClusterAPIClient) DeleteCluster(ctx context.Context, clusterID string) (*ionoscloud.APIResponse, error)

DeleteCluster based on clusterID

func (*ClusterAPIClient) DeleteUser added in v1.0.8

func (cp *ClusterAPIClient) DeleteUser(ctx context.Context, clusterID, userName string) (*ionoscloud.APIResponse, error)

DeleteUser based on clusterID

func (*ClusterAPIClient) GetCluster

GetCluster based on clusterID

func (*ClusterAPIClient) GetClusterID

func (cp *ClusterAPIClient) GetClusterID(cluster *ionoscloud.ClusterResponse) (string, error)

GetClusterID based on cluster

func (*ClusterAPIClient) GetUser added in v1.0.8

func (cp *ClusterAPIClient) GetUser(ctx context.Context, clusterID, userName string) (ionoscloud.UserResource, *ionoscloud.APIResponse, error)

GetUser based on clusterID and username

func (*ClusterAPIClient) GetUserID added in v1.0.8

func (cp *ClusterAPIClient) GetUserID(user *ionoscloud.UserResource) (string, error)

GetUserID based on cluster

func (*ClusterAPIClient) PatchUser added in v1.0.8

func (cp *ClusterAPIClient) PatchUser(ctx context.Context, clusterID, username string, patchReq ionoscloud.UsersPatchRequest) (ionoscloud.UserResource, *ionoscloud.APIResponse, error)

PatchUser based on clusterID, username and user properties

func (*ClusterAPIClient) UpdateCluster

UpdateCluster based on clusterID and cluster properties

func (*ClusterAPIClient) UpdateUser added in v1.0.8

func (cp *ClusterAPIClient) UpdateUser(ctx context.Context, clusterID, userName string, patchReq ionoscloud.UsersPatchRequest) (ionoscloud.UserResource, *ionoscloud.APIResponse, error)

UpdateUser based on clusterID and cluster properties

type ClusterClient

type ClusterClient interface {
	CheckDuplicateCluster(ctx context.Context, clusterName string, cr *v1alpha1.PostgresCluster) (*ionoscloud.ClusterResponse, error)
	CheckDuplicateUser(ctx context.Context, clusterID, userName string) (*ionoscloud.UserResource, error)
	GetClusterID(cluster *ionoscloud.ClusterResponse) (string, error)
	GetUserID(user *ionoscloud.UserResource) (string, error)
	GetCluster(ctx context.Context, clusterID string) (ionoscloud.ClusterResponse, *ionoscloud.APIResponse, error)
	GetUser(ctx context.Context, clusterID, userName string) (ionoscloud.UserResource, *ionoscloud.APIResponse, error)
	DeleteCluster(ctx context.Context, clusterID string) (*ionoscloud.APIResponse, error)
	DeleteUser(ctx context.Context, clusterID, userName string) (*ionoscloud.APIResponse, error)
	CreateCluster(ctx context.Context, cluster ionoscloud.CreateClusterRequest) (ionoscloud.ClusterResponse, *ionoscloud.APIResponse, error)
	CreateUser(ctx context.Context, clusterID string, user ionoscloud.User) (ionoscloud.UserResource, *ionoscloud.APIResponse, error)
	UpdateCluster(ctx context.Context, clusterID string, cluster ionoscloud.PatchClusterRequest) (ionoscloud.ClusterResponse, *ionoscloud.APIResponse, error)
	UpdateUser(ctx context.Context, clusterID, userName string, cluster ionoscloud.UsersPatchRequest) (ionoscloud.UserResource, *ionoscloud.APIResponse, error)
}

ClusterClient is a wrapper around IONOS Service DBaaS Postgres Cluster methods

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL