Adds support for Tier and SlaPolicy to the Job interface

This adds the following function to the Job interface
- `Tier(tier *string) Job`
- `SlaPolicy(policy *aurora.SlaPolicy) Job`
- Test coverage for each in the end to end tests.
This commit is contained in:
Robert Allen 2018-12-19 15:24:44 -06:00
parent 296af622d1
commit 9ed7690de1
2 changed files with 101 additions and 0 deletions

15
job.go
View file

@ -56,6 +56,8 @@ type Job interface {
MaxFailure(maxFail int32) Job
Container(container Container) Job
PartitionPolicy(policy *aurora.PartitionPolicy) Job
Tier(tier *string) Job
SlaPolicy(policy *aurora.SlaPolicy) Job
}
// Structure to collect all information pertaining to an Aurora job.
@ -320,6 +322,19 @@ func (j *AuroraJob) Container(container Container) Job {
// Set a partition policy for the job configuration to implement.
func (j *AuroraJob) PartitionPolicy(policy *aurora.PartitionPolicy) Job {
j.jobConfig.TaskConfig.PartitionPolicy = policy
return j
}
// Set the Tier for the Job.
func (j *AuroraJob) Tier(tier *string) Job {
j.jobConfig.TaskConfig.Tier = tier
return j
}
// Set an SlaPolicy for the Job.
func (j *AuroraJob) SlaPolicy(policy *aurora.SlaPolicy) Job {
j.jobConfig.TaskConfig.SlaPolicy = policy
return j
}