Merge pull request #5512 from hashicorp/dani/f-alloc-stop

alloc-lifecycle: nomad alloc stop
This commit is contained in:
Danielle
2019-04-23 13:05:08 +02:00
committed by GitHub
11 changed files with 479 additions and 3 deletions

View File

@@ -89,6 +89,20 @@ func (a *Allocations) Restart(alloc *Allocation, taskName string, q *QueryOption
return err
}
func (a *Allocations) Stop(alloc *Allocation, q *QueryOptions) (*AllocStopResponse, error) {
var resp AllocStopResponse
_, err := a.client.putQuery("/v1/allocation/"+alloc.ID+"/stop", nil, &resp, q)
return &resp, err
}
// AllocStopResponse is the response to an `AllocStopRequest`
type AllocStopResponse struct {
// EvalID is the id of the follow up evalution for the rescheduled alloc.
EvalID string
WriteMeta
}
// Allocation is used for serialization of allocations.
type Allocation struct {
ID string