api: use the task in Allocations.GetPauseState (#23377)

This commit is contained in:
Daniel Bennett
2024-06-18 12:31:12 -05:00
committed by GitHub
parent b92afa5b4a
commit cfeedd05e8
2 changed files with 4 additions and 1 deletions

3
.changelog/23377.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:bug
api: (Enterprise) fixed Allocations.GetPauseState method discarding the task argument
```

View File

@@ -251,7 +251,7 @@ func (a *Allocations) SetPauseState(alloc *Allocation, q *QueryOptions, task, st
// The ?task=<task> query parameter must be set.
func (a *Allocations) GetPauseState(alloc *Allocation, q *QueryOptions, task string) (string, *QueryMeta, error) {
var resp AllocGetPauseResponse
qm, err := a.client.query("/v1/client/allocation/"+alloc.ID+"/pause", &resp, q)
qm, err := a.client.query("/v1/client/allocation/"+alloc.ID+"/pause?task="+task, &resp, q)
state := resp.ScheduleState
return state, qm, err
}