cloudprovider

package
v0.0.0-...-2083380 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2017 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloudProviders

func CloudProviders() []string

CloudProviders returns a list of registered cloud providers.

func IsRegistered

func IsRegistered(name string) bool

IsRegistered returns a bool whether a given cloud provider is registered.

func Register

func Register(name string, cloud Factory)

Register registers a cloudprovider.Interface by name. This is expected to be called during main startup.

Types

type Clusters

type Clusters interface {
	// CreateClusterInfra creates infra components for a new cluster.
	CreateClusterInfra(model.Cluster) error
	// GetClusters returns a list of clusters in the cloud account.
	GetClusters(name string) ([]*model.Cluster, error)
	// DescribeCluster describes a given cluster.
	// TODO
	DescribeCluster(name string) error
	// DeleteCluster deletes a cluster.
	// TODO
	DeleteCluster(name string) error
	// GetMasterPersistentIPs returns a map of master persistent IP label
	// values to IPs for a given clusterName.
	GetMasterPersistentIPs(clusterName string) (map[string]string, error)
	// PushAssets pushes assets to cloud provider specific implementation.
	PushAssets(clusterName string, a model.Assets) error
}

Clusters is an abstract interface for clusters.

type Factory

type Factory func(l Logger) (Interface, error)

Factory is a function that returns a cloudprovider.Interface.

type Interface

type Interface interface {
	// ProviderName returns the cloud provider name.
	ProviderName() string
	// Clusters returns a clusters interface. Also returns true if the
	// interface is supported, false otherwise.
	Clusters() (Clusters, bool)
	// NodePooler returns a node pools interface. Also returns true if the
	// interface is supported, false otherwise.
	NodePooler() (NodePooler, bool)
	// Node returns a node interface. Also returns true if the interface is
	// supported, false otherwise.
	Node() (Node, bool)
}

Interface is an abstract interface for cloud providers.

func InitCloudProvider

func InitCloudProvider(name string, l Logger) (Interface, error)

InitCloudProvider creates an instance of the named cloud provider. Logger l need to be passed in at initialization time.

type Logger

type Logger interface {
	Printf(string, ...interface{})
}

Logger is generic logger interface for debug logging.

type Node

type Node interface {
	// GetAssets gets assets from a cloud.
	GetAssets() (model.Assets, error)
	// GetNodeData returns node data.
	GetNodeData() (model.NodeData, error)
}

Node is an abstract interface for interacting with a cloud provider when running on a cloud instance.

type NodePooler

type NodePooler interface {
	// CreateMasterPool creates a new master node pool.
	CreateMasterPool(pool model.MasterPool) error
	// CreateComputePool creates a new compute node pool.
	CreateComputePool(pool model.ComputePool) error
	// GetMasterPools returns a list of master pools in the cloud.
	GetMasterPools(clusterName, name string) ([]*model.MasterPool, error)
	// GetComputePools returns a list of compute pools in the cloud.
	GetComputePools(clusterName, name string) ([]*model.ComputePool, error)
	// DescribeNodePool describes a given node pool.
	// TODO
	DescribeNodePool() error
	// UpgradePool upgrades a node pool.
	// TODO
	UpgradeNodePool() error
	// DeleteMasterPool deletes a master node pool.
	DeleteMasterPool(clusterName string) error
	// DeleteComputePool deletes a compute node pool.
	DeleteComputePool(clusterName, name string) error
}

NodePooler is an abstract interface for node pools.

Directories

Path Synopsis
aws

Jump to

Keyboard shortcuts

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