Commit Graph

45 Commits

Author SHA1 Message Date
Gerard Nguyen
1339599185 cli: Add prune flag for nomad server force-leave command (#18463)
This feature will help operator to remove a failed/left node from Serf layer immediately
without waiting for 24 hours for the node to be reaped

* Update CLI with prune flag
* Update API /v1/agent/force-leave with prune query string parameter
* Update CLI and API doc
* Add unit test
2023-09-15 08:45:11 -04:00
hashicorp-copywrite[bot]
f005448366 [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
Dao Thanh Tung
2ec6575675 api: add new test case for force-leave (#16260)
Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg>
2023-03-03 10:38:40 -05:00
Seth Hoenig
9bfd89ccd3 api: purge testify and pretty dependencies (#15627)
* api: swap testify for test (acl)

* api: swap testify for test (agent)

 Please enter the commit message for your changes. Lines starting

* api: swap testify for test (allocations)

* api: swap testify for test (api)

* api: swap testify for test (compose)

* api: swap testify for test (constraint)

* api: swap testify for test (consul)

* api: swap testify for test (csi)

* api: swap testify for test (evaluations)

* api: swap testify for test (event stream)

* api: swap testify for test (fs)

* api: swap testify for test (ioutil)

* api: swap testify for test (jobs)

* api: swap testify for test (keyring)

* api: swap testify for test (operator_ent)

* api: swap testify for test (operator_metrics)

* api: swap testify for test (operator)

* api: swap testify for test (quota)

* api: swap testify for test (resources)

* api: swap testify for test (fix operator_metrics)

* api: swap testify for test (scaling)

* api: swap testify for test (search)

* api: swap testify for test (sentinel)

* api: swap testify for test (services)

* api: swap testify for test (status)

* api: swap testify for test (system)

* api: swap testify for test (tasks)

* api: swap testify for test (utils)

* api: swap testify for test (variables)

* api: remove dependencies on testify and pretty
2023-01-01 12:57:26 -06:00
Seth Hoenig
bb8d2d73c5 api: cleanup use of deprecated waiter functions (#15608) 2022-12-22 08:21:00 -06:00
Seth Hoenig
3695901441 ci: use serial testing for api in CI
This is a followup to running tests in serial in CI.
Since the API package cannot import anything outside of api/,
copy the ci.Parallel function into api/internal/testutil, and
have api tests use that.
2022-03-17 08:35:01 -05:00
Charlie Voiselle
6e61606eba Make number of scheduler workers reloadable (#11593)
## Development Environment Changes
* Added stringer to build deps

## New HTTP APIs
* Added scheduler worker config API
* Added scheduler worker info API

## New Internals
* (Scheduler)Worker API refactor—Start(), Stop(), Pause(), Resume()
* Update shutdown to use context
* Add mutex for contended server data
    - `workerLock` for the `workers` slice
    - `workerConfigLock` for the `Server.Config.NumSchedulers` and
      `Server.Config.EnabledSchedulers` values

## Other
* Adding docs for scheduler worker api
* Add changelog message

Co-authored-by: Derek Strickland <1111455+DerekStrickland@users.noreply.github.com>
2022-01-06 11:56:13 -05:00
Drew Bailey
2dbcad3f45 fix tests, update changelog 2020-01-29 13:55:39 -05:00
Drew Bailey
a58b8a5e9c refactor api profile methods
comment why we ignore errors parsing params
2020-01-09 15:15:12 -05:00
Drew Bailey
ad86438fc0 adds qc param, address pr feedback 2020-01-09 15:15:11 -05:00
Drew Bailey
328075591f region forwarding; prevent recursive forwards for impossible requests
prevent region forwarding loop, backfill tests

fix failing test
2020-01-09 15:15:06 -05:00
Drew Bailey
b0410a4792 api agent endpoints
helper func to return serverPart based off of serverID
2020-01-09 15:15:05 -05:00
Drew Bailey
f74bd99b2a monitor command takes no args
rm extra new line

fix lint errors

return after close

fix, simplify test
2019-11-05 09:51:55 -05:00
Drew Bailey
9a96c10d4c moving endpoints over to frames 2019-11-05 09:51:54 -05:00
Drew Bailey
58117c03c4 fix deadlock issue, switch to frames envelope 2019-11-05 09:51:54 -05:00
Drew Bailey
6bf8617d02 rename function, initialize log level better
underscores instead of dashes for query params
2019-11-05 09:51:53 -05:00
Drew Bailey
1176fc0227 address feedback, use agent_endpoint instead of monitor 2019-11-05 09:51:53 -05:00
Drew Bailey
cd60628b31 rpc acl tests for both monitor endpoints 2019-11-05 09:51:51 -05:00
Drew Bailey
735530ca4f client monitor endpoint tests 2019-11-05 09:51:50 -05:00
Drew Bailey
2362008e74 new hclog with standardlogger intercept 2019-11-05 09:51:49 -05:00
Drew Bailey
e7589301ea enable json formatting, use queryoptions 2019-11-05 09:51:49 -05:00
Drew Bailey
890b8a43fb get local rpc endpoint working 2019-11-05 09:51:48 -05:00
Drew Bailey
12819975ee remove log_writer
prefix output with proper spacing

update gzip handler, adjust first byte flow to allow gzip handler bypass

wip, first stab at wiring up rpc endpoint
2019-11-05 09:51:48 -05:00
Drew Bailey
dc3286481a Add Agent Monitor to receive streaming logs
Queries /v1/agent/monitor and receives streaming logs from client
2019-11-05 09:51:47 -05:00
Jeff Mitchell
5676986196 Divest api/ package of deps elsewhere in the nomad repo. (#5488)
* Divest api/ package of deps elsewhere in the nomad repo.

This will allow making api/ a module without then pulling in the
external repo, leading to a package name conflict.

This required some migration of tests to an apitests/ folder (can be
moved anywhere as it has no deps on it). It also required some
duplication of code, notably some test helpers from api/ -> apitests/
and part (but not all) of testutil/ -> api/testutil/.

Once there's more separation and an e.g. sdk/ folder those can be
removed in favor of a dep on the sdk/ folder, provided the sdk/ folder
doesn't depend on api/ or /.

* Also remove consul dep from api/ package

* Fix stupid linters

* Some restructuring
2019-03-29 14:47:40 -04:00
Michael Schurter
8da7335c16 non-Existent -> nonexistent
Reverting from #3963

https://www.merriam-webster.com/dictionary/existent
2018-03-12 11:59:33 -07:00
Josh Soref
127dd82fc8 spelling: expected 2018-03-11 17:57:01 +00:00
Josh Soref
ac40c42533 spelling: existent 2018-03-11 18:30:37 +00:00
Michael Schurter
0932f1f786 Add Agent.Health to api package 2017-10-13 16:43:00 -07:00
Alex Dadgar
a9e3a41407 Enable more linters 2017-09-26 15:26:33 -07:00
Alex Dadgar
a56f67b76d Parallel 2017-07-21 16:33:04 -07:00
Ben Barnard
350934f03b Return AgentSelf struct from Agent.Self() instead of map
api.AgentSelf mirrors command.agent.agentSelf, and makes it easier to
work with the results of a call to Agent.Self()
2017-03-08 15:59:10 +01:00
Diptanu Choudhury
47a20f8ec1 Fixed a test 2016-11-08 15:48:47 -08:00
Sean Chittenden
681a7d6930 Remove testing for an API that doesn't exist any more. 2016-06-10 15:50:11 -04:00
Jake Champlin
fed8184da1 Updates from comments, fix tests 2016-01-28 23:11:13 -05:00
Gregory Man
09513e0147 Sort server-members output using name and tags 2015-10-23 21:33:18 +03:00
Ryan Uber
e6a3b4ec4f api: add client server methods 2015-09-24 21:17:33 -07:00
Ryan Uber
843a99d5d5 api: fix agent test 2015-09-14 13:24:03 -07:00
Ryan Uber
8301dd0405 api: return the number of nodes joined 2015-09-14 13:24:03 -07:00
Ryan Uber
6ff44fa0c4 api: finish agent endpoint 2015-09-08 14:47:29 -07:00
Ryan Uber
9dd408f2c6 api: agent join api works 2015-09-08 14:26:53 -07:00
Ryan Uber
f6f1813aa1 api: region is queryable, optimize agent caching 2015-09-08 12:13:39 -07:00
Ryan Uber
e28fc33700 api: datacenter is cached and queryable 2015-09-08 12:01:54 -07:00
Ryan Uber
68a8a47634 api: allow querying node name from agent 2015-09-08 11:51:20 -07:00
Ryan Uber
e0f9556590 api: add agent self call 2015-09-08 11:41:03 -07:00