Documentation ¶
Index ¶
- Constants
- func ConfigClient(value ClientAPI) func(*OpsManagerGCP) error
- func ConfigClientTimeoutSeconds(value int) func(*OpsManagerGCP) error
- func ConfigGoogleClient(value GoogleComputeClient) func(*GCPClientAPI) error
- func ConfigProjectName(value string) func(*GCPClientAPI) error
- func ConfigZoneName(value string) func(*GCPClientAPI) error
- type ClientAPI
- type GCPClientAPI
- type GoogleComputeClient
- type OpsManagerGCP
Constants ¶
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 GCPClientAPI ¶
type GCPClientAPI struct {
// contains filtered or unexported fields
}
func NewGCPClientAPI ¶
func NewGCPClientAPI(configs ...func(*GCPClientAPI) error) (*GCPClientAPI, error)
func (*GCPClientAPI) DeleteVM ¶
func (s *GCPClientAPI) DeleteVM(instanceName string) error
func (*GCPClientAPI) GetVMInfo ¶
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) 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)