client

package
v1.36.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

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

	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 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
	WaitVolumeTargetStatus(ctx context.Context, volumeID string, tStatus []string) 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) error
}

func NewIaaSClient

func NewIaaSClient(region, projectID string, options []sdkconfig.ConfigurationOption) (IaaSClient, error)

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 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