clients

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UserAgent is the user agent addition that identifies the Crossplane IONOS Cloud Clients
	UserAgent = "crossplane-provider-ionoscloud"
)

Variables

This section is empty.

Functions

func GetCoreResourceState

func GetCoreResourceState(object CoreResource) string

GetCoreResourceState fetches the state of the metadata of the CoreResource If either the metadata is nil, or the state is nil, the empty string is returned

func GetDBaaSResourceState

func GetDBaaSResourceState(object DBaaSResource) sdkdbaas.State

GetDBaaSResourceState fetches the state of the metadata of the CoreResource If either the metadata is nil, or the state is nil, the empty string is returned

func UpdateCondition

func UpdateCondition(cr ResourceWithState, state string)

UpdateCondition will update the condition of the given ResourceWithState to the given state. This function implements the common mapping of ionos cloud states to crossplane conditions

Types

type CoreResource

type CoreResource interface {
	GetMetadataOk() (*sdkgo.DatacenterElementMetadata, bool)
}

CoreResource is an ionos cloud API object with metadata

type DBaaSResource

type DBaaSResource interface {
	GetMetadataOk() (*sdkdbaas.Metadata, bool)
}

DBaaSResource is an dbaas cloud API object with metadata

type IonosServices

type IonosServices struct {
	DBaaSPostgresClient *sdkdbaas.APIClient
	ComputeClient       *sdkgo.APIClient
}

IonosServices contains ionos clients

func ConnectForCRD

func ConnectForCRD(ctx context.Context, mg resource.Managed, client kubeclient.Client, t resource.Tracker) (*IonosServices, error)

ConnectForCRD resolves the referenced ProviderConfig and extracts the connection secret from that ProviderConfig. After that an ionos client is setup with those credentials.

func NewIonosClients

func NewIonosClients(data []byte) (*IonosServices, error)

NewIonosClients creates a IonosService from the given data. The data must be a json struct with the fields `User`, `Password`, `Token`. Both fields must be a string value. The password string must be base64 encoded.

type ResourceWithState

type ResourceWithState interface {
	SetConditions(c ...xpv1.Condition)
}

ResourceWithState is a resource which allow to update the conditions

Jump to

Keyboard shortcuts

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