Commit Graph

30 Commits

Author SHA1 Message Date
Chris Baker
59271c668e appease the linter and fix an incorrect test 2021-01-08 19:38:25 +00:00
Chris Baker
9e2eadc7e2 added new policy capabilities for recommendations API
state store: call-out to generic update of job recommendations from job update method
recommendations API work, and http endpoint errors for OSS
support for scaling polices in task block of job spec
add query filters for ScalingPolicy list endpoint
command: nomad scaling policy list: added -job and -type
2020-10-28 14:32:16 +00:00
Michael Schurter
a55f46e9ba api: add field filters to /v1/{allocations,nodes}
Fixes #9017

The ?resources=true query parameter includes resources in the object
stub listings. Specifically:

- For `/v1/nodes?resources=true` both the `NodeResources` and
  `ReservedResources` field are included.
- For `/v1/allocations?resources=true` the `AllocatedResources` field is
  included.

The ?task_states=false query parameter removes TaskStates from
/v1/allocations responses. (By default TaskStates are included.)
2020-10-14 10:35:22 -07:00
Chris Baker
15a66e60a8 fixed api tests for changes 2020-07-04 19:23:58 +00:00
Chris Baker
e831ec3bd5 added new int64ToPtr method to api/util to avoid pulling in other packages 2020-03-24 14:39:05 +00:00
Chris Baker
9292e88f2b changes to Canonicalize, Validate, and api->struct conversion so that tg.Count, tg.Scaling.Min/Max are well-defined with reasonable defaults.
- tg.Count defaults to tg.Scaling.Min if present (falls back on previous default of 1 if Scaling is absent)
- Validate() enforces tg.Scaling.Min <= tg.Count <= tg.Scaling.Max

modification in ApiScalingPolicyToStructs, api.TaskGroup.Validate so that defaults are handled for TaskGroup.Count and
2020-03-24 13:57:17 +00:00
Chris Baker
94381c0da8 wip: added tests for client methods around group scaling 2020-03-24 13:57:11 +00:00
Mahmood Ali
7f027a68ea api: avoid depending on helper internal package 2019-11-12 11:02:33 -05:00
Jasmine Dahilig
c467a94e2b backfill region from job hcl in jobUpdate and jobPlan endpoints
- updated region in job metadata that gets persisted to nomad datastore
- fixed many unrelated unit tests that used an invalid region value
(they previously passed because hcl wasn't getting picked up and
the job would default to global region)
2019-06-13 08:03:16 -07:00
Mahmood Ali
41c3250ee5 api: embed pointer conversion functions
Embed pointer conversion functions in the API package to avoid
unnecessary package dependency.  `helper` package imports more
dependencies relevant for internal use (e.g. `hcl`).
2019-01-18 15:31:04 -05:00
Alex Dadgar
0953d913ed Deprecate IOPS
IOPS have been modelled as a resource since Nomad 0.1 but has never
actually been detected and there is no plan in the short term to add
detection. This is because IOPS is a bit simplistic of a unit to define
the performance requirements from the underlying storage system. In its
current state it adds unnecessary confusion and can be removed without
impacting any users. This PR leaves IOPS defined at the jobspec parsing
level and in the api/ resources since these are the two public uses of
the field. These should be considered deprecated and only exist to allow
users to stop using them during the Nomad 0.9.x release. In the future,
there should be no expectation that the field will exist.
2018-12-06 15:09:26 -08:00
Michael Schurter
07fe87918a test: index no longer guaranteed on job list
Also switch to require and add t.Helper to appropriate funcs.
2018-03-21 16:55:22 -07:00
Alex Dadgar
f6fbb36054 sync 2017-10-13 14:36:02 -07:00
Alex Dadgar
ac1539d5d9 Sync namespace changes 2017-09-07 17:04:21 -07:00
Diptanu Choudhury
f551dcb83e Making the job spec return api.Job 2017-02-16 13:52:39 -08:00
Diptanu Choudhury
396e45629b Renaming LocalDisk to EphemeralDisk (#1710)
Renaming LocalDisk to EphemeralDisk
2016-09-14 15:43:42 -07:00
Diptanu Choudhury
183294644e Fixed api tests 2016-08-25 22:10:25 -05:00
Alex Dadgar
6c32b1ebd8 Validate driver config on job register 2016-04-13 15:55:46 -07:00
Alex Dadgar
73733a8542 Fixes 2016-02-19 15:49:32 -08:00
Diptanu Choudhury
e463682d1d Formatting test 2016-02-12 10:37:34 -08:00
Diptanu Choudhury
ef8032e626 Fixed tests 2016-02-11 17:34:46 -08:00
Diptanu Choudhury
adf86c2f78 Fixing the api tests 2016-02-10 13:36:47 -08:00
Alex Dadgar
95e6a62170 Fix test 2016-02-02 13:27:50 -08:00
Alex Dadgar
94f4b23acb Add force spawn endpoint 2016-01-13 10:19:53 -08:00
Chris Hines
04c7ba69af Remove clock granularity sensitive test assertion.
TestRequestTime already verifies that the request time is properly recorded.
2015-12-14 17:03:08 -05:00
Chris Hines
79f1d76e92 Test request timing with a server slow enough to measure with low granularity system clocks. 2015-12-01 14:53:01 -05:00
Ryan Uber
24cd105200 api: composing jobs takes region 2015-09-16 11:42:08 -07:00
Ryan Uber
39789e478d api: fix tests after struct validations 2015-09-16 11:26:48 -07:00
Ryan Uber
9fea4bf6cb api: more tests for jobs 2015-09-09 17:29:43 -07:00
Ryan Uber
689fa2bb11 api: finishing jobs 2015-09-08 18:42:34 -07:00