ionoscloud

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: 2 Imported by: 0

Documentation

Overview

Package ionoscloud offers an interface for abstracting Cloud API SDK, making it testable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// CreateServer creates a new server with provided properties in the specified data center.
	CreateServer(ctx context.Context, datacenterID string, properties sdk.ServerProperties,
		entities sdk.ServerEntities) (*sdk.Server, string, error)
	// ListServers returns a list with the servers in the specified data center.
	ListServers(ctx context.Context, datacenterID string) (*sdk.Servers, error)
	// GetServer returns the server that matches the provided serverID in the specified data center.
	GetServer(ctx context.Context, datacenterID, serverID string) (*sdk.Server, error)
	// DeleteServer deletes the server that matches the provided serverID in the specified data center.
	DeleteServer(ctx context.Context, datacenterID, serverID string, deleteVolumes bool) (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.
	StartServer(ctx context.Context, datacenterID, serverID string) (string, error)
	// DeleteVolume deletes the volume that matches the provided volumeID in the specified data center.
	DeleteVolume(ctx context.Context, datacenterID, volumeID string) (string, error)
	// CreateLAN creates a new LAN with the provided properties in the specified data center,
	// returning the request path.
	CreateLAN(ctx context.Context, datacenterID 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.
	PatchLAN(ctx context.Context, datacenterID, lanID string, properties sdk.LanProperties) (string, error)
	// ListLANs returns a list of LANs in the specified data center.
	ListLANs(ctx context.Context, datacenterID string) (*sdk.Lans, error)
	// DeleteLAN deletes the LAN that matches the provided lanID in the specified data center,
	// returning the request path.
	DeleteLAN(ctx context.Context, datacenterID, lanID string) (string, error)
	// ReserveIPBlock reserves an IP block with the provided properties in the specified location.
	ReserveIPBlock(ctx context.Context, name, location string, size int32) (requestPath string, err error)
	// GetIPBlock returns the IP block that matches the provided ipBlockID.
	GetIPBlock(ctx context.Context, ipBlockID string) (*sdk.IpBlock, error)
	// ListIPBlocks returns a list of IP blocks.
	ListIPBlocks(ctx context.Context) (*sdk.IpBlocks, error)
	// DeleteIPBlock deletes the IP block that matches the provided ipBlockID.
	DeleteIPBlock(ctx context.Context, ipBlockID string) (requestPath string, err error)
	// CheckRequestStatus checks the status of a provided request identified by requestID
	CheckRequestStatus(ctx context.Context, requestID string) (*sdk.RequestStatus, error)
	// WaitForRequest waits for the completion of the provided request.
	WaitForRequest(ctx context.Context, requestURL string) error
	// GetRequests returns the requests made in the last 24 hours that match the provided method and path.
	GetRequests(ctx context.Context, method, path string) ([]sdk.Request, error)
	// PatchNIC updates the NIC identified by nicID with the provided properties, returning the request location.
	PatchNIC(ctx context.Context, datacenterID, serverID, nicID string, properties sdk.NicProperties) (string, error)
	// GetDatacenterLocationByID returns the location of the data center identified by datacenterID.
	GetDatacenterLocationByID(ctx context.Context, datacenterID string) (string, error)
	// GetImage returns the image identified by imageID.
	GetImage(ctx context.Context, imageID string) (*sdk.Image, error)
	// ListLabels returns a list of all available resource labels.
	ListLabels(ctx context.Context) ([]sdk.Label, error)
}

Client is an interface for abstracting Cloud API SDK, making it possible to create mocks for testing purposes.

Directories

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

Jump to

Keyboard shortcuts

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