Documentation
¶
Index ¶
- func GetFormattedInstanceList(instances []Instance) []string
- func GetIDFromEnv(name string) (int, error)
- func InstanceInList(instances []Instance, i string) bool
- func PrettyPrint(v interface{})
- func StringInSlice(s string, list []string) bool
- type APIClient
- func (c *APIClient) AddNode(orgID, clusterID int, newNode NodeAdd) ([]Node, error)
- func (c *APIClient) AddNodesToNodePool(orgID, clusterID, nodepoolID int, newNode NodeAddToPool) ([]Node, error)
- func (c *APIClient) CreateCluster(orgID int, cluster Cluster) (*Cluster, error)
- func (c *APIClient) CreateKeyset(orgID int, keyset Keyset) (*Keyset, error)
- func (c *APIClient) CreateNodePool(orgID, clusterID int, newPool NodePool) (*NodePool, error)
- func (c *APIClient) DeleteCluster(orgID, clusterID int) error
- func (c *APIClient) DeleteKeyset(orgID, keysetID int) error
- func (c *APIClient) DeleteNode(orgID, clusterID, nodeID int) error
- func (c *APIClient) GetCluster(orgID, clusterID int) (*Cluster, error)
- func (c *APIClient) GetClusterState(orgID, clusterID int) (string, error)
- func (c *APIClient) GetClusters(orgID int) ([]Cluster, error)
- func (c *APIClient) GetInstanceSpecs(prov string) ([]Instance, error)
- func (c *APIClient) GetKeyset(orgID, keysetID int) (*Keyset, error)
- func (c *APIClient) GetKeysets(orgID int) ([]Keyset, error)
- func (c *APIClient) GetNode(orgID, clusterID, nodeID int) (*Node, error)
- func (c *APIClient) GetNodePool(orgID, clusterID, nodepoolID int) (*NodePool, error)
- func (c *APIClient) GetNodePoolState(orgID, clusterID, nodepoolID int) (string, error)
- func (c *APIClient) GetNodePools(orgID, clusterID int) ([]NodePool, error)
- func (c *APIClient) GetNodeState(orgID, clusterID, nodeID int) (string, error)
- func (c *APIClient) GetNodes(orgID, clusterID int) ([]Node, error)
- func (c *APIClient) GetOrganization(orgID int) (*Organization, error)
- func (c *APIClient) GetOrganizations() ([]Organization, error)
- type Cluster
- type Instance
- type Key
- type Keyset
- type MachineSpecs
- type Node
- type NodeAdd
- type NodeAddToPool
- type NodePool
- type Organization
- type ProviderSpecs
- type Solution
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFormattedInstanceList ¶
GetFormattedInstanceList takes a list of Instance objects and makes a formatted list of strings for the user
func GetIDFromEnv ¶
GetEnvID grabs string from environment and converts to integer
func InstanceInList ¶
InstanceInList returns true if instance is in list of Instances
func StringInSlice ¶
StringInSlice utlity function, like in_array, userful for validation of machine types
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
APIClient references an api token and an http endpoint
func NewClientFromEnv ¶
NewClientFromEnv creates a new client from environment variables
func (*APIClient) AddNode ¶
AddNodes sends a request to add master nodes to a cluster, returns list of Node objects created
func (*APIClient) AddNodesToNodePool ¶
func (c *APIClient) AddNodesToNodePool(orgID, clusterID, nodepoolID int, newNode NodeAddToPool) ([]Node, error)
AddNodesToNodePool sends a request to add worker nodes to a nodepool, returns list of Node objects created
func (*APIClient) CreateCluster ¶
CreateCluster requests cluster creation
func (*APIClient) CreateKeyset ¶
CreateKeyset creates keyset
func (*APIClient) CreateNodePool ¶
CreateNodePool creates a new nodepool for a cluster, returns NodePool object
func (*APIClient) DeleteCluster ¶
DeleteCluster deletes cluster
func (*APIClient) DeleteKeyset ¶
DeleteKeyset deletes keyset
func (*APIClient) DeleteNode ¶
DeleteNode makes an API call to begin deleting a node
func (*APIClient) GetCluster ¶
GetCluster gets a single cluster by primary ID and organization
func (*APIClient) GetClusterState ¶
GetClusterState returns state of cluster
func (*APIClient) GetClusters ¶
GetClusters gets all clusters associated with an organization
func (*APIClient) GetInstanceSpecs ¶
GetMachSpecs returns list of machine types for cloud provider type
func (*APIClient) GetKeysets ¶
GetKeysets gets list of keysets for Org ID
func (*APIClient) GetNodePool ¶
GetNodePool gets a NodePool for a cluster, returns NodePool object
func (*APIClient) GetNodePoolState ¶
GetNodePoolState returns state of nodepool
func (*APIClient) GetNodePools ¶
GetNodePools gets the NodePools for a cluster, returns list of NodePool objects
func (*APIClient) GetNodeState ¶
GetNodeState returns state of node
func (*APIClient) GetOrganization ¶
func (c *APIClient) GetOrganization(orgID int) (*Organization, error)
GetOrganization retrieves data for a single organization
func (*APIClient) GetOrganizations ¶
func (c *APIClient) GetOrganizations() ([]Organization, error)
GetOrganizations retrieves data organizations that the client can access
type Cluster ¶
type Cluster struct {
ID int `json:"pk"`
Name string `json:"name"`
OrganizationKey int `json:"org"`
InstanceID string `json:"instance_id"`
Provider string `json:"provider"`
ProviderKey int `json:"provider_keyset"`
ProviderKeyName string `json:"provider_keyset_name"`
ProviderResourceGp string `json:"provider_resource_group,omitempty"`
ProviderNetworkID string `json:"provider_network_id,omitempty"`
ProviderNetworkCdr string `json:"provider_network_cidr,omitempty"`
ProviderSubnetID string `json:"provider_subnet_id,omitempty"`
ProviderSubnetCidr string `json:"provider_subnet_cidr,omitempty"`
ProviderBalancerID string `json:"provider_balancer_id,omitempty"`
Region string `json:"region"`
Zone string `json:"zone,omitempty"`
State string `json:"state,omitempty"`
ProjectID string `json:"project_id,omitempty"`
Owner int `json:"owner"`
Notified bool `json:"notified,omitempty"`
KubernetesVersion string `json:"k8s_version"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated,omitempty"`
DashboardEnabled bool `json:"k8s_dashboard_enabled"`
DashboardInstalled bool `json:"k8s_dashboard_installed"`
KubeconfigPath string `json:"kubeconfig_path"`
RbacEnabled bool `json:"k8s_rbac_enabled"`
MasterCount int `json:"master_count"`
WorkerCount int `json:"worker_count"`
MasterSize string `json:"master_size"`
WorkerSize string `json:"worker_size"`
NodeCount int `json:"node_count"`
EtcdType string `json:"etcd_type"`
Platform string `json:"platform"`
Image string `json:"image"`
Channel string `json:"channel"`
SSHKeySet int `json:"user_ssh_keyset"`
Solutions []Solution `json:"solutions"`
}
Cluster describes a Kubernetes cluster in the StackPointCloud system
type Instance ¶
type Instance struct {
Name string
Specs MachineSpecs
}
type Key ¶
type Key struct {
ID int `json:"pk"`
Type string `json:"key_type"`
Value string `json:"key"`
Fingerprint string `json:"fingerprint"`
User int `json:"user"`
}
Key struct
type Keyset ¶
type Keyset struct {
Name string `json:"name"`
ID int `json:"pk"`
Category string `json:"category"`
Entity string `json:"entity"`
Org int `json:"org"`
Workspaces []int `json:"workspaces"`
User int `json:"user"`
IsDefault bool `json:"is_default"`
Keys []Key `json:"keys"`
Created string `json:"created"`
}
Keyset struct
type MachineSpecs ¶
type Node ¶
type Node struct {
ID int `json:"pk"`
Name string `json:"name,omitempty"`
ClusterID int `json:"cluster"`
InstanceID string `json:"instance_id"`
NodePoolID int `json:"pool,omitempty"`
NodePoolName string `json:"pool_name,omitempty"`
Role string `json:"role"`
Group string `json:"group_name,omitempty"`
PrivateIP string `json:"private_ip"`
PublicIP string `json:"public_ip"`
Platform string `json:"platform"`
Image string `json:"image"`
Location string `json:"location"`
Size string `json:"size"`
State string `json:"state,omitempty"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated,omitempty"`
}
Node describes a node in a cluster. The string field Size is provider-specific
type NodeAdd ¶
type NodeAdd struct {
Size string `json:"size"`
Count int `json:"node_count"`
Group string `json:"group,omitempty"`
Role string `json:"role,omitempty"`
Zone string `json:"zone,omitempty"`
ProviderSubnetID string `json:"provider_subnet_id,omitempty"`
ProviderSubnetCidr string `json:"provider_subnet_cidr,omitempty"`
}
NodeAdd is used for adding master nodes only (endpoint /clusters/<cluster_id>/add_node)
type NodeAddToPool ¶
type NodeAddToPool struct {
Count int `json:"node_count"`
Group string `json:"group,omitempty"`
NodePoolID int `json:"node_pool"`
Role string `json:"role,omitempty"`
Zone string `json:"zone,omitempty"`
ProviderSubnetID string `json:"provider_subnet_id,omitempty"`
ProviderSubnetCidr string `json:"provider_subnet_cidr,omitempty"`
}
NodeAddToPool is used for adding worker nodes to pools (endpoint /clusters/<cluster_id>/nodepools/add)
type NodePool ¶
type NodePool struct {
ID int `json:"pk"`
Name string `json:"name"`
ClusterID int `json:"cluster"`
InstanceID string `json:"instance_id"`
Size string `json:"instance_size"`
CPU string `json:"cpu,omitempty"`
Memory string `json:"memory,omitempty"`
Labels string `json:"labels,omitempty"`
Autoscaled bool `json:"autoscaled"`
MinCount int `json:"min_count,omitempty"`
MaxCount int `json:"max_count,omitempty"`
Zone string `json:"zone,omitempty"`
ProviderSubnetID string `json:"provider_subnet_id,omitempty"`
ProviderSubnetCidr string `json:"provider_subnet_cidr,omitempty"`
NodeCount int `json:"node_count"`
Platform string `json:"platform"`
Channel string `json:"channel"`
Role string `json:"role,omitempty"`
State string `json:"state,omitempty"`
Default bool `json:"is_default"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated,omitempty"`
Deleted time.Time `json:"deleted,omitempty"`
}
NodePool defines the characteristics of a grouping of nodes
type Organization ¶
Organization is the top level of the hierarchy
type ProviderSpecs ¶
type ProviderSpecs struct {
Name string `json:"name"`
Filters interface{} `json:"filters"`
Config interface{} `json:"config"`
}
Provider instance structs