Documentation
¶
Index ¶
- type CreateCPUThresholdScaling
- type CreateRequest
- type CreateRouterThresholdScaling
- type CreateScheduleScaling
- type DeleteRequest
- type FindRequest
- type ReadRequest
- type Service
- func (s *Service) Create(req *CreateRequest) (*iaas.AutoScale, error)
- func (s *Service) CreateWithContext(ctx context.Context, req *CreateRequest) (*iaas.AutoScale, error)
- func (s *Service) Delete(req *DeleteRequest) error
- func (s *Service) DeleteWithContext(ctx context.Context, req *DeleteRequest) error
- func (s *Service) Find(req *FindRequest) ([]*iaas.AutoScale, error)
- func (s *Service) FindWithContext(ctx context.Context, req *FindRequest) ([]*iaas.AutoScale, error)
- func (s *Service) Read(req *ReadRequest) (*iaas.AutoScale, error)
- func (s *Service) ReadWithContext(ctx context.Context, req *ReadRequest) (*iaas.AutoScale, error)
- func (s *Service) Status(req *StatusRequest) (*iaas.AutoScaleStatus, error)
- func (s *Service) StatusWithContext(ctx context.Context, req *StatusRequest) (*iaas.AutoScaleStatus, error)
- func (s *Service) Update(req *UpdateRequest) (*iaas.AutoScale, error)
- func (s *Service) UpdateWithContext(ctx context.Context, req *UpdateRequest) (*iaas.AutoScale, error)
- type StatusRequest
- type UpdateCPUThresholdScaling
- type UpdateRequest
- type UpdateRouterThresholdScaling
- type UpdateScheduleScaling
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateCPUThresholdScaling ¶ added in v1.1.1
type CreateRequest ¶
type CreateRequest struct { Name string `validate:"required"` Description string `validate:"min=0,max=512"` Tags types.Tags IconID types.ID Zones []string `validate:"required"` Config string `validate:"required"` TriggerType types.EAutoScaleTriggerType `validate:"omitempty,oneof=cpu router schedule"` CPUThresholdScaling *CreateCPUThresholdScaling `validate:"omitempty,dive"` RouterThresholdScaling *CreateRouterThresholdScaling `validate:"omitempty,dive"` ScheduleScaling []*CreateScheduleScaling `validate:"omitempty,dive"` Disabled bool APIKeyID string `validate:"required"` }
func (*CreateRequest) ToRequestParameter ¶
func (req *CreateRequest) ToRequestParameter() (*iaas.AutoScaleCreateRequest, error)
func (*CreateRequest) Validate ¶
func (req *CreateRequest) Validate() error
type CreateRouterThresholdScaling ¶ added in v1.5.0
type CreateScheduleScaling ¶ added in v1.7.0
type CreateScheduleScaling struct { Action types.EAutoScaleAction `validate:"required,oneof=up down"` Hour int `validate:"gte=0,lte=23"` Minute int `validate:"oneof=0 15 30 45"` DayOfWeek []types.EDayOfTheWeek `validate:"gt=0,unique,dive,required,oneof=sun mon tue wed thu fri sat"` }
type DeleteRequest ¶
type DeleteRequest struct { ID types.ID `service:"-" validate:"required"` FailIfNotFound bool `service:"-"` }
func (*DeleteRequest) Validate ¶
func (req *DeleteRequest) Validate() error
type FindRequest ¶
type FindRequest struct { Names []string `service:"-"` Tags []string `service:"-"` Sort search.SortKeys Count int From int }
func (*FindRequest) ToRequestParameter ¶
func (req *FindRequest) ToRequestParameter() (*iaas.FindCondition, error)
func (*FindRequest) Validate ¶
func (req *FindRequest) Validate() error
type ReadRequest ¶
func (*ReadRequest) Validate ¶
func (req *ReadRequest) Validate() error
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides a high-level API of for AutoScale
func (*Service) Create ¶
func (s *Service) Create(req *CreateRequest) (*iaas.AutoScale, error)
func (*Service) CreateWithContext ¶
func (s *Service) CreateWithContext(ctx context.Context, req *CreateRequest) (*iaas.AutoScale, error)
func (*Service) Delete ¶
func (s *Service) Delete(req *DeleteRequest) error
func (*Service) DeleteWithContext ¶
func (s *Service) DeleteWithContext(ctx context.Context, req *DeleteRequest) error
func (*Service) Find ¶
func (s *Service) Find(req *FindRequest) ([]*iaas.AutoScale, error)
func (*Service) FindWithContext ¶
func (s *Service) FindWithContext(ctx context.Context, req *FindRequest) ([]*iaas.AutoScale, error)
func (*Service) Read ¶
func (s *Service) Read(req *ReadRequest) (*iaas.AutoScale, error)
func (*Service) ReadWithContext ¶
func (s *Service) ReadWithContext(ctx context.Context, req *ReadRequest) (*iaas.AutoScale, error)
func (*Service) Status ¶
func (s *Service) Status(req *StatusRequest) (*iaas.AutoScaleStatus, error)
func (*Service) StatusWithContext ¶
func (s *Service) StatusWithContext(ctx context.Context, req *StatusRequest) (*iaas.AutoScaleStatus, error)
func (*Service) Update ¶
func (s *Service) Update(req *UpdateRequest) (*iaas.AutoScale, error)
func (*Service) UpdateWithContext ¶
func (s *Service) UpdateWithContext(ctx context.Context, req *UpdateRequest) (*iaas.AutoScale, error)
type StatusRequest ¶
func (*StatusRequest) Validate ¶
func (req *StatusRequest) Validate() error
type UpdateCPUThresholdScaling ¶ added in v1.1.1
type UpdateRequest ¶
type UpdateRequest struct { ID types.ID `service:"-" validate:"required"` Name *string `service:",omitempty" validate:"omitempty,min=1"` Description *string `service:",omitempty" validate:"omitempty,max=512"` Tags *types.Tags `service:",omitempty"` IconID *types.ID `service:",omitempty"` Zones *[]string `service:",omitempty" validate:"omitempty,required"` Config *string `service:",omitempty" validate:"omitempty,required"` TriggerType *string `service:",omitempty" validate:"omitempty,required,oneof=cpu router"` CPUThresholdScaling *UpdateCPUThresholdScaling `service:"-" validate:"omitempty,dive"` RouterThresholdScaling *UpdateRouterThresholdScaling `service:"-" validate:"omitempty,dive"` ScheduleScaling *[]*UpdateScheduleScaling `service:"-" validate:"omitempty,dive"` Disabled *bool `service:",omitempty"` SettingsHash string }
func (*UpdateRequest) ToRequestParameter ¶
func (req *UpdateRequest) ToRequestParameter(current *iaas.AutoScale) (*iaas.AutoScaleUpdateRequest, error)
func (*UpdateRequest) Validate ¶
func (req *UpdateRequest) Validate() error
type UpdateRouterThresholdScaling ¶ added in v1.5.0
type UpdateScheduleScaling ¶ added in v1.7.0
type UpdateScheduleScaling struct { Action types.EAutoScaleAction `validate:"required,oneof=up down"` Hour int `validate:"gte=0,lte=23"` Minute int `validate:"oneof=0 15 30 45"` DayOfWeek []types.EDayOfTheWeek `validate:"gt=0,unique,dive,required,oneof=sun mon tue wed thu fri sat"` }
Click to show internal directories.
Click to hide internal directories.