gcp

package
v5.0.0+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	GoogleComputeAuth = "https://www.googleapis.com/auth/compute"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func (Client) CheckExists

func (c Client) CheckExists(networkName string) (bool, error)

func (Client) GetNetworks

func (c Client) GetNetworks(name string) (*compute.NetworkList, error)

func (Client) GetRegion

func (c Client) GetRegion(region string) (*compute.Region, error)

func (Client) GetZone

func (c Client) GetZone(zone string) (*compute.Zone, error)

func (Client) GetZones

func (c Client) GetZones(region string) ([]string, error)

func (Client) ProjectID

func (c Client) ProjectID() string

func (Client) ValidateSafeToDelete

func (c Client) ValidateSafeToDelete(networkName string, envID string) error

type ClientProvider

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

func NewClientProvider

func NewClientProvider(gcpBasePath string) *ClientProvider

func (*ClientProvider) Client

func (p *ClientProvider) Client() Client

func (*ClientProvider) SetConfig

func (p *ClientProvider) SetConfig(serviceAccountKey, projectID, region, zone string) error

type ComputeClient

type ComputeClient interface {
	ListInstances(projectID, zone string) (*compute.InstanceList, error)
	GetZones(region, projectID string) ([]string, error)
	GetZone(zone, projectID string) (*compute.Zone, error)
	GetRegion(region, projectID string) (*compute.Region, error)
	GetNetworks(name, projectID string) (*compute.NetworkList, error)
}

Jump to

Keyboard shortcuts

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