gcp

package
v0.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2017 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

View Source
const (
	InstanceStatusRunning = "RUNNING"
	InstanceStatusStopped = "STOPPED"
)

Variables

This section is empty.

Functions

func ConfigClient

func ConfigClient(value ClientAPI) func(*OpsManagerGCP) error

func ConfigClientTimeoutSeconds

func ConfigClientTimeoutSeconds(value int) func(*OpsManagerGCP) error

func ConfigGoogleClient

func ConfigGoogleClient(value GoogleComputeClient) func(*GCPClientAPI) error

func ConfigProjectName

func ConfigProjectName(value string) func(*GCPClientAPI) error

func ConfigZoneName

func ConfigZoneName(value string) func(*GCPClientAPI) error

Types

type ClientAPI

type ClientAPI interface {
	CreateVM(instance compute.Instance) error
	DeleteVM(instanceName string) error
	GetVMInfo(filter iaas.Filter) (*compute.Instance, error)
	StopVM(instanceName string) error
}

type GCPClientAPI

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

func NewGCPClientAPI

func NewGCPClientAPI(configs ...func(*GCPClientAPI) error) (*GCPClientAPI, error)

func (*GCPClientAPI) CreateVM

func (s *GCPClientAPI) CreateVM(instance compute.Instance) error

func (*GCPClientAPI) DeleteVM

func (s *GCPClientAPI) DeleteVM(instanceName string) error

func (*GCPClientAPI) GetVMInfo

func (s *GCPClientAPI) GetVMInfo(filter iaas.Filter) (*compute.Instance, error)

GetVMInfo - gets the information on the first VM to match the given filter argument currently filter will only do a regex on teh tag||name regex fields against the List's result set

func (*GCPClientAPI) StopVM

func (s *GCPClientAPI) StopVM(instanceName string) error

StopVM - will try to stop the VM with the given name

type GoogleComputeClient

type GoogleComputeClient interface {
	List(project string, zone string) (*compute.InstanceList, error)
	Delete(project string, zone string, instanceName string) (*compute.Operation, error)
	Insert(project string, zone string, instance *compute.Instance) (*compute.Operation, error)
	Stop(project string, zone string, instanceName string) (*compute.Operation, error)
}

func NewDefaultGoogleComputeClient

func NewDefaultGoogleComputeClient(credpath string) (GoogleComputeClient, error)

NewDefaultGoogleComputeClient -- builds a gcp client which connects to your gcp using `GOOGLE_APPLICATION_CREDENTIALS`

type OpsManagerGCP

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

func NewOpsManager

func NewOpsManager(configs ...func(*OpsManagerGCP) error) (*OpsManagerGCP, error)

func (*OpsManagerGCP) CleanUp

func (s *OpsManagerGCP) CleanUp(filter iaas.Filter) error

func (*OpsManagerGCP) Deploy

func (s *OpsManagerGCP) Deploy(vmInstance *compute.Instance) error

Deploy - this should take a compute.Instance that is a copy of your existing Ops manager instance object, with 2 modifications. 1) you should swap the `Name` with a unique name you wish to use for the new opsmanager vm instnace 2) you should swap the `Instance.Disks` to match the latest instance image tarball for ops manager (found on network.pivotal.io)

func (*OpsManagerGCP) SpinDown

func (s *OpsManagerGCP) SpinDown(filter iaas.Filter) (*compute.Instance, error)

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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