gce_cloud

package
v1.1.0-alpha.1....-e8f77b3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2015 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package gce_cloud is an implementation of Interface, TCPLoadBalancer and Instances for Google Compute Engine.

Index

Constants

View Source
const (
	ProviderName = "gce"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Global struct {
		TokenURL    string `gcfg:"token-url"`
		TokenBody   string `gcfg:"token-body"`
		ProjectID   string `gcfg:"project-id"`
		NetworkName string `gcfg:"network-name"`
	}
}

type GCEAffinityType

type GCEAffinityType string

Session Affinity Type string

const (
	// AffinityTypeNone - no session affinity.
	GCEAffinityTypeNone GCEAffinityType = "None"
	// AffinityTypeClientIP is the Client IP based.
	GCEAffinityTypeClientIP GCEAffinityType = "CLIENT_IP"
	// AffinityTypeClientIP is the Client IP based.
	GCEAffinityTypeClientIPProto GCEAffinityType = "CLIENT_IP_PROTO"
)

type GCECloud

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

GCECloud is an implementation of Interface, TCPLoadBalancer and Instances for Google Compute Engine.

func (*GCECloud) AddInstancesToInstanceGroup

func (gce *GCECloud) AddInstancesToInstanceGroup(name string, instanceNames []string) error

AddInstancesToInstanceGroup adds the given instances to the given instance group.

func (*GCECloud) AddPortToInstanceGroup

func (gce *GCECloud) AddPortToInstanceGroup(ig *compute.InstanceGroup, port int64) (*compute.NamedPort, error)

AddPortToInstanceGroup adds a port to the given instance group.

func (*GCECloud) AddSSHKeyToAllInstances

func (gce *GCECloud) AddSSHKeyToAllInstances(user string, keyData []byte) error

func (*GCECloud) AttachDisk

func (gce *GCECloud) AttachDisk(diskName string, readOnly bool) error

func (*GCECloud) Clusters

func (gce *GCECloud) Clusters() (cloudprovider.Clusters, bool)

func (*GCECloud) CreateBackendService

func (gce *GCECloud) CreateBackendService(bg *compute.BackendService) error

CreateBackendService creates the given BackendService.

func (*GCECloud) CreateGlobalForwardingRule

func (gce *GCECloud) CreateGlobalForwardingRule(proxy *compute.TargetHttpProxy, name string, portRange string) (*compute.ForwardingRule, error)

CreateGlobalForwardingRule creates and returns a GlobalForwardingRule that points to the given TargetHttpProxy.

func (*GCECloud) CreateInstanceGroup

func (gce *GCECloud) CreateInstanceGroup(name string) (*compute.InstanceGroup, error)

CreateInstanceGroup creates an instance group with the given instances. It is the callers responsibility to add named ports.

func (*GCECloud) CreateRoute

func (gce *GCECloud) CreateRoute(clusterName string, nameHint string, route *cloudprovider.Route) error

func (*GCECloud) CreateTargetHttpProxy

func (gce *GCECloud) CreateTargetHttpProxy(urlMap *compute.UrlMap, name string) (*compute.TargetHttpProxy, error)

CreateTargetHttpProxy creates and returns a TargetHttpProxy with the given UrlMap.

func (*GCECloud) CreateUrlMap

func (gce *GCECloud) CreateUrlMap(backend *compute.BackendService, name string) (*compute.UrlMap, error)

CreateUrlMap creates an url map, using the given backend service as the default service.

func (*GCECloud) CurrentNodeName

func (gce *GCECloud) CurrentNodeName(hostname string) (string, error)

Implementation of Instances.CurrentNodeName

func (*GCECloud) DeleteBackendService

func (gce *GCECloud) DeleteBackendService(name string) error

DeleteBackendService deletes the given BackendService by name.

func (*GCECloud) DeleteGlobalForwardingRule

func (gce *GCECloud) DeleteGlobalForwardingRule(name string) error

DeleteGlobalForwardingRule deletes the GlobalForwardingRule by name.

func (*GCECloud) DeleteInstanceGroup

func (gce *GCECloud) DeleteInstanceGroup(name string) error

DeleteInstanceGroup deletes an instance group.

func (*GCECloud) DeleteRoute

func (gce *GCECloud) DeleteRoute(clusterName string, route *cloudprovider.Route) error

func (*GCECloud) DeleteTargetHttpProxy

func (gce *GCECloud) DeleteTargetHttpProxy(name string) error

DeleteTargetHttpProxy deletes the TargetHttpProxy by name.

func (*GCECloud) DeleteUrlMap

func (gce *GCECloud) DeleteUrlMap(name string) error

DeleteUrlMap deletes a url map by name.

func (*GCECloud) DetachDisk

func (gce *GCECloud) DetachDisk(devicePath string) error

func (*GCECloud) EnsureTCPLoadBalancer

func (gce *GCECloud) EnsureTCPLoadBalancer(name, region string, loadBalancerIP net.IP, ports []*api.ServicePort, hosts []string, affinityType api.ServiceAffinity) (*api.LoadBalancerStatus, error)

EnsureTCPLoadBalancer is an implementation of TCPLoadBalancer.EnsureTCPLoadBalancer. TODO(a-robinson): Don't just ignore specified IP addresses. Check if they're owned by the project and available to be used, and use them if they are.

func (*GCECloud) EnsureTCPLoadBalancerDeleted

func (gce *GCECloud) EnsureTCPLoadBalancerDeleted(name, region string) error

EnsureTCPLoadBalancerDeleted is an implementation of TCPLoadBalancer.EnsureTCPLoadBalancerDeleted.

func (*GCECloud) ExternalID

func (gce *GCECloud) ExternalID(instance string) (string, error)

ExternalID returns the cloud provider ID of the specified instance (deprecated).

func (*GCECloud) GetBackendService

func (gce *GCECloud) GetBackendService(name string) (*compute.BackendService, error)

GetBackendService retrieves a backend by name.

func (*GCECloud) GetGlobalForwardingRule

func (gce *GCECloud) GetGlobalForwardingRule(name string) (*compute.ForwardingRule, error)

GetGlobalForwardingRule returns the GlobalForwardingRule by name.

func (*GCECloud) GetHttpHealthCheck

func (gce *GCECloud) GetHttpHealthCheck(name string) (*compute.HttpHealthCheck, error)

GetHttpHealthCheck returns the given HttpHealthCheck by name.

func (*GCECloud) GetInstanceGroup

func (gce *GCECloud) GetInstanceGroup(name string) (*compute.InstanceGroup, error)

GetInstanceGroup returns an instance group by name.

func (*GCECloud) GetTCPLoadBalancer

func (gce *GCECloud) GetTCPLoadBalancer(name, region string) (*api.LoadBalancerStatus, bool, error)

GetTCPLoadBalancer is an implementation of TCPLoadBalancer.GetTCPLoadBalancer

func (*GCECloud) GetTargetHttpProxy

func (gce *GCECloud) GetTargetHttpProxy(name string) (*compute.TargetHttpProxy, error)

GetTargetHttpProxy returns the UrlMap by name.

func (*GCECloud) GetUrlMap

func (gce *GCECloud) GetUrlMap(name string) (*compute.UrlMap, error)

GetUrlMap returns the UrlMap by name.

func (*GCECloud) GetZone

func (gce *GCECloud) GetZone() (cloudprovider.Zone, error)

func (*GCECloud) InstanceID

func (gce *GCECloud) InstanceID(instance string) (string, error)

InstanceID returns the cloud provider ID of the specified instance.

func (*GCECloud) Instances

func (gce *GCECloud) Instances() (cloudprovider.Instances, bool)

Instances returns an implementation of Instances for Google Compute Engine.

func (*GCECloud) List

func (gce *GCECloud) List(filter string) ([]string, error)

List is an implementation of Instances.List.

func (*GCECloud) ListClusters

func (gce *GCECloud) ListClusters() ([]string, error)

func (*GCECloud) ListInstancesInInstanceGroup

func (gce *GCECloud) ListInstancesInInstanceGroup(name string, state string) (*compute.InstanceGroupsListInstances, error)

ListInstancesInInstanceGroup lists all the instances in a given istance group and state.

func (*GCECloud) ListRoutes

func (gce *GCECloud) ListRoutes(clusterName string) ([]*cloudprovider.Route, error)

func (*GCECloud) Master

func (gce *GCECloud) Master(clusterName string) (string, error)

func (*GCECloud) NodeAddresses

func (gce *GCECloud) NodeAddresses(_ string) ([]api.NodeAddress, error)

NodeAddresses is an implementation of Instances.NodeAddresses.

func (*GCECloud) ProviderName

func (gce *GCECloud) ProviderName() string

ProviderName returns the cloud provider ID.

func (*GCECloud) RemoveInstancesFromInstanceGroup

func (gce *GCECloud) RemoveInstancesFromInstanceGroup(name string, instanceNames []string) error

RemoveInstancesFromInstanceGroup removes the given instances from the instance group.

func (*GCECloud) Routes

func (gce *GCECloud) Routes() (cloudprovider.Routes, bool)

Routes returns an implementation of Routes for Google Compute Engine.

func (*GCECloud) SetProxyForGlobalForwardingRule

func (gce *GCECloud) SetProxyForGlobalForwardingRule(fw *compute.ForwardingRule, proxy *compute.TargetHttpProxy) error

SetProxyForGlobalForwardingRule links the given TargetHttpProxy with the given GlobalForwardingRule.

func (*GCECloud) SetUrlMapForTargetHttpProxy

func (gce *GCECloud) SetUrlMapForTargetHttpProxy(proxy *compute.TargetHttpProxy, urlMap *compute.UrlMap) error

SetUrlMapForTargetHttpProxy sets the given UrlMap for the given TargetHttpProxy.

func (*GCECloud) TCPLoadBalancer

func (gce *GCECloud) TCPLoadBalancer() (cloudprovider.TCPLoadBalancer, bool)

TCPLoadBalancer returns an implementation of TCPLoadBalancer for Google Compute Engine.

func (*GCECloud) UpdateBackendService

func (gce *GCECloud) UpdateBackendService(bg *compute.BackendService) error

UpdateBackendService applies the given BackendService as an update to an existing service.

func (*GCECloud) UpdateTCPLoadBalancer

func (gce *GCECloud) UpdateTCPLoadBalancer(name, region string, hosts []string) error

UpdateTCPLoadBalancer is an implementation of TCPLoadBalancer.UpdateTCPLoadBalancer.

func (*GCECloud) UpdateUrlMap

func (gce *GCECloud) UpdateUrlMap(urlMap *compute.UrlMap) (*compute.UrlMap, error)

UpdateUrlMap applies the given UrlMap as an update, and returns the new UrlMap.

func (*GCECloud) Zones

func (gce *GCECloud) Zones() (cloudprovider.Zones, bool)

Zones returns an implementation of Zones for Google Compute Engine.

Jump to

Keyboard shortcuts

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