-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[7.x] Optimistic concurrency control for updating ingest pipelines (#…
- Loading branch information
1 parent
171ae21
commit 8ebc800
Showing
9 changed files
with
561 additions
and
12 deletions.
There are no files selected for viewing
177 changes: 177 additions & 0 deletions
177
...gest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/290_versioned_update.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
--- | ||
"Test pipeline versioned updates": | ||
- skip: | ||
version: " - 7.15.99" | ||
reason: "added versioned updates in 7.16.0" | ||
|
||
- do: | ||
ingest.put_pipeline: | ||
id: "my_pipeline" | ||
body: > | ||
{ | ||
"description": "_description", | ||
"processors": [ | ||
{ | ||
"set" : { | ||
"field" : "field2", | ||
"value": "_value" | ||
} | ||
} | ||
] | ||
} | ||
- match: { acknowledged: true } | ||
|
||
# conditional update fails because of missing version | ||
- do: | ||
catch: bad_request | ||
ingest.put_pipeline: | ||
id: "my_pipeline" | ||
if_version: 1 | ||
body: > | ||
{ | ||
"description": "_description", | ||
"processors": [ | ||
{ | ||
"set" : { | ||
"field" : "field2", | ||
"value": "_value" | ||
} | ||
} | ||
] | ||
} | ||
- do: | ||
ingest.put_pipeline: | ||
id: "my_pipeline" | ||
body: > | ||
{ | ||
"description": "_description", | ||
"version": 1, | ||
"processors": [ | ||
{ | ||
"set" : { | ||
"field" : "field2", | ||
"value": "_value" | ||
} | ||
} | ||
] | ||
} | ||
- match: { acknowledged: true } | ||
|
||
- do: | ||
ingest.get_pipeline: | ||
id: "my_pipeline" | ||
- match: { my_pipeline.version: 1 } | ||
|
||
# required version does not match specified version | ||
- do: | ||
catch: bad_request | ||
ingest.put_pipeline: | ||
id: "my_pipeline" | ||
if_version: 99 | ||
body: > | ||
{ | ||
"description": "_description", | ||
"processors": [ | ||
{ | ||
"set" : { | ||
"field" : "field2", | ||
"value": "_value" | ||
} | ||
} | ||
] | ||
} | ||
# may not update to same version | ||
- do: | ||
catch: bad_request | ||
ingest.put_pipeline: | ||
id: "my_pipeline" | ||
if_version: 1 | ||
body: > | ||
{ | ||
"version": 1, | ||
"description": "_description", | ||
"processors": [ | ||
{ | ||
"set" : { | ||
"field" : "field2", | ||
"value": "_value" | ||
} | ||
} | ||
] | ||
} | ||
# cannot conditionally update non-existent pipeline | ||
- do: | ||
catch: bad_request | ||
ingest.put_pipeline: | ||
id: "my_pipeline2" | ||
if_version: 1 | ||
body: > | ||
{ | ||
"version": 1, | ||
"description": "_description", | ||
"processors": [ | ||
{ | ||
"set" : { | ||
"field" : "field2", | ||
"value": "_value" | ||
} | ||
} | ||
] | ||
} | ||
# conditionally update to specified version | ||
- do: | ||
ingest.put_pipeline: | ||
id: "my_pipeline" | ||
if_version: 1 | ||
body: > | ||
{ | ||
"version": 99, | ||
"description": "_description", | ||
"processors": [ | ||
{ | ||
"set" : { | ||
"field" : "field2", | ||
"value": "_value" | ||
} | ||
} | ||
] | ||
} | ||
- match: { acknowledged: true } | ||
|
||
- do: | ||
ingest.get_pipeline: | ||
id: "my_pipeline" | ||
- match: { my_pipeline.version: 99 } | ||
|
||
# conditionally update without specified version | ||
- do: | ||
ingest.put_pipeline: | ||
id: "my_pipeline" | ||
if_version: 99 | ||
body: > | ||
{ | ||
"description": "_description", | ||
"processors": [ | ||
{ | ||
"set" : { | ||
"field" : "field2", | ||
"value": "_value" | ||
} | ||
} | ||
] | ||
} | ||
- match: { acknowledged: true } | ||
|
||
- do: | ||
ingest.get_pipeline: | ||
id: "my_pipeline" | ||
- match: { my_pipeline.version: 100 } | ||
|
||
- do: | ||
ingest.delete_pipeline: | ||
id: "my_pipeline" | ||
- match: { acknowledged: true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.