Documentation ¶
Index ¶
- func DeleteGroup(svc Service, group *cloudinstances.CloudInstanceGroup) error
- func DeleteInstance(svc Service, instance *cloudinstances.CloudInstanceGroupMember) error
- func GetCloudGroups(svc Service, cluster *kops.Cluster, instancegroups []*kops.InstanceGroup, ...) (map[string]*cloudinstances.CloudInstanceGroup, error)
- func ListGroups(svc Service, clusterName string) ([]*resources.Resource, error)
- func LoadCredentials() (credentials.Value, error)
- func NewConfig() *spotinst.Config
- func NewCredentials() *credentials.Credentials
- func NewStdLogger() log.Logger
- type Elastigroup
- type Instance
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteGroup ¶
func DeleteGroup(svc Service, group *cloudinstances.CloudInstanceGroup) error
DeleteGroup deletes an existing Elastigroup.
func DeleteInstance ¶
func DeleteInstance(svc Service, instance *cloudinstances.CloudInstanceGroupMember) error
DeleteInstance removes an instance from its Elastigroup.
func GetCloudGroups ¶
func GetCloudGroups(svc Service, cluster *kops.Cluster, instancegroups []*kops.InstanceGroup, warnUnmatched bool, nodes []v1.Node) (map[string]*cloudinstances.CloudInstanceGroup, error)
GetCloudGroups returns a list of Elastigroups as CloudInstanceGroup objects.
func ListGroups ¶
ListGroups returns a list of all Elastigroups as Resource objects.
func LoadCredentials ¶
func LoadCredentials() (credentials.Value, error)
LoadCredentials attempts to load credentials using the default chain.
func NewCredentials ¶
func NewCredentials() *credentials.Credentials
NewCredentials returns a new chain-credentials object.
Types ¶
type Elastigroup ¶
type Elastigroup interface { // Id returns the ID of the Elastigroup. Id() string // Name returns the name of the Elastigroup. Name() string // MinSize returns the minimum size of the Elastigroup. MinSize() int // MaxSize returns the maximum size of the Elastigroup. MaxSize() int // Obj returns the raw object which is a cloud-specific implementation. Obj() interface{} }
Elastigroup contains configuration info and functions to control a set of instances.
func NewElastigroup ¶
func NewElastigroup(cloudProviderID kops.CloudProviderID, obj interface{}) (Elastigroup, error)
NewElastigroup returns an Elastigroup wrapper for the specified cloud provider.
type Instance ¶
type Instance interface { // Id returns the ID of the instance. Id() string // Obj returns the raw object which is a cloud-specific implementation. Obj() interface{} }
Instance wraps a cloud-specific instance object.
type Service ¶
type Service interface { // List returns a list of Elastigroups. List(ctx context.Context) ([]Elastigroup, error) // Create creates a new Elastigroup and returns its ID. Create(ctx context.Context, group Elastigroup) (string, error) // Read returns an existing Elastigroup by ID. Read(ctx context.Context, groupID string) (Elastigroup, error) // Update updates an existing Elastigroup. Update(ctx context.Context, group Elastigroup) error // Delete deletes an existing Elastigroup by ID. Delete(ctx context.Context, groupID string) error // Detach removes one or more instances from the specified Elastigroup. Detach(ctx context.Context, groupID string, instanceIDs []string) error // Instances returns a list of all instances that belong to specified Elastigroup. Instances(ctx context.Context, groupID string) ([]Instance, error) }
Service is an interface that a cloud provider that is supported by Spotinst MUST implement to manage its Elastigroups.
func NewService ¶
func NewService(cloudProviderID kops.CloudProviderID) (Service, error)
NewService returns a Service interface for the specified cloud provider.