Documentation ¶
Index ¶
- Variables
- type SASController
- func (asc *SASController) CheckInstanceHealth(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
- func (asc *SASController) CheckScale(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
- func (asc *SASController) CreateInstances(ctx context.Context, userCred mcclient.TokenCredential, ...) ([]SInstance, error)
- func (asc *SASController) DetachInstances(ctx context.Context, userCred mcclient.TokenCredential, ...) ([]SInstance, error)
- func (asc *SASController) Finish(groupId string, success bool)
- func (asc *SASController) HealthCheckSql() *sqlchemy.SQuery
- func (asc *SASController) Init(options options.SASControllerOptions, cronm *cronman.SCronJobManager)
- func (asc *SASController) PreScale(group *models.SScalingGroup, userCred mcclient.TokenCredential) bool
- func (asc *SASController) Scale(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (asc *SASController) ScalingGroupsNeedScale() ([]SScalingGroupShort, error)
- func (asc *SASController) Timer(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
- type SCreateRet
- type SFailRecord
- type SInstance
- type SLockedSet
- type SScalingGroupShort
- type SScalingInfo
- type STimeScope
Constants ¶
This section is empty.
Variables ¶
View Source
var ASController = new(SASController)
View Source
var (
ErrScaling = errors.Error("A scaling activity is ongoing")
)
View Source
var UnhealthStatus = []string{ apis.VM_UNKNOWN, apis.VM_SCHEDULE_FAILED, apis.VM_NETWORK_FAILED, apis.VM_DEVICE_FAILED, apis.VM_DISK_FAILED, apis.VM_DEPLOY_FAILED, apis.VM_READY, apis.VM_START_FAILED, }
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 (asc *SASController) Init(options options.SASControllerOptions, cronm *cronman.SCronJobManager)
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 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 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 }
Click to show internal directories.
Click to hide internal directories.