driver

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MPL-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DiskForExportName = "disk-for-export"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Project                         string
	BaseEndpoint                    string
	ServiceAccountAuthorizedKeyPath string
	Token                           string
	CleanupTimeout                  time.Duration
}

type CreateDiskParams

type CreateDiskParams struct {
	DiskName      string
	DiskType      string
	Size          *bytesize.ByteSize
	Iops          int64
	ImageRef      *computeref.ImageRef
	DiskBackupRef *computeref.DiskBackupRef
	Zone          string
}

type CreateExternalAddressParams

type CreateExternalAddressParams struct {
	ExternalAddressName string
}

type CreateFirewallRuleParams

type CreateFirewallRuleParams struct {
	NetworkName                   string
	FirewallRuleName              string
	VirtualMachineInternalAddress *ipaddress.IPAddress
}

type CreateImageParams

type CreateImageParams struct {
	ImageName        string
	ImageDisplayName string
	ImageDescription string
	DiskRef          *computeref.DiskRef
}

type CreateNetworkParams

type CreateNetworkParams struct {
	NetworkName string
}

type CreateSubnetParams

type CreateSubnetParams struct {
	NetworkName string
	SubnetName  string
	SubnetCidr  cidraddress.CIDR4Address
}

type CreateVirtualMachineParams

type CreateVirtualMachineParams struct {
	VirtualMachineName string
	VMType             string
	Zone               string
	SSHUsername        string
	SSHPublicKey       string
	CloudConfig        string
	ServiceAccountRef  *iamref.ServiceAccountRef
	BootDiskRef        *computeref.DiskRef
	ExportDiskRef      *computeref.DiskRef
	ExternalAddressRef *vpcref.ExternalAddressRef
	SubnetRef          *vpcref.SubnetRef
}

type Driver

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

func NewDriver

func NewDriver(ctx context.Context, c Config) (*Driver, error)

func (*Driver) CreateDisk

func (d *Driver) CreateDisk(ctx context.Context, params CreateDiskParams) error

func (*Driver) CreateExternalAddress

func (d *Driver) CreateExternalAddress(ctx context.Context, params CreateExternalAddressParams) (*ipaddress.IPAddress, error)

func (*Driver) CreateFirewallRule

func (d *Driver) CreateFirewallRule(ctx context.Context, params CreateFirewallRuleParams) error

func (*Driver) CreateHMACKey

func (d *Driver) CreateHMACKey(ctx context.Context, serviceAccount, name string) (string, string, error)

func (*Driver) CreateImage

func (*Driver) CreateNetwork

func (d *Driver) CreateNetwork(ctx context.Context, params CreateNetworkParams) error

func (*Driver) CreateSubnet

func (d *Driver) CreateSubnet(ctx context.Context, params CreateSubnetParams) error

func (*Driver) CreateVirtualMachine

func (d *Driver) CreateVirtualMachine(ctx context.Context, params CreateVirtualMachineParams) (*ipaddress.IPAddress, error)

func (*Driver) DeleteDisk

func (d *Driver) DeleteDisk(ctx context.Context, diskName string) error

func (*Driver) DeleteExternalAddress

func (d *Driver) DeleteExternalAddress(ctx context.Context, externalAddressName string) error

func (*Driver) DeleteFirewallRule

func (d *Driver) DeleteFirewallRule(ctx context.Context, networkName, firewallRuleName string) error

func (*Driver) DeleteHMACKey

func (d *Driver) DeleteHMACKey(ctx context.Context, serviceAccount string, name string) error

func (*Driver) DeleteImage

func (d *Driver) DeleteImage(ctx context.Context, imageName string) error

func (*Driver) DeleteNetwork

func (d *Driver) DeleteNetwork(ctx context.Context, networkName string) error

func (*Driver) DeleteSubnet

func (d *Driver) DeleteSubnet(ctx context.Context, networkName, subnetName string) error

func (*Driver) DeleteVirtualMachine

func (d *Driver) DeleteVirtualMachine(ctx context.Context, virtualMachineName string) error

func (*Driver) GetDiskBackupMinDiskSize added in v0.7.0

func (d *Driver) GetDiskBackupMinDiskSize(ctx context.Context, diskBackupRef *computeref.DiskBackupRef) (*bytesize.ByteSize, error)

func (*Driver) GetImageMinDiskSize added in v0.7.0

func (d *Driver) GetImageMinDiskSize(ctx context.Context, imageRef *computeref.ImageRef) (*bytesize.ByteSize, error)

func (*Driver) GetSerialPortOutput added in v0.7.0

func (d *Driver) GetSerialPortOutput(ctx context.Context, virtualMachineName string, serialPort int) ([]byte, error)

func (*Driver) ImportImage added in v0.5.0

type ImportImageParams added in v0.5.0

type ImportImageParams struct {
	ImageName        string
	ImageDisplayName string
	ImageDescription string
	ExternalURL      string
}

Jump to

Keyboard shortcuts

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