mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Merge pull request #5512 from hashicorp/dani/f-alloc-stop
alloc-lifecycle: nomad alloc stop
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user