Documentation ¶
Index ¶
- Constants
- func ConfigGoogleClient(value GoogleComputeClient) func(*Client) error
- func ConfigProjectName(value string) func(*Client) error
- func ConfigTimeout(value time.Duration) func(*Client) error
- func ConfigZoneName(value string) func(*Client) error
- type Client
- func (s *Client) CreateImage(tarball string, diskSizeGB int64) (string, error)
- func (s *Client) CreateVM(instance compute.Instance) error
- func (c *Client) Delete(identifier string) error
- func (s *Client) DeleteVM(instanceName string) error
- func (s *Client) Disk(filter Filter) (*compute.Disk, error)
- func (s *Client) GetDisk(identifier string) (iaas.Disk, error)
- func (s *Client) GetVMInfo(filter Filter) (*compute.Instance, error)
- func (c *Client) Replace(identifier string, sourceImageTarballURL string, diskSizeGB int64) error
- func (s *Client) StopVM(instanceName string) error
- func (s *Client) WaitForStatus(vmName string, desiredStatus string) error
- type ClientAPI
- type Filter
- type GoogleComputeClient
Constants ¶
View Source
const ( InstanceAll = "ALL" InstanceRunning = "RUNNING" InstanceTerminated = "TERMINATED" ImageReady = "READY" ImageFailed = "FAILED" )
Variables ¶
This section is empty.
Functions ¶
func ConfigGoogleClient ¶
func ConfigGoogleClient(value GoogleComputeClient) func(*Client) error
func ConfigProjectName ¶
func ConfigZoneName ¶
Types ¶
type Client ¶ added in v0.1.2
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateImage ¶ added in v0.1.8
func (*Client) GetVMInfo ¶ added in v0.1.2
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
type ClientAPI ¶
type ClientAPI interface { CreateVM(instance compute.Instance) error DeleteVM(instanceName string) error GetVMInfo(filter Filter) (*compute.Instance, error) Disk(filter Filter) (*compute.Disk, error) StopVM(instanceName string) error CreateImage(tarball string, diskSizeGB int64) (string, error) WaitForStatus(vmName string, desiredStatus string) error }
type GoogleComputeClient ¶
type GoogleComputeClient interface { List(project string, zone string) (*compute.InstanceList, error) DiskList(project string, zone string) (*compute.DiskList, error) Delete(project string, zone string, instanceName string) (*compute.Operation, error) Insert(project string, zone string, instance *compute.Instance) (*compute.Operation, error) ImageInsert(project string, image *compute.Image, timeout time.Duration) (*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`
Click to show internal directories.
Click to hide internal directories.