postgrescluster

package
v0.3.12-test Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: Apache-2.0 Imports: 10 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) CreateDatabase added in v1.1.0

CreateDatabase based on clusterID and database 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) (*shared.APIResponse, error)

DeleteCluster based on clusterID

func (*ClusterAPIClient) DeleteDatabase added in v1.1.0

func (cp *ClusterAPIClient) DeleteDatabase(ctx context.Context, clusterID, databaseID string) (*shared.APIResponse, error)

DeleteDatabase based on clusterID and databaseID

func (*ClusterAPIClient) DeleteUser added in v1.0.8

func (cp *ClusterAPIClient) DeleteUser(ctx context.Context, clusterID, userName string) (*shared.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) GetDatabase added in v1.1.0

func (cp *ClusterAPIClient) GetDatabase(ctx context.Context, clusterID, databaseName string) (ionoscloud.DatabaseResource, *shared.APIResponse, error)

GetDatabase based on clusterID and databaseID

func (*ClusterAPIClient) GetUser added in v1.0.8

func (cp *ClusterAPIClient) GetUser(ctx context.Context, clusterID, userName string) (ionoscloud.UserResource, *shared.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, *shared.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, *shared.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, *shared.APIResponse, error)
	GetUser(ctx context.Context, clusterID, userName string) (ionoscloud.UserResource, *shared.APIResponse, error)
	DeleteCluster(ctx context.Context, clusterID string) (*shared.APIResponse, error)
	DeleteUser(ctx context.Context, clusterID, userName string) (*shared.APIResponse, error)
	CreateCluster(ctx context.Context, cluster ionoscloud.CreateClusterRequest) (ionoscloud.ClusterResponse, *shared.APIResponse, error)
	CreateUser(ctx context.Context, clusterID string, user ionoscloud.User) (ionoscloud.UserResource, *shared.APIResponse, error)
	UpdateCluster(ctx context.Context, clusterID string, cluster ionoscloud.PatchClusterRequest) (ionoscloud.ClusterResponse, *shared.APIResponse, error)
	UpdateUser(ctx context.Context, clusterID, userName string, cluster ionoscloud.UsersPatchRequest) (ionoscloud.UserResource, *shared.APIResponse, error)
	// Database stuff
	CreateDatabase(ctx context.Context, clusterID string, database v1alpha1.PostgresDatabase) (ionoscloud.DatabaseResource, *shared.APIResponse, error)
	GetDatabase(ctx context.Context, clusterID, databaseName string) (ionoscloud.DatabaseResource, *shared.APIResponse, error)
	DeleteDatabase(ctx context.Context, clusterID, databaseID string) (*shared.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