vcontainer

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VolumeAvailableStatus = "AVAILABLE"
	VolumeInUseStatus     = "IN-USE"
)

Variables

This section is empty.

Functions

func InitProvider

func InitProvider(cfgFiles []string, httpEndpoint string)

Types

type BlockStorageOpts

type BlockStorageOpts struct {
	NodeVolumeAttachLimit    int64 `gcfg:"node-volume-attach-limit"`
	RescanOnResize           bool  `gcfg:"rescan-on-resize"`
	IgnoreVolumeAZ           bool  `gcfg:"ignore-volume-az"` // ignore volume AZ (available zones) when attaching to node
	IgnoreVolumeMicroversion bool  `gcfg:"ignore-volume-microversion"`
}

type Config

type Config struct {
	Global       client.AuthOpts
	Metadata     metadata.Opts
	BlockStorage BlockStorageOpts
}

type ExtraInfo

type ExtraInfo struct {
	ProjectID string
	UserID    int64
}

type IVContainer

type IVContainer interface {
	GetMetadataOpts() metadata.Opts
	SetupPortalInfo(metadata metadata.IMetadata) error
	ListVolumes(limit int, startingToken string) ([]*bstgObj.Volume, string, error)
	GetVolumesByName(n string) ([]*bstgObj.Volume, error)
	GetVolume(volumeID string) (*bstgObj.Volume, error)
	CreateVolume(name string, size uint64, vtype, availability string, snapshotID string, sourcevolID string, tags *map[string]string) (*bstgObj.Volume, error)
	DeleteVolume(volID string) error
	GetInstanceByID(instanceID string) (*comObj.Server, error)
	AttachVolume(instanceID, volumeID string) (string, error)
	GetAttachmentDiskPath(instanceID, volumeID string) (string, error)
	WaitDiskAttached(instanceID string, volumeID string) error
	DetachVolume(instanceID, volumeID string) error
	WaitDiskDetached(instanceID string, volumeID string) error
	ExpandVolume(volumeTypeID, volumeID string, newSize uint64) error
	WaitVolumeTargetStatus(volumeID string, tStatus []string) error
	GetMaxVolLimit() int64
	GetBlockStorageOpts() BlockStorageOpts
	ListSnapshots(page string, size int, volumeID, status, name string) ([]*snapV1Obj.Snapshot, string, error)
	GetSnapshotByID(snapshotID string) (*snapV1Obj.Snapshot, error)
	CreateSnapshot(name, volID string) (*snapV2Obj.Snapshot, error)
	WaitSnapshotReady(snapshotID string) error
	DeleteSnapshot(volumeID, snapshotID string) error
	GetMappingVolume(volumeID string) (string, error)
}

func GetProvider

func GetProvider() (IVContainer, error)

func NewVContainer

func NewVContainer(compute, blockstorage, portal *vclient.ServiceClient, bsOpts BlockStorageOpts, metadataOpts metadata.Opts) IVContainer

Jump to

Keyboard shortcuts

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