Help us shape the future of Go! Take the 2026 Go Developer Survey

client

package
v1.37.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VolumeAvailableStatus = "AVAILABLE"
	VolumeAttachedStatus  = "ATTACHED"
	VolumeErrorStatus     = "ERROR"

	VolumeDescription = "Created by STACKIT CSI driver"
)
View Source
const (
	BackupDescription = "Created by STACKIT CSI driver"

	BackupMaxDurationSecondsPerGBDefault = 20
	BackupMaxDurationPerGB               = "backup-max-duration-seconds-per-gb"
)
View Source
const (
	SnapshotReadyStatus = "AVAILABLE"

	SnapshotType = "type"
)

Variables

This section is empty.

Functions

func AddExtraFlags

func AddExtraFlags(fs *pflag.FlagSet)

func BuildCreateBackupPayload

func BuildCreateBackupPayload(name, volID, snapshotID string, tags map[string]string) (iaas.CreateBackupPayload, error)

func BuildUserAgent

func BuildUserAgent(component, componentVersion string) string

func FilterBackups

func FilterBackups(backups []iaas.Backup, filters map[string]string) []iaas.Backup

func FilterSnapshots

func FilterSnapshots(snapshots []iaas.Snapshot, filters map[string]string) []iaas.Snapshot

func FilterVolumes

func FilterVolumes(volumes []iaas.Volume, filters map[string]string) []iaas.Volume

func GetConfig

func GetConfig(reader io.Reader) (stackitconfig.CSIConfig, error)

func GetConfigFromFile

func GetConfigFromFile(path string) (stackitconfig.CSIConfig, error)

func LabelsFromTags

func LabelsFromTags(tags map[string]string) map[string]any

Types

type Factory

type Factory interface {
	// LoadBalancing returns a STACKIT load balancing service client.
	LoadBalancing(options []sdkconfig.ConfigurationOption) (LoadBalancingClient, error)

	// IaaS returns a STACKIT IaaS service client.
	IaaS(options []sdkconfig.ConfigurationOption) (IaaSClient, error)
}

Factory produces clients for various STACKIT services.

func New

func New(region, projectID, organizationID, areaID, vpcID string) Factory

type IaaSClient

type IaaSClient interface {
	GetServer(ctx context.Context, serverID string) (*iaas.Server, error)
	GetServerWithDetails(ctx context.Context, serverID string) (*iaas.Server, error)
	ListServers(ctx context.Context) (*[]iaas.Server, error)

	CreateSnapshot(ctx context.Context, payload iaas.CreateSnapshotPayload) (*iaas.Snapshot, error)
	ListSnapshots(ctx context.Context, filters map[string]string) ([]iaas.Snapshot, string, error)
	DeleteSnapshot(ctx context.Context, snapshotID string) error
	GetSnapshot(ctx context.Context, snapshotID string) (*iaas.Snapshot, error)
	WaitSnapshotReady(ctx context.Context, snapshotID string) (*string, error)

	CreateBackup(ctx context.Context, name, volID, snapshotID string, tags map[string]string) (*iaas.Backup, error)
	ListBackups(ctx context.Context, filters map[string]string) ([]iaas.Backup, error)
	DeleteBackup(ctx context.Context, backupID string) error
	GetBackup(ctx context.Context, backupID string) (*iaas.Backup, error)
	WaitBackupReady(ctx context.Context, backupID string, snapshotSize int64, backupMaxDurationSecondsPerGB int) (*string, error)

	CreateVolume(ctx context.Context, payload iaas.CreateVolumePayload) (*iaas.Volume, error)
	DeleteVolume(ctx context.Context, volumeID string) error
	AttachVolume(ctx context.Context, serverID, volumeID string, payload iaas.AddVolumeToServerPayload) (string, error)
	DetachVolume(ctx context.Context, serverID, volumeID string) error
	GetVolume(ctx context.Context, volumeID string) (*iaas.Volume, error)
	GetVolumesByName(ctx context.Context, volName string) ([]iaas.Volume, error)
	ListVolumes(ctx context.Context, _ int, _ string) ([]iaas.Volume, string, error)
	ExpandVolume(ctx context.Context, volumeID, volumeStatus string, payload iaas.ResizeVolumePayload) error
	WaitVolumeResized(ctx context.Context, volumeID string, sizeGB int64) error
	WaitDiskAttached(ctx context.Context, instanceID, volumeID string) error
	WaitDiskDetached(ctx context.Context, instanceID, volumeID string) error
	WaitVolumeTargetStatusWithCustomBackoff(ctx context.Context, volumeID string, tStatus []string, backoff wait.Backoff) (*iaas.Volume, error)

	ListRoutes(ctx context.Context, routingTableID string, labels LabelMap) ([]iaas.Route, error)
	AddRoutes(ctx context.Context, routingTableID string, routes []iaas.Route) error
	DeleteRoute(ctx context.Context, routingTableID string, routeID string) error
}

func NewIaaSClient

func NewIaaSClient(region, projectID string, sdkOptions []sdkconfig.ConfigurationOption, clientOpts ...Option) (IaaSClient, error)

type LabelMap added in v1.34.14

type LabelMap map[string]string

func (LabelMap) Selector added in v1.34.14

func (l LabelMap) Selector() string

func (LabelMap) ToSDK added in v1.34.14

func (l LabelMap) ToSDK() map[string]any

type LoadBalancingClient

type LoadBalancingClient interface {
	CreateLoadBalancer(ctx context.Context, payload *loadbalancer.CreateLoadBalancerPayload) (*loadbalancer.LoadBalancer, error)
	GetLoadBalancer(ctx context.Context, id string) (*loadbalancer.LoadBalancer, error)
	UpdateLoadBalancer(ctx context.Context, lbName string, updates *loadbalancer.UpdateLoadBalancerPayload) (*loadbalancer.LoadBalancer, error)
	DeleteLoadBalancer(ctx context.Context, lbName string) error
	UpdateTargetPool(ctx context.Context, name, targetPoolName string, payload loadbalancer.UpdateTargetPoolPayload) error

	CreateCredentials(ctx context.Context, payload loadbalancer.CreateCredentialsPayload) (*loadbalancer.CreateCredentialsResponse, error)
	ListCredentials(ctx context.Context) (*loadbalancer.ListCredentialsResponse, error)
	UpdateCredentials(ctx context.Context, credentialsRef string, payload loadbalancer.UpdateCredentialsPayload) error
	DeleteCredentials(ctx context.Context, credentialsRef string) error
}

func NewLoadBalancingClient

func NewLoadBalancingClient(region, projectID string, options []sdkconfig.ConfigurationOption) (LoadBalancingClient, error)

type Option added in v1.34.14

type Option func(o *Options)

func WithArea added in v1.34.14

func WithArea(orgID, areaID string) Option

func WithVPC added in v1.34.14

func WithVPC(id string) Option

type Options added in v1.34.14

type Options struct {
	// contains filtered or unexported fields
}

type VolumeSourceTypes

type VolumeSourceTypes string
const (
	VolumeSource   VolumeSourceTypes = "volume"
	SnapshotSource VolumeSourceTypes = "snapshot"
	BackupSource   VolumeSourceTypes = "backup"
)

Directories

Path Synopsis
Package client is a generated GoMock package.
Package client is a generated GoMock package.

Jump to

Keyboard shortcuts

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