Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GroupReq ¶
type GroupReq struct { // Direction is the scaling direction which the group is requested to change. Direction Direction // Count is the number by which to change the count by in the desired direction. This // information can also be found within the GroupScalingPolicy, but the API and the internal // autoscaler have different ways in which to process data so it is their responsibility to // populate this field for use and moves this logic away from the trigger. Count int // GroupName is the name of the job group to scale in this request. GroupName string // GroupScalingPolicy should include the job group scaling policy if it exists within the // Sherpa server. GroupScalingPolicy *policy.GroupScalingPolicy }
GroupReq is a single item of scaling information for a single job group.
func (*GroupReq) MarshalZerologObject ¶
type Scale ¶
type Scale interface { // Trigger performs scaling of 1 or more job groups which belong to the same job. Trigger(string, []*GroupReq) (*api.JobRegisterResponse, int, error) // contains filtered or unexported methods }
Scale is the interface used for scaling a Nomad job.
type Scaler ¶
type Scaler struct {
// contains filtered or unexported fields
}
func (*Scaler) Trigger ¶
func (s *Scaler) Trigger(jobID string, groupReqs []*GroupReq) (*api.JobRegisterResponse, int, error)
Trigger performs scaling of 1 or more job groups which belong to the same job.
The return values indicate:
- the Nomad API job register response
- the HTTP return code, used for the Sherpa API
- any error
Click to show internal directories.
Click to hide internal directories.