open-nomad/api
Luiz Aoqui 3f1ea9da4b
api: set last index and request time on alloc stop (#16319)
Some of the methods in `Allocations()` incorrectly use the `putQuery`
in API calls where `put` is more appropriate since they are not reading
information back. These methods are also not returning request metadata
such as `LastIndex` back to callers, which can be useful to have in some
scenarios.

They also provide poor developer experience as they take an
`*api.Allocation` struct when only the allocation ID is necessary. This
can lead consumers to make unnecessary API calls to fetch the full
allocation.

Fixing these problems require updating the methods' signatures so they
take `*WriteOptions` instead of `*QueryOptions` and return `*WriteMeta`,
but this is a breaking change that requires advanced notice to consumers.

This commit adds a future breaking change notice and also fixes the
`Stop` method so it properly returns request metadata in a backwards
compatible way.
2023-03-03 15:52:41 -05:00
..
contexts rename SecureVariables to Variables throughout 2022-08-26 16:06:24 -04:00
internal/testutil deps: update shoenig/test to v0.6.0 (#15715) 2023-01-09 09:37:08 -06:00
acl.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
acl_test.go acl: add validation to binding rule selector on upsert. (#16210) 2023-02-17 15:38:55 +01:00
agent.go api: add new test case for force-leave (#16260) 2023-03-03 10:38:40 -05:00
agent_test.go api: add new test case for force-leave (#16260) 2023-03-03 10:38:40 -05:00
allocations.go api: set last index and request time on alloc stop (#16319) 2023-03-03 15:52:41 -05:00
allocations_exec.go cleanup: prevent leaks from time.After 2022-02-02 14:32:26 -06:00
allocations_test.go api: set last index and request time on alloc stop (#16319) 2023-03-03 15:52:41 -05:00
api.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
api_test.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
compose_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
constraint.go Tag Job spec with HCLv2 tags 2020-10-21 14:05:46 -04:00
constraint_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
consul.go Rename fields on proxyConfig (#15541) 2023-01-30 09:31:16 -06:00
consul_test.go Rename fields on proxyConfig (#15541) 2023-01-30 09:31:16 -06:00
csi.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
csi_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
deployments.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
evaluations.go eval delete: move batching of deletes into RPC handler and state (#15117) 2022-11-14 14:08:13 -05:00
evaluations_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
event_stream.go api: add convenience string func to Topic type. (#14843) 2022-10-19 14:12:23 +02:00
event_stream_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
fs.go Return buffered text from log endpoint if decoding fails (#15558) 2023-01-16 10:39:56 +01:00
fs_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
go.mod build(deps): bump github.com/shoenig/test from 0.6.0 to 0.6.1 in /api (#15939) 2023-01-29 14:03:56 -06:00
go.sum build(deps): bump github.com/shoenig/test from 0.6.0 to 0.6.1 in /api (#15939) 2023-01-29 14:03:56 -06:00
ioutil.go api: use errors.New not fmt.Errorf when error doesn't have format. (#14027) 2022-08-05 17:05:47 +02:00
ioutil_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
jobs.go Allow configurable range of Job priorities (#16084) 2023-02-17 09:23:13 -05:00
jobs_test.go handle `FSM.Apply` errors in `raftApply` (#16287) 2023-03-02 13:51:09 -05:00
keyring.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
keyring_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
namespace.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
namespace_test.go api: make api tests fast and more concurrency safe (#15543) 2022-12-16 12:25:28 -06:00
node_meta.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
node_meta_test.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
nodes.go api: add new test case for force-leave (#16260) 2023-03-03 10:38:40 -05:00
nodes_test.go handle `FSM.Apply` errors in `raftApply` (#16287) 2023-03-02 13:51:09 -05:00
operator.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
operator_autopilot.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
operator_ent_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
operator_metrics.go Metrics gotemplate support, debug bundle features (#9067) 2020-10-14 15:16:10 -04:00
operator_metrics_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
operator_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
quota.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
quota_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
raw.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
recommendations.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
regions.go cli: ensure `-stale` flag is respected by `nomad operator debug` (#11678) 2021-12-15 10:44:03 -05:00
regions_test.go api: cleanup use of deprecated waiter functions (#15608) 2022-12-22 08:21:00 -06:00
resources.go api: remove `mapstructure` tags from`Port` struct (#12916) 2022-11-08 11:26:28 +01:00
resources_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
scaling.go cleanup: replace TypeToPtr helper methods with pointer.Of (#14151) 2022-08-17 18:26:34 +02:00
scaling_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
search.go api: implement fuzzy search API 2021-04-16 16:36:07 -06:00
search_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
sentinel.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
sentinel_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
services.go cleanup: replace TypeToPtr helper methods with pointer.Of (#14151) 2022-08-17 18:26:34 +02:00
services_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
status.go display server leaders per region 2016-03-17 16:04:09 -07:00
status_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
system.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
system_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
tasks.go Add option to expose workload token to task (#15755) 2023-02-02 10:59:14 -08:00
tasks_test.go renamed stanza to block for consistency with other projects (#15941) 2023-01-30 15:48:43 +01:00
util_test.go api: make api tests fast and more concurrency safe (#15543) 2022-12-16 12:25:28 -06:00
utils.go cleanup: replace TypeToPtr helper methods with pointer.Of (#14151) 2022-08-17 18:26:34 +02:00
utils_test.go api: purge testify and pretty dependencies (#15627) 2023-01-01 12:57:26 -06:00
variables.go api: fix a panic and tweak some exported types (#16237) 2023-02-22 08:17:22 -06:00
variables_test.go api: fix a panic and tweak some exported types (#16237) 2023-02-22 08:17:22 -06:00