linuxkit

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiskConfig

type DiskConfig struct {
	Path   string
	Size   int
	Format string
}

DiskConfig is the config for a disk

type Disks

type Disks []DiskConfig

Disks is the type for a list of DiskConfig

func (*Disks) Set

func (l *Disks) Set(value string) error

Set is used by flag to configure value from CLI

func (*Disks) String

func (l *Disks) String() string

type GCPClient

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

GCPClient contains state required for communication with GCP

func NewGCPClient

func NewGCPClient(keys, projectName string) (*GCPClient, error)

NewGCPClient creates a new GCP client

func (GCPClient) ConnectToInstanceSerialPort

func (g GCPClient) ConnectToInstanceSerialPort(instance, zone string) error

ConnectToInstanceSerialPort uses SSH to connect to the serial port of the instance

func (GCPClient) CreateImage

func (g GCPClient) CreateImage(name, storageURL, family string, uefi, replace bool) error

CreateImage creates a GCP image using the source from Google Storage

func (GCPClient) CreateInstance

func (g GCPClient) CreateInstance(name, image, zone, machineType string, disks Disks, data *string, vtpm, replace bool) error

CreateInstance creates and starts an instance on GCP

func (GCPClient) DeleteFirewallAllowRule

func (g GCPClient) DeleteFirewallAllowRule(ruleName string) error

DeleteFirewallAllowRule runs gcloud compute firewall-rules delete ruleName

func (GCPClient) DeleteImage

func (g GCPClient) DeleteImage(name string) error

DeleteImage deletes and image

func (GCPClient) DeleteInstance

func (g GCPClient) DeleteInstance(instance, zone string, wait bool) error

DeleteInstance removes an instance

func (GCPClient) GetInstanceNatIP

func (g GCPClient) GetInstanceNatIP(instance, zone string) (string, error)

GetInstanceNatIP returns NatIP of an instance

func (GCPClient) GetInstanceSerialOutput

func (g GCPClient) GetInstanceSerialOutput(instance, zone string, follow bool) error

GetInstanceSerialOutput streams the serial output of an instance follow log if follow set to true

func (GCPClient) ListImages

func (g GCPClient) ListImages() ([]string, error)

ListImages list all uploaded images

func (GCPClient) RemoveFile

func (g GCPClient) RemoveFile(file, bucketName string) error

RemoveFile removes a file from Google Storage

func (GCPClient) SetFirewallAllowRule

func (g GCPClient) SetFirewallAllowRule(ruleName string, priority int64, sourceRanges []string) error

SetFirewallAllowRule runs gcloud compute firewall-rules create ruleName --allow all --source-ranges=sourceRanges --priority=priority

func (GCPClient) UploadFile

func (g GCPClient) UploadFile(src, dst, bucketName string, public bool) error

UploadFile uploads a file to Google Storage

type PublishedPort

type PublishedPort struct {
	Guest    uint16
	Host     uint16
	Protocol string
}

PublishedPort is used by some backends to expose a VMs port on the host

func NewPublishedPort

func NewPublishedPort(publish string) (PublishedPort, error)

NewPublishedPort parses a string of the form <host>:<guest>[/<tcp|udp>] and returns a PublishedPort structure

Jump to

Keyboard shortcuts

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