Commit 1a54a0b8 authored by Mahmood Ali's avatar Mahmood Ali
Browse files

divest /api from nomad/structs

The API package needs to be independent from rest of nomad packages, to
avoid leaking internal packages and dependencies (e.g. raft, ugorji,
etc)
Showing with 14 additions and 4 deletions
+14 -4
......@@ -4,8 +4,6 @@ import (
"fmt"
"sort"
"time"
"github.com/hashicorp/nomad/nomad/structs"
)
var (
......@@ -111,13 +109,13 @@ func (a *Allocations) Signal(alloc *Allocation, q *QueryOptions, task, signal st
return err
}
req := structs.AllocSignalRequest{
req := AllocSignalRequest{
AllocID: alloc.ID,
Signal: signal,
Task: task,
}
var resp structs.GenericResponse
var resp GenericResponse
_, err = nodeClient.putQuery("/v1/client/allocation/"+alloc.ID+"/signal", &req, &resp, q)
return err
}
......@@ -295,6 +293,18 @@ type AllocationRestartRequest struct {
TaskName string
}
type AllocSignalRequest struct {
AllocID string
Task string
Signal string
}
// GenericResponse is used to respond to a request where no
// specific response information is needed.
type GenericResponse struct {
WriteMeta
}
// RescheduleTracker encapsulates previous reschedule events
type RescheduleTracker struct {
Events []*RescheduleEvent
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment