719077a26d
state store: call-out to generic update of job recommendations from job update method recommendations API work, and http endpoint errors for OSS support for scaling polices in task block of job spec add query filters for ScalingPolicy list endpoint command: nomad scaling policy list: added -job and -type
38 lines
752 B
Go
38 lines
752 B
Go
// +build !ent
|
|
|
|
package structs
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
|
|
multierror "github.com/hashicorp/go-multierror"
|
|
)
|
|
|
|
func (m *Multiregion) Validate(jobType string, jobDatacenters []string) error {
|
|
if m != nil {
|
|
return errors.New("Multiregion jobs are unlicensed.")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (p *ScalingPolicy) validateType() multierror.Error {
|
|
var mErr multierror.Error
|
|
|
|
// Check policy type and target
|
|
switch p.Type {
|
|
case ScalingPolicyTypeHorizontal:
|
|
targetErr := p.validateTargetHorizontal()
|
|
mErr.Errors = append(mErr.Errors, targetErr.Errors...)
|
|
default:
|
|
mErr.Errors = append(mErr.Errors, fmt.Errorf(`scaling policy type "%s" is not valid`, p.Type))
|
|
}
|
|
|
|
return mErr
|
|
}
|
|
|
|
func (j *Job) GetEntScalingPolicies() []*ScalingPolicy {
|
|
return nil
|
|
}
|