instancehelpers

package
v2.50.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultInstanceRetryInterval = 5 * time.Second

Variables

This section is empty.

Functions

func WaitForVolume

func WaitForVolume(ctx context.Context, api *instance.API, zone scw.Zone, id string, timeout time.Duration) (*instance.Volume, error)

Types

type BlockAndInstanceAPI

type BlockAndInstanceAPI struct {
	*instance.API
	BlockAPI *block.API
}

func InstanceAndBlockAPIWithZone

func InstanceAndBlockAPIWithZone(d *schema.ResourceData, m interface{}) (*BlockAndInstanceAPI, scw.Zone, error)

InstanceAndBlockAPIWithZone returns a new instance API and the zone for a Create request

func InstanceAndBlockAPIWithZoneAndID

func InstanceAndBlockAPIWithZoneAndID(m interface{}, zonedID string) (*BlockAndInstanceAPI, scw.Zone, string, error)

InstanceAndBlockAPIWithZoneAndID returns an instance API with zone and ID extracted from the state

func NewBlockAndInstanceAPI

func NewBlockAndInstanceAPI(client *scw.Client) *BlockAndInstanceAPI

func (*BlockAndInstanceAPI) DeleteUnknownVolume

func (api *BlockAndInstanceAPI) DeleteUnknownVolume(req *DeleteUnknownVolumeRequest, opts ...scw.RequestOption) error

func (*BlockAndInstanceAPI) GetUnknownSnapshot

func (api *BlockAndInstanceAPI) GetUnknownSnapshot(req *GetUnknownSnapshotRequest, opts ...scw.RequestOption) (*UnknownSnapshot, error)

func (*BlockAndInstanceAPI) GetUnknownVolume

func (api *BlockAndInstanceAPI) GetUnknownVolume(req *GetUnknownVolumeRequest, opts ...scw.RequestOption) (*UnknownVolume, error)

func (*BlockAndInstanceAPI) ResizeUnknownVolume

func (api *BlockAndInstanceAPI) ResizeUnknownVolume(req *ResizeUnknownVolumeRequest, opts ...scw.RequestOption) error

type DeleteUnknownVolumeRequest

type DeleteUnknownVolumeRequest struct {
	VolumeID string
	Zone     scw.Zone
}

type GetUnknownSnapshotRequest

type GetUnknownSnapshotRequest struct {
	Zone       scw.Zone
	SnapshotID string
}

type GetUnknownVolumeRequest

type GetUnknownVolumeRequest struct {
	VolumeID string
	Zone     scw.Zone
}

type ResizeUnknownVolumeRequest

type ResizeUnknownVolumeRequest struct {
	VolumeID string
	Zone     scw.Zone
	Size     *scw.Size
}

type UnknownSnapshot

type UnknownSnapshot struct {
	Zone       scw.Zone
	ID         string
	Name       string
	VolumeType instance.VolumeVolumeType
}

type UnknownVolume

type UnknownVolume struct {
	Zone     scw.Zone
	ID       string
	Name     string
	Size     *scw.Size
	ServerID *string
	Boot     *bool

	// Iops is set for Block volume only, use IsBlockVolume
	// Can be nil if not available in the Block API.
	Iops *uint32

	InstanceVolumeType instance.VolumeVolumeType
}

func (*UnknownVolume) IsAttached

func (volume *UnknownVolume) IsAttached() bool

IsAttached returns true if the volume is attached to a server

func (*UnknownVolume) IsBlockVolume

func (volume *UnknownVolume) IsBlockVolume() bool

IsBlockVolume is true if volume is managed by block API

func (*UnknownVolume) IsLocal

func (volume *UnknownVolume) IsLocal() bool

IsLocal returns true if the volume is a local volume

func (*UnknownVolume) VolumeTemplate

func (volume *UnknownVolume) VolumeTemplate() *instance.VolumeServerTemplate

VolumeTemplate returns a template to be used for servers requests.

Jump to

Keyboard shortcuts

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