autoscaling

package
v0.0.0-...-6410feb Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ASController = new(SASController)
View Source
var (
	ErrScaling = errors.Error("A scaling activity is ongoing")
)

Functions

This section is empty.

Types

type SASController

type SASController struct {
	// contains filtered or unexported fields
}

func (*SASController) CheckInstanceHealth

func (asc *SASController) CheckInstanceHealth(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)

func (*SASController) CheckScale

func (asc *SASController) CheckScale(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)

func (*SASController) CreateInstances

func (asc *SASController) CreateInstances(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	ownerId mcclient.IIdentityProvider,
	sg *models.SScalingGroup,
	gt *models.SGuestTemplate,
	defaultNet string,
	num int,
) ([]SInstance, error)

func (*SASController) DetachInstances

func (asc *SASController) DetachInstances(ctx context.Context, userCred mcclient.TokenCredential,
	ownerId mcclient.IIdentityProvider, sg *models.SScalingGroup, num int) ([]SInstance, error)

func (*SASController) Finish

func (asc *SASController) Finish(groupId string, success bool)

func (*SASController) HealthCheckSql

func (asc *SASController) HealthCheckSql() *sqlchemy.SQuery

func (*SASController) Init

func (*SASController) PreScale

func (asc *SASController) PreScale(group *models.SScalingGroup, userCred mcclient.TokenCredential) bool

func (*SASController) Scale

func (asc *SASController) Scale(ctx context.Context, userCred mcclient.TokenCredential, short SScalingGroupShort)

func (*SASController) ScalingGroupsNeedScale

func (asc *SASController) ScalingGroupsNeedScale() ([]SScalingGroupShort, error)

ScalingGroupNeedScale will fetch all ScalingGroup need to scale

func (*SASController) Timer

func (asc *SASController) Timer(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)

type SCreateRet

type SCreateRet struct {
	Id     string
	Status string
}

type SFailRecord

type SFailRecord struct {
	// contains filtered or unexported fields
}

func (*SFailRecord) Append

func (fr *SFailRecord) Append(record string)

func (*SFailRecord) String

func (fr *SFailRecord) String() string

type SInstance

type SInstance struct {
	ID   string
	Name string
}

type SLockedSet

type SLockedSet struct {
	// contains filtered or unexported fields
}

func (*SLockedSet) CheckAndInsert

func (set *SLockedSet) CheckAndInsert(s string) bool

func (*SLockedSet) Delete

func (set *SLockedSet) Delete(s string)

func (*SLockedSet) Has

func (set *SLockedSet) Has(s string) bool

type SScalingGroupShort

type SScalingGroupShort struct {
	ID                   string
	DesireInstanceNumber int `default:"0"`
	Total                int `default:"0"`
}

SScalingGroupShort wrap the ScalingGroup's ID and DesireInstanceNumber with field 'total' which means the total guests number in this ScalingGroup

type SScalingInfo

type SScalingInfo struct {
	ScalingGroup *models.SScalingGroup
	Total        int
}

type STimeScope

type STimeScope struct {
	Start  time.Time
	End    time.Time
	Median time.Time
}

Jump to

Keyboard shortcuts

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