gcp

package
v0.0.0-...-1dd8b2d Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildInstanceMetadataItem

func BuildInstanceMetadataItem(key, value string) *api.MetadataItems

BuildInstanceMetadataItem create an metadata item

func CreateMachineImageObject

func CreateMachineImageObject(ctx context.Context, project string, name string) (*api.MachineImage, error)

CreateMachineImageObject creates a machine image object

func WaitForSerialOutput

func WaitForSerialOutput(successMatch string, failureMatches []string, port int64, interval, timeout time.Duration, project, zone, instanceName string, client daisyCompute.Client) error

WaitForSerialOutput waits to a string match on a serial port.

Types

type File

type File struct {
	*api.Object
	Client     storageApi.Client
	FileObject *storageApi.ObjectHandle
	// contains filtered or unexported fields
}

File is a gcs file.

func CreateFileObject

func CreateFileObject(ctx context.Context, bucketName string, objectName string) (*File, error)

CreateFileObject creates an file object to be operated by API client

func (*File) Cleanup

func (f *File) Cleanup() error

Cleanup deletes the file.

type Image

type Image struct {
	*api.Image
	Client  daisyCompute.Client
	Project string
}

Image is a compute image.

func CreateImageObject

func CreateImageObject(ctx context.Context, project string, name string) (*Image, error)

CreateImageObject creates an image object to be operated by API client

func (*Image) Cleanup

func (i *Image) Cleanup() error

Cleanup deletes the image.

type Instance

type Instance struct {
	*api.Instance
	Client        daisyCompute.Client
	Project, Zone string
	IsWindows     bool
}

Instance is a compute instance.

func CreateInstanceObject

func CreateInstanceObject(ctx context.Context, project string, zone string, name string, isWindows bool) (*Instance, error)

CreateInstanceObject creates an instance object to be operated by GA API client

func SetMetadata

func SetMetadata(ctx context.Context, project, zone, name, key, value string, isWindows bool) (*Instance, error)

SetMetadata sets metadata for the given instance.

func (*Instance) Cleanup

func (i *Instance) Cleanup() error

Cleanup deletes the Instance.

func (*Instance) RestartWithScriptCode

func (i *Instance) RestartWithScriptCode(script string) error

RestartWithScriptCode restarts the instance with given startup script.

func (*Instance) StartWithScriptCode

func (i *Instance) StartWithScriptCode(script string, instanceMetadata map[string]string) error

StartWithScriptCode starts the instance with given startup script and metadata

func (*Instance) WaitForSerialOutput

func (i *Instance) WaitForSerialOutput(match string, failureMatches []string, port int64, interval, timeout time.Duration) error

WaitForSerialOutput waits to a string match on a serial port.

type InstanceBeta

type InstanceBeta struct {
	*apiBeta.Instance
	Client        daisyCompute.Client
	Project, Zone string
	IsWindows     bool
}

InstanceBeta is a compute instance using Beta API.

func CreateInstanceBeta

func CreateInstanceBeta(ctx context.Context, project string, zone string, name string,
	isWindows bool, machineImageName string) (*InstanceBeta, error)

CreateInstanceBeta creates a VM instance (not just an object representing an existing VM) using Beta API

func CreateInstanceBetaObject

func CreateInstanceBetaObject(ctx context.Context, project string, zone string, name string, isWindows bool) (*InstanceBeta, error)

CreateInstanceBetaObject creates an instance object to be operated by Beta API client

func (*InstanceBeta) Cleanup

func (i *InstanceBeta) Cleanup() error

Cleanup deletes the InstanceBeta.

func (*InstanceBeta) StartWithScriptCode

func (i *InstanceBeta) StartWithScriptCode(script string, instanceMetadata map[string]string) error

StartWithScriptCode starts the instance with given startup script and metadata.

func (*InstanceBeta) WaitForSerialOutput

func (i *InstanceBeta) WaitForSerialOutput(match string, failureMatches []string, port int64, interval, timeout time.Duration) error

WaitForSerialOutput waits to a string match on a serial port.

Jump to

Keyboard shortcuts

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