Skip to content

Commit 4038910

Browse files
Mpdreamzrusscam
authored andcommitted
2.3 new API's feature parity
This commit adds support for the new 2.3 API's: * tasks_list * tasks_cancel * update_by_query * reindex The spec changes have also been updated in core upstream. The Reindex API is called `ReindexOnServer()` to offset it against our current `Reindex()` implementation which is still very useful. Both the reindex and update_by_query steal the status code from one of the failures and return a valid json body that we need to deserialize. To support this this AllowedStatusCodes now accepts a -1. .IsValid for these API's inspects whether any failures have been returned or not.
1 parent 4a38720 commit 4038910

File tree

5 files changed

+24
-9
lines changed

5 files changed

+24
-9
lines changed

src/CodeGeneration/CodeGeneration.LowLevelClient/ApiEndpoints/tasks.cancel.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"paths": ["/_tasks/_cancel", "/_tasks/{task_id}/_cancel"],
88
"parts": {
99
"task_id": {
10-
"type": "number",
10+
"type": "string",
1111
"description": "Cancel the task with specified id"
1212
}
1313
},
@@ -25,7 +25,7 @@
2525
"description": "Cancel tasks with specified parent node."
2626
},
2727
"parent_task": {
28-
"type" : "number",
28+
"type" : "string",
2929
"description" : "Cancel tasks with specified parent task id. Set to -1 to cancel all."
3030
}
3131
}

src/CodeGeneration/CodeGeneration.LowLevelClient/ApiEndpoints/tasks.list.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"paths": ["/_tasks", "/_tasks/{task_id}"],
88
"parts": {
99
"task_id": {
10-
"type": "number",
10+
"type": "string",
1111
"description": "Return the task with specified id"
1212
}
1313
},
@@ -29,7 +29,7 @@
2929
"description": "Return tasks with specified parent node."
3030
},
3131
"parent_task": {
32-
"type" : "number",
32+
"type" : "string",
3333
"description" : "Return tasks with specified parent task id. Set to -1 to return all."
3434
},
3535
"wait_for_completion": {

src/CodeGeneration/CodeGeneration.LowLevelClient/ApiEndpoints/update_by_query.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"comment": "most things below this are just copied from search.json",
99
"parts": {
1010
"index": {
11+
"required" : true,
1112
"type" : "list",
1213
"description" : "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices"
1314
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System.Collections.Generic;
2+
3+
namespace CodeGeneration.LowLevelClient.Overrides.Descriptors
4+
{
5+
// ReSharper disable once UnusedMember.Global
6+
public class ReindexOnServerDescriptorOverrides : IDescriptorOverrides
7+
{
8+
public IEnumerable<string> SkipQueryStringParams => new []
9+
{
10+
"source"
11+
};
12+
13+
public IDictionary<string, string> RenameQueryStringParams => null;
14+
}
15+
16+
}

src/Tests/tests.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# mode either u (unit test), i (integration test) or m (mixed mode)
2-
mode: i
2+
mode: m
33
# the elasticsearch version that should be started
44
# Can be a snapshot version of sonatype or "latest" to get the latest snapshot of sonatype
5-
elasticsearch_version: 5.2.0
6-
# cluster filter allows you to only run the integration tests of a particular cluster (cluster suffix not needed)
7-
# cluster_filter:
5+
elasticsearch_version: latest
86
# whether we want to forcefully reseed on the node, if you are starting the tests with a node already running
97
force_reseed: true
108
# do not spawn nodes as part of the test setup if we find a node is already running
119
# this is opt in during development in CI we never want to see our tests running against an already running node
12-
test_against_already_running_elasticsearch: false
10+
test_against_already_running_elasticsearch: true

0 commit comments

Comments
 (0)