Skip to content

Commit

Permalink
Merge pull request #5622 from hashicorp/b-divest-api-20190427
Browse files Browse the repository at this point in the history
divest /api from rest of nomad internal packages
  • Loading branch information
Mahmood Ali committed Apr 28, 2019
2 parents 5ae04a4 + 1a54a0b commit 634592e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
3 changes: 3 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ check: ## Lint the source code
@$(MAKE) proto
@if (git status | grep -q .pb.go); then echo the following proto files are out of sync; git status |grep .pb.go; exit 1; fi

@echo "==> Check API package is isolated from rest"
@! go list -f '{{ join .Deps "\n" }}' ./api | grep github.com/hashicorp/nomad/ | grep -v -e /vendor/ -e /nomad/api/

.PHONY: checkscripts
checkscripts: ## Lint shell scripts
@echo "==> Linting scripts..."
Expand Down
18 changes: 14 additions & 4 deletions api/allocations.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"fmt"
"sort"
"time"

"github.com/hashicorp/nomad/nomad/structs"
)

var (
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 634592e

Please sign in to comment.