google

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComputeUtil

type ComputeUtil struct {
	SwarmMaster bool
	SwarmHost   string
	// contains filtered or unexported fields
}

ComputeUtil is used to wrap the raw GCE API code and store common parameters.

func (*ComputeUtil) CleanUpFirewallRule

func (c *ComputeUtil) CleanUpFirewallRule(rule *raw.Firewall, labelKey string) error

CleanUpFirewallRule attempts to remove a network firewall rule if no VMs are currently associated with that rule. It expects that VMs utilizing this rule have been appropriately labeled with the provided label key, and that the value of that key equals the name of the provided raw.Firewall.

type Driver

type Driver struct {
	*drivers.BaseDriver
	Auth                       string
	Zone                       string
	MachineType                string
	MachineImage               string
	DiskType                   string
	Address                    string
	Network                    string
	Subnetwork                 string
	Preemptible                bool
	UseInternalIP              bool
	UseInternalIPOnly          bool
	Scopes                     string
	DiskSize                   int
	Project                    string
	Tags                       string
	Labels                     string
	UseExisting                bool
	OpenPorts                  []string
	ExternalFirewallRulePrefix string
	InternalFirewallRulePrefix string
	Userdata                   string
}

Driver is a struct compatible with the docker.hosts.drivers.Driver interface.

func NewDriver

func NewDriver(machineName string, storePath string) *Driver

NewDriver creates a Driver with the specified storePath.

func (*Driver) Create

func (d *Driver) Create() error

Create creates a GCE VM instance acting as a docker host.

func (*Driver) DriverName

func (d *Driver) DriverName() string

DriverName returns the name of the driver

func (*Driver) GetCreateFlags

func (d *Driver) GetCreateFlags() []mcnflag.Flag

GetCreateFlags registers the flags this driver adds to "docker hosts create"

func (*Driver) GetIP

func (d *Driver) GetIP() (string, error)

GetIP returns the IP address of the GCE instance.

func (*Driver) GetSSHHostname

func (d *Driver) GetSSHHostname() (string, error)

GetSSHHostname returns hostname for use with ssh

func (*Driver) GetSSHUsername

func (d *Driver) GetSSHUsername() string

GetSSHUsername returns username for use with ssh

func (*Driver) GetState

func (d *Driver) GetState() (state.State, error)

GetState returns a docker.hosts.state.State value representing the current state of the host.

func (*Driver) GetURL

func (d *Driver) GetURL() (string, error)

GetURL returns the URL of the remote docker daemon.

func (*Driver) Kill

func (d *Driver) Kill() error

Kill stops an existing GCE instance.

func (*Driver) PreCreateCheck

func (d *Driver) PreCreateCheck() error

PreCreateCheck is called to enforce pre-creation steps

func (*Driver) Remove

func (d *Driver) Remove() error

Remove deletes the GCE instance and the disk.

func (*Driver) Restart

func (d *Driver) Restart() error

Restart restarts a machine which is known to be running.

func (*Driver) SetConfigFromFlags

func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error

SetConfigFromFlags initializes the driver based on the command line flags.

func (*Driver) Start

func (d *Driver) Start() error

Start starts an existing GCE instance or create an instance with an existing disk.

func (*Driver) Stop

func (d *Driver) Stop() error

Stop stops an existing GCE instance.

func (*Driver) UnmarshalJSON

func (d *Driver) UnmarshalJSON(data []byte) error

UnmarshalJSON loads driver config from JSON. This function is used by the RPCServerDriver that wraps all drivers as a means of populating an already-initialized driver with new configuration. See `RPCServerDriver.SetConfigRaw`.

Jump to

Keyboard shortcuts

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