API for rolling back a job update has been integrated.
This commit is contained in:
parent
97f9c05026
commit
ca8b9359cf
2 changed files with 19 additions and 0 deletions
|
@ -238,6 +238,15 @@ func main() {
|
||||||
}
|
}
|
||||||
fmt.Println(resp.String())
|
fmt.Println(resp.String())
|
||||||
break
|
break
|
||||||
|
case "rollbackUpdate":
|
||||||
|
fmt.Println("Abort update")
|
||||||
|
resp, err := r.RollbackJobUpdate(aurora.JobUpdateKey{job.JobKey(), *updateId}, "")
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
fmt.Println(resp.String())
|
||||||
|
break
|
||||||
case "taskConfig":
|
case "taskConfig":
|
||||||
fmt.Println("Getting job info")
|
fmt.Println("Getting job info")
|
||||||
config, err := r.FetchTaskConfig(aurora.InstanceKey{job.JobKey(), 0})
|
config, err := r.FetchTaskConfig(aurora.InstanceKey{job.JobKey(), 0})
|
||||||
|
|
10
realis.go
10
realis.go
|
@ -38,6 +38,7 @@ type Realis interface {
|
||||||
KillInstances(key *aurora.JobKey, instances ...int32) (*aurora.Response, error)
|
KillInstances(key *aurora.JobKey, instances ...int32) (*aurora.Response, error)
|
||||||
RestartInstances(key *aurora.JobKey, instances ...int32) (*aurora.Response, error)
|
RestartInstances(key *aurora.JobKey, instances ...int32) (*aurora.Response, error)
|
||||||
RestartJob(key *aurora.JobKey) (*aurora.Response, error)
|
RestartJob(key *aurora.JobKey) (*aurora.Response, error)
|
||||||
|
RollbackJobUpdate(key aurora.JobUpdateKey, message string) (*aurora.Response, error)
|
||||||
StartJobUpdate(updateJob *UpdateJob, message string) (*aurora.Response, error)
|
StartJobUpdate(updateJob *UpdateJob, message string) (*aurora.Response, error)
|
||||||
Close()
|
Close()
|
||||||
}
|
}
|
||||||
|
@ -289,3 +290,12 @@ func (r realisClient) JobUpdateDetails(updateQuery aurora.JobUpdateQuery) (*auro
|
||||||
|
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
func (r realisClient) RollbackJobUpdate(key aurora.JobUpdateKey, message string) (*aurora.Response, error) {
|
||||||
|
|
||||||
|
resp, err := r.client.RollbackJobUpdate(&key, message)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrap(err, "Unable to roll back job update")
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp, nil
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue