client

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package client contains an implementation of the Client interface defined in internal/ionoscloud.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithDepth

func WithDepth(client ionoscloud.Client, depth int32) ionoscloud.Client

WithDepth creates a temporary copy of the client, where a custom depth can be set.

Types

type IonosCloudClient

type IonosCloudClient struct {
	API *sdk.APIClient
	// contains filtered or unexported fields
}

IonosCloudClient is a concrete implementation of the Client interface defined in the internal client package that communicates with Cloud API using its SDK.

func NewClient

func NewClient(token, apiURL string, caBundle []byte) (*IonosCloudClient, error)

NewClient instantiates a usable IonosCloudClient. The client needs a token to work. Basic auth is not supported. Passing a CA bundle is optional.

func (*IonosCloudClient) CheckRequestStatus

func (c *IonosCloudClient) CheckRequestStatus(ctx context.Context, requestURL string) (*sdk.RequestStatus, error)

CheckRequestStatus returns the status of a request and an error if checking for it fails.

func (*IonosCloudClient) CreateLAN

func (c *IonosCloudClient) CreateLAN(ctx context.Context, datacenterID string, properties sdk.LanProperties,
) (string, error)

CreateLAN creates a new LAN with the provided properties in the specified data center, returning the request location.

func (*IonosCloudClient) CreateServer

func (c *IonosCloudClient) CreateServer(
	ctx context.Context,
	datacenterID string,
	properties sdk.ServerProperties,
	entities sdk.ServerEntities,
) (*sdk.Server, string, error)

CreateServer creates a new server with provided properties in the specified data center.

func (*IonosCloudClient) DeleteIPBlock

func (c *IonosCloudClient) DeleteIPBlock(ctx context.Context, ipBlockID string) (requestPath string, err error)

DeleteIPBlock deletes the IP block that matches the provided ipBlockID.

func (*IonosCloudClient) DeleteLAN

func (c *IonosCloudClient) DeleteLAN(ctx context.Context, datacenterID, lanID string) (string, error)

DeleteLAN deletes the LAN that matches the provided lanID in the specified data center, returning the request location.

func (*IonosCloudClient) DeleteServer

func (c *IonosCloudClient) DeleteServer(ctx context.Context, datacenterID, serverID string, deleteVolumes bool) (string, error)

DeleteServer deletes the server that matches the provided serverID in the specified data center.

func (*IonosCloudClient) DeleteVolume

func (c *IonosCloudClient) DeleteVolume(ctx context.Context, datacenterID, volumeID string) (string, error)

DeleteVolume deletes the volume that matches the provided volumeID in the specified data center.

func (*IonosCloudClient) GetDatacenterLocationByID added in v0.3.0

func (c *IonosCloudClient) GetDatacenterLocationByID(ctx context.Context, datacenterID string) (string, error)

GetDatacenterLocationByID returns the location of the data center identified by datacenterID.

func (*IonosCloudClient) GetIPBlock

func (c *IonosCloudClient) GetIPBlock(ctx context.Context, ipBlockID string) (*sdk.IpBlock, error)

GetIPBlock returns the IP block that matches the provided ipBlockID.

func (*IonosCloudClient) GetImage added in v0.3.0

func (c *IonosCloudClient) GetImage(ctx context.Context, imageID string) (*sdk.Image, error)

GetImage returns the image identified by imageID.

func (*IonosCloudClient) GetRequests

func (c *IonosCloudClient) GetRequests(ctx context.Context, method, path string) ([]sdk.Request, error)

GetRequests returns the requests made in the last 24 hours that match the provided method and path.

func (*IonosCloudClient) GetServer

func (c *IonosCloudClient) GetServer(ctx context.Context, datacenterID, serverID string) (*sdk.Server, error)

GetServer returns the server that matches the provided serverID in the specified data center.

func (*IonosCloudClient) ListIPBlocks

func (c *IonosCloudClient) ListIPBlocks(ctx context.Context) (*sdk.IpBlocks, error)

ListIPBlocks returns a list of IP blocks.

func (*IonosCloudClient) ListLANs

func (c *IonosCloudClient) ListLANs(ctx context.Context, datacenterID string) (*sdk.Lans, error)

ListLANs returns a list of LANs in the specified data center.

func (*IonosCloudClient) ListLabels added in v0.3.0

func (c *IonosCloudClient) ListLabels(ctx context.Context) ([]sdk.Label, error)

ListLabels returns a list of all available resource labels.

func (*IonosCloudClient) ListServers

func (c *IonosCloudClient) ListServers(ctx context.Context, datacenterID string) (*sdk.Servers, error)

ListServers returns a list with servers in the specified data center.

func (*IonosCloudClient) PatchLAN

func (c *IonosCloudClient) PatchLAN(
	ctx context.Context, datacenterID, lanID string, properties sdk.LanProperties,
) (string, error)

PatchLAN patches the LAN that matches lanID in the specified data center with the provided properties, returning the request location.

func (*IonosCloudClient) PatchNIC

func (c *IonosCloudClient) PatchNIC(
	ctx context.Context, datacenterID, serverID, nicID string, properties sdk.NicProperties,
) (string, error)

PatchNIC updates the NIC identified by nicID with the provided properties.

func (*IonosCloudClient) ReserveIPBlock

func (c *IonosCloudClient) ReserveIPBlock(
	ctx context.Context, name, location string, size int32,
) (requestPath string, err error)

ReserveIPBlock reserves an IP block with the provided properties in the specified location, returning the request path.

func (*IonosCloudClient) StartServer

func (c *IonosCloudClient) StartServer(ctx context.Context, datacenterID, serverID string) (string, error)

StartServer starts the server that matches the provided serverID in the specified data center. Returning the location and an error if starting the server fails.

func (*IonosCloudClient) WaitForRequest

func (c *IonosCloudClient) WaitForRequest(ctx context.Context, requestURL string) error

WaitForRequest waits for the completion of the provided request.

Jump to

Keyboard shortcuts

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