Documentation ¶
Index ¶
- Constants
- func CredentialsNextStepsString(clusterName string) string
- func GetCredentialsDir() (string, error)
- type Account
- type Cache
- type CacheUnavailableError
- type Cacheable
- type Client
- func (client *Client) CreateCluster(account Account, name string, template string, nodes int, waitUntilActive bool) (common.Cluster, error)
- func (client *Client) DeleteCluster(account Account, name string, waitUntilDeleted bool) error
- func (client *Client) DeleteClusterCredentials(account Account, name string, customPath string) error
- func (client *Client) DownloadClusterCredentials(account Account, name string, customPath string) (credentialsPath string, err error)
- func (client *Client) GetCluster(account Account, name string, waitUntilActive bool) (common.Cluster, error)
- func (client *Client) GetQuotas(account Account) (common.Quotas, error)
- func (client *Client) GetSourceCommand(account Account, shell string, name string, customPath string) (sourceText string, err error)
- func (client *Client) GrowCluster(account Account, name string, nodes int, waitUntilActive bool) (common.Cluster, error)
- func (client *Client) ListClusterTemplates(account Account, nameFilter string) ([]common.ClusterTemplate, error)
- func (client *Client) ListClusters(account Account) ([]common.Cluster, error)
- func (client *Client) RebuildCluster(account Account, name string, waitUntilActive bool) (common.Cluster, error)
- func (client *Client) ResizeCluster(account Account, name string, nodes int, waitUntilActive bool) (common.Cluster, error)
- func (client *Client) SetAutoScale(account Account, name string, value bool) (common.Cluster, error)
- type UserError
Constants ¶
const CarinaHomeDirEnvVar = "CARINA_HOME"
CarinaHomeDirEnvVar is the environment variable name for carina data, config, etc.
const CloudMagnum = "private"
CloudMagnum is the Rackspace Private Cloud Magnum cloud type
const CloudMakeCOE = "public"
CloudMakeCOE is the v2 Carina (make-coe) cloud type
const CloudMakeSwarm = "make-swarm"
CloudMakeSwarm is the v1 Carina (make-swarm) cloud type
Variables ¶
This section is empty.
Functions ¶
func CredentialsNextStepsString ¶
CredentialsNextStepsString returns instructions to load the cluster credentials
func GetCredentialsDir ¶
GetCredentialsDir gets the carina home directory, e.g. ~/.carina
Types ¶
type Account ¶
type Account interface { Cacheable // GetID returns a unique string to identity to the account's credentials GetID() string // GetClusterPrefix returns a unique string to identity the account's clusters GetClusterPrefix() (string, error) // NewClusterService create the appropriate ClusterService for the account NewClusterService() common.ClusterService }
Account contains the data required to communicate with a Carina API instance
type Cache ¶
type Cache struct { sync.Mutex LastUpdateCheck time.Time `json:"last-check"` Accounts map[string]cacheItem `json:"accounts"` // contains filtered or unexported fields }
Cache is an on-disk cache of transient application values
func (*Cache) SaveAccount ¶
SaveAccount caches transient account data, such as the auth token
type CacheUnavailableError ¶
type CacheUnavailableError struct {
// contains filtered or unexported fields
}
CacheUnavailableError explains why the on-disk cache is unavailable
func (CacheUnavailableError) Cause ¶
func (error CacheUnavailableError) Cause() error
Cause returns the underlying cause of the error
func (CacheUnavailableError) Error ¶
func (error CacheUnavailableError) Error() string
Error returns the underlying error message
type Cacheable ¶
type Cacheable interface { // BuildCache builds the set of data to cache BuildCache() map[string]string // ApplyCache applies a set of cached data ApplyCache(c map[string]string) }
Cacheable represents an item that can be stored in a serialized cache
type Client ¶
Client is the multi-cloud Carina client, which coordinates communication with all Carina-esque clouds
func (*Client) CreateCluster ¶
func (client *Client) CreateCluster(account Account, name string, template string, nodes int, waitUntilActive bool) (common.Cluster, error)
CreateCluster creates a new cluster and prints the cluster information
func (*Client) DeleteCluster ¶
DeleteCluster deletes a cluster
func (*Client) DeleteClusterCredentials ¶
func (client *Client) DeleteClusterCredentials(account Account, name string, customPath string) error
DeleteClusterCredentials removes a cluster's downloaded credentials
func (*Client) DownloadClusterCredentials ¶
func (client *Client) DownloadClusterCredentials(account Account, name string, customPath string) (credentialsPath string, err error)
DownloadClusterCredentials downloads the TLS certificates and configuration scripts for a cluster
func (*Client) GetCluster ¶
func (client *Client) GetCluster(account Account, name string, waitUntilActive bool) (common.Cluster, error)
GetCluster retrieves a cluster
func (*Client) GetSourceCommand ¶
func (client *Client) GetSourceCommand(account Account, shell string, name string, customPath string) (sourceText string, err error)
GetSourceCommand returns the shell command and appropriate help text to load a cluster's credentials
func (*Client) GrowCluster ¶
func (client *Client) GrowCluster(account Account, name string, nodes int, waitUntilActive bool) (common.Cluster, error)
GrowCluster adds nodes to a cluster
func (*Client) ListClusterTemplates ¶
func (client *Client) ListClusterTemplates(account Account, nameFilter string) ([]common.ClusterTemplate, error)
ListClusterTemplates retrieves available templates for creating a new cluster
func (*Client) ListClusters ¶
ListClusters retrieves all clusters
func (*Client) RebuildCluster ¶
func (client *Client) RebuildCluster(account Account, name string, waitUntilActive bool) (common.Cluster, error)
RebuildCluster destroys and recreates the cluster