Help us shape the future of Go! Take the 2026 Go Developer Survey

spotinst

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

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

func ListGroups(svc Service, clusterName string) ([]*resources.Resource, error)

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 NewConfig

func NewConfig() *spotinst.Config

NewConfig returns a new configuration object.

func NewCredentials

func NewCredentials() *credentials.Credentials

NewCredentials returns a new chain-credentials object.

func NewStdLogger

func NewStdLogger() log.Logger

NewStdLogger returns a new Logger.

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.

Jump to

Keyboard shortcuts

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