instance

package
v25.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2016 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LabelList []LabelTagMetadata = []LabelTagMetadata{
		{
			Key:     "director",
			ValueFn: SafeLabel,
		},
		{
			Key:     "name",
			ValueFn: SafeLabel,
		},
		{
			Key:     "deployment",
			ValueFn: SafeLabel,
		},
		{
			Key:     "job",
			ValueFn: SafeLabel,
		},
		{
			Key:     "index",
			ValueFn: func(s string) string { return "index-" + SafeLabel(s) },
		},
	}

	// The list of metadata keys whose value will be automatically applied as a tag
	TagList []LabelTagMetadata = []LabelTagMetadata{
		{
			Key:     "job",
			ValueFn: SafeLabel,
		},
	}
)

The list of metadata key-value pairs that should be applied as labels

Functions

func SafeLabel

func SafeLabel(s string) string

Types

type AttachedDisks

type AttachedDisks []string

type GoogleInstanceService

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

func NewGoogleInstanceService

func NewGoogleInstanceService(
	project string,
	computeService *compute.Service,
	computeServiceB *computebeta.Service,
	addressService address.Service,
	backendServiceService backendservice.Service,
	networkService network.Service,
	operationService operation.Service,
	subnetworkService subnetwork.Service,
	targetPoolService targetpool.Service,
	uuidGen boshuuid.Generator,
	logger boshlog.Logger,
) GoogleInstanceService

func (GoogleInstanceService) AddAccessConfig

func (i GoogleInstanceService) AddAccessConfig(id string, zone string, networkInterface string, accessConfig *compute.AccessConfig) error

func (GoogleInstanceService) AttachDisk

func (i GoogleInstanceService) AttachDisk(id string, diskLink string) (string, string, error)

func (GoogleInstanceService) AttachedDisks

func (i GoogleInstanceService) AttachedDisks(id string) (AttachedDisks, error)

func (GoogleInstanceService) CleanUp

func (i GoogleInstanceService) CleanUp(id string)

func (GoogleInstanceService) Create

func (i GoogleInstanceService) Create(vmProps *Properties, networks Networks, registryEndpoint string) (string, error)

func (GoogleInstanceService) Delete

func (i GoogleInstanceService) Delete(id string) error

func (GoogleInstanceService) DeleteAccessConfig

func (i GoogleInstanceService) DeleteAccessConfig(id string, zone string, networkInterface string, accessConfig string) error

func (GoogleInstanceService) DetachDisk

func (i GoogleInstanceService) DetachDisk(id string, diskID string) error

func (GoogleInstanceService) Find

func (i GoogleInstanceService) Find(id string, zone string) (*compute.Instance, bool, error)

func (GoogleInstanceService) FindBeta

func (i GoogleInstanceService) FindBeta(id string, zone string) (*computebeta.Instance, bool, error)

func (GoogleInstanceService) Reboot

func (i GoogleInstanceService) Reboot(id string) error

func (GoogleInstanceService) SetMetadata

func (i GoogleInstanceService) SetMetadata(id string, vmMetadata Metadata) error

func (GoogleInstanceService) SetTags

func (i GoogleInstanceService) SetTags(id string, zone string, instanceTags *compute.Tags) error

func (GoogleInstanceService) UpdateNetworkConfiguration

func (i GoogleInstanceService) UpdateNetworkConfiguration(id string, networks Networks) error

type GoogleUserData

type GoogleUserData struct {
	Server   GoogleUserDataServerName       `json:"server"`
	Registry GoogleUserDataRegistryEndpoint `json:"registry"`
	DNS      GoogleUserDataDNSItems         `json:"dns,omitempty"`
}

type GoogleUserDataDNSItems

type GoogleUserDataDNSItems struct {
	NameServer []string `json:"nameserver,omitempty"`
}

type GoogleUserDataRegistryEndpoint

type GoogleUserDataRegistryEndpoint struct {
	Endpoint string `json:"endpoint"`
}

type GoogleUserDataServerName

type GoogleUserDataServerName struct {
	Name string `json:"name"`
}

type LabelTagMetadata

type LabelTagMetadata struct {
	Key     string
	ValueFn func(string) string
}

type Metadata

type Metadata map[string]interface{}

type Network

type Network struct {
	Type                string
	IP                  string
	Gateway             string
	Netmask             string
	DNS                 []string
	Default             []string
	NetworkName         string
	SubnetworkName      string
	EphemeralExternalIP bool
	IPForwarding        bool
	Tags                Tags
}

func (Network) IsDynamic

func (n Network) IsDynamic() bool

func (Network) IsManual

func (n Network) IsManual() bool

func (Network) IsVip

func (n Network) IsVip() bool

func (Network) Validate

func (n Network) Validate() error

type Networks

type Networks map[string]*Network

func (Networks) CanIPForward

func (n Networks) CanIPForward() bool

func (Networks) DNS

func (n Networks) DNS() []string

func (Networks) EphemeralExternalIP

func (n Networks) EphemeralExternalIP() bool

func (Networks) Network

func (n Networks) Network() *Network

func (Networks) NetworkName

func (n Networks) NetworkName() string

func (Networks) StaticPrivateIP

func (n Networks) StaticPrivateIP() string

func (Networks) SubnetworkName

func (n Networks) SubnetworkName() string

func (Networks) Tags

func (n Networks) Tags() Tags

func (Networks) Validate

func (n Networks) Validate() error

func (Networks) VipNetwork

func (n Networks) VipNetwork() *Network

type Properties

type Properties struct {
	Zone              string
	Name              string
	Stemcell          string
	MachineType       string
	RootDiskSizeGb    int
	RootDiskType      string
	AutomaticRestart  bool
	OnHostMaintenance string
	Preemptible       bool
	ServiceAccount    ServiceAccount
	ServiceScopes     ServiceScopes
	TargetPool        string
	BackendService    string
	Tags              Tags
}

type Service

type Service interface {
	AddAccessConfig(id string, zone string, networkInterface string, accessConfig *compute.AccessConfig) error
	AttachDisk(id string, diskLink string) (string, string, error)
	AttachedDisks(id string) (AttachedDisks, error)
	CleanUp(id string)
	Create(vmProps *Properties, networks Networks, registryEndpoint string) (string, error)
	Delete(id string) error
	DeleteAccessConfig(id string, zone string, networkInterface string, accessConfig string) error
	DetachDisk(id string, diskID string) error
	Find(id string, zone string) (*compute.Instance, bool, error)
	Reboot(id string) error
	SetMetadata(id string, vmMetadata Metadata) error
	SetTags(id string, zone string, instanceTags *compute.Tags) error
	UpdateNetworkConfiguration(id string, networks Networks) error
}

type ServiceAccount

type ServiceAccount string

type ServiceScopes

type ServiceScopes []string

type Tags

type Tags []string

func (Tags) Unique

func (t Tags) Unique() []string

func (Tags) Validate

func (t Tags) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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