driver

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MPL-2.0 Imports: 22 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
	SnapshotRef *computeref.SnapshotRef
	Zone        string
}

type CreateExternalAddressParams

type CreateExternalAddressParams struct {
	ExternalAddressName string
}

type CreateFirewallRuleParams

type CreateFirewallRuleParams struct {
	NetworkName                   string
	FirewallRuleName              string
	VirtualMachineInternalAddress string
}

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
	DiskRef            *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) AttachDiskToVirtualMachine

func (d *Driver) AttachDiskToVirtualMachine(ctx context.Context, vmName string, diskRef computeref.DiskRef) 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) (string, 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) (string, 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) DetachSecondaryDisksFromVirtualMachine

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

func (*Driver) GetImage

Jump to

Keyboard shortcuts

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