Skip to content

Commit

Permalink
Fix: Path not including action
Browse files Browse the repository at this point in the history
  • Loading branch information
tbroden84 authored and dentarg committed Jun 7, 2024
1 parent 15e3cc0 commit 990cf05
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ func (api *API) PostAction(instanceID int, nodeName string, action string) (
failed map[string]any
actionAsRoute string
params = make(map[string][]string)
path = fmt.Sprintf("api/instances/%d/actions/%s", instanceID, actionAsRoute)
)

params["nodes"] = append(params["nodes"], nodeName)

if action == "mgmt.restart" {
actionAsRoute = "mgmt-restart"
} else {
actionAsRoute = action
}
params["nodes"] = append(params["nodes"], nodeName)

path := fmt.Sprintf("api/instances/%d/actions/%s", instanceID, actionAsRoute)
response, err := api.sling.New().Post(path).BodyJSON(params).Receive(&data, &failed)
if err != nil {
return nil, err
Expand Down

0 comments on commit 990cf05

Please sign in to comment.