Skip to content

Commit 5617675

Browse files
Mpdreamzrusscam
authored andcommitted
5.5 (#2807)
* Code generation of elasticsearch's 5.5 branch * Update existing XPack API spec files * Add ml xpack api spec and new security endpoints * Add CRUD support for the new role mapping security API's * Add support for security token API's * fix failing codestandards tests after implementing xpack security 5.5 new features * fix overal bg_count now gets returned for sig_terms * fix stats matrix now also returns overal doc_count * fix change in GetAlias behavior, since 5.5 now returns 404 when some aliases suplied are not found * Sampler agg test for bg count should only be asserted 5.5.0 and up * Array.Empty not available for .NET 4.5 * Add force + operation_threading to RefreshRequest Removed in REST API spec elastic/elasticsearch#25234 - patched in to maintain binary compatibility * Set tests.default.yaml ES version to 5.5.0 * Update XML comments for LazyDocument * Minor language tweaks * Fix spelling * update SkipVersion for PutRoleMapping to <5.5.0
1 parent bef4b9d commit 5617675

File tree

132 files changed

+20565
-16723
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+20565
-16723
lines changed

build/Clients.Common.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<Prefer32Bit>false</Prefer32Bit>
2929
<DefineConstants Condition="'$(TargetFramework)'=='netstandard1.3' OR '$(DotNetCoreOnly)'=='1'">$(DefineConstants);DOTNETCORE</DefineConstants>
3030
<DebugType Condition="'$(DotNetCoreOnly)'==''">embedded</DebugType>
31+
<DebugType Condition="'$(Configuration)'=='Debug'">full</DebugType>
3132
<SourceLink Condition="'$(DoSourceLink)'!=''">$(BaseIntermediateOutputPath)\sl-$(MsBuildProjectName)-$(TargetFramework).json</SourceLink>
3233
<RepoUri>https://raw.githubusercontent.com/elastic/elasticsearch-net</RepoUri>
3334
</PropertyGroup>

src/CodeGeneration/ApiGenerator/ApiGenerator.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
</ItemGroup>
1616
<ItemGroup>
1717
<Folder Include="RestSpecification\XPack\Info" />
18+
<Folder Include="RestSpecification\XPack\MachineLearning" />
1819
</ItemGroup>
1920
</Project>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using ApiGenerator.Domain;
2+
3+
namespace ApiGenerator.Overrides.Descriptors
4+
{
5+
public class RefreshDescriptorOverrides : DescriptorOverridesBase
6+
{
7+
public override CsharpMethod PatchMethod(CsharpMethod method)
8+
{
9+
method.Url.Params.Add("force", new NoopApiQueryParameters() { Type = "boolean" });
10+
method.Url.Params.Add("operation_threading", new NoopApiQueryParameters());
11+
return method;
12+
}
13+
14+
private class NoopApiQueryParameters : ApiQueryParameters
15+
{
16+
public NoopApiQueryParameters()
17+
{
18+
this.Obsolete = "calling this is a noop";
19+
this.FluentGenerator = (queryStringParamName, mm, original, setter) => $"public {queryStringParamName} {mm.ToPascalCase()}({CsharpType(mm)} {mm}) => this;";
20+
}
21+
}
22+
}
23+
}

src/CodeGeneration/ApiGenerator/RestSpecification/Core/exists_source.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"exists_source": {
3-
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html",
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-get.html",
44
"methods": ["HEAD"],
55
"url": {
66
"path": "/{index}/{type}/{id}/_source",

src/CodeGeneration/ApiGenerator/RestSpecification/Core/field_caps.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"field_caps": {
3-
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html",
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-field-caps.html",
44
"methods": ["GET", "POST"],
55
"url": {
66
"path": "/_field_caps",

src/CodeGeneration/ApiGenerator/RestSpecification/Core/indices.refresh.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@
2525
"options" : ["open","closed","none","all"],
2626
"default" : "open",
2727
"description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both."
28-
},
29-
"force": {
30-
"type" : "boolean",
31-
"description" : "Force a refresh even if not required",
32-
"default": false
33-
},
34-
"operation_threading": {
35-
"description" : "TODO: ?"
3628
}
3729
}
3830
},

src/CodeGeneration/ApiGenerator/RestSpecification/Core/msearch_template.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
"typed_keys": {
2525
"type" : "boolean",
2626
"description" : "Specify whether aggregation and suggester names should be prefixed by their respective types in the response"
27+
},
28+
"max_concurrent_searches" : {
29+
"type" : "number",
30+
"description" : "Controls the maximum number of concurrent searches the multi search api will execute"
2731
}
2832
}
2933
},

src/CodeGeneration/ApiGenerator/RestSpecification/Core/remote.info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"remote.info": {
3-
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/remote-info.html",
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-remote-info.html",
44
"methods": ["GET"],
55
"url": {
66
"path": "/_remote/info",

src/CodeGeneration/ApiGenerator/RestSpecification/Core/root.html

Lines changed: 347 additions & 319 deletions
Large diffs are not rendered by default.

src/CodeGeneration/ApiGenerator/RestSpecification/Core/snapshot.get.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
"ignore_unavailable": {
2626
"type": "boolean",
2727
"description": "Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown"
28+
},
29+
"verbose": {
30+
"type": "boolean",
31+
"description": "Whether to show verbose snapshot info or only show the basic info found in the repository index blob"
2832
}
2933
}
3034
},

src/CodeGeneration/ApiGenerator/RestSpecification/XPack/Info/xpack.info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"xpack.info": {
3-
"documentation": "Retrieve information about xpack, including build number/timestamp and license status",
3+
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html",
44
"methods": [ "GET" ],
55
"url": {
66
"path": "/_xpack",
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"xpack.ml.close_job": {
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html",
4+
"methods": [ "POST" ],
5+
"url": {
6+
"path": "/_xpack/ml/anomaly_detectors/{job_id}/_close",
7+
"paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/_close" ],
8+
"parts": {
9+
"job_id": {
10+
"type": "string",
11+
"required": true,
12+
"description": "The name of the job to close"
13+
}
14+
},
15+
"params": {
16+
"force": {
17+
"type": "boolean",
18+
"required": false,
19+
"description": "True if the job should be forcefully closed"
20+
},
21+
"timeout": {
22+
"type": "time",
23+
"description": "Controls the time to wait until a job has closed. Default to 30 minutes"
24+
}
25+
}
26+
}
27+
}
28+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"xpack.ml.delete_datafeed": {
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html",
4+
"methods": [ "DELETE" ],
5+
"url": {
6+
"path": "/_xpack/ml/datafeeds/{datafeed_id}",
7+
"paths": [ "/_xpack/ml/datafeeds/{datafeed_id}" ],
8+
"parts": {
9+
"datafeed_id": {
10+
"type": "string",
11+
"required": true,
12+
"description": "The ID of the datafeed to delete"
13+
}
14+
},
15+
"params": {
16+
"force": {
17+
"type": "boolean",
18+
"required": false,
19+
"description": "True if the datafeed should be forcefully deleted"
20+
}
21+
}
22+
},
23+
"body": null
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"xpack.ml.delete_expired_data": {
3+
"methods": [ "DELETE" ],
4+
"url": {
5+
"path": "/_xpack/ml/_delete_expired_data",
6+
"paths": [ "/_xpack/ml/_delete_expired_data" ],
7+
"parts": {}
8+
},
9+
"body": null
10+
}
11+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"xpack.ml.delete_filter": {
3+
"methods": [ "DELETE" ],
4+
"url": {
5+
"path": "/_xpack/ml/filters/{filter_id}",
6+
"paths": [ "/_xpack/ml/filters/{filter_id}" ],
7+
"parts": {
8+
"filter_id": {
9+
"type" : "string",
10+
"required" : true,
11+
"description" : "The ID of the filter to delete"
12+
}
13+
}
14+
},
15+
"body": null
16+
}
17+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"xpack.ml.delete_job": {
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html",
4+
"methods": [ "DELETE" ],
5+
"url": {
6+
"path": "/_xpack/ml/anomaly_detectors/{job_id}",
7+
"paths": [ "/_xpack/ml/anomaly_detectors/{job_id}" ],
8+
"parts": {
9+
"job_id": {
10+
"type": "string",
11+
"required": true,
12+
"description": "The ID of the job to delete"
13+
}
14+
},
15+
"params": {
16+
"force": {
17+
"type": "boolean",
18+
"required": false,
19+
"description": "True if the job should be forcefully deleted"
20+
}
21+
}
22+
},
23+
"body": null
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"xpack.ml.delete_model_snapshot": {
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html",
4+
"methods": [ "DELETE" ],
5+
"url": {
6+
"path": "/_xpack/ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}",
7+
"paths": [ "/_xpack/ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}" ],
8+
"parts": {
9+
"job_id": {
10+
"type": "string",
11+
"required": true,
12+
"description": "The ID of the job to fetch"
13+
},
14+
"snapshot_id": {
15+
"type": "string",
16+
"required": true,
17+
"description": "The ID of the snapshot to delete"
18+
}
19+
}
20+
},
21+
"body": null
22+
}
23+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"xpack.ml.flush_job": {
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html",
4+
"methods": [
5+
"POST"
6+
],
7+
"url": {
8+
"path": "/_xpack/ml/anomaly_detectors/{job_id}/_flush",
9+
"paths": [
10+
"/_xpack/ml/anomaly_detectors/{job_id}/_flush"
11+
],
12+
"parts": {
13+
"job_id": {
14+
"type": "string",
15+
"required": true,
16+
"description": "The name of the job to flush"
17+
}
18+
},
19+
"params": {
20+
"calc_interim": {
21+
"type": "boolean",
22+
"description": "Calculates interim results for the most recent bucket or all buckets within the latency period"
23+
},
24+
"start": {
25+
"type": "string",
26+
"description": "When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results"
27+
},
28+
"end": {
29+
"type": "string",
30+
"description": "When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results"
31+
},
32+
"advance_time": {
33+
"type": "string",
34+
"description": "Setting this tells the Engine API that no data prior to advance_time is expected"
35+
}
36+
}
37+
},
38+
"body": {
39+
"description": "Flush parameters"
40+
}
41+
}
42+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"xpack.ml.get_buckets": {
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html",
4+
"methods": [ "GET", "POST" ],
5+
"url": {
6+
"path": "/_xpack/ml/anomaly_detectors/{job_id}/results/buckets/{timestamp}",
7+
"paths": [
8+
"/_xpack/ml/anomaly_detectors/{job_id}/results/buckets/{timestamp}",
9+
"/_xpack/ml/anomaly_detectors/{job_id}/results/buckets"
10+
],
11+
"parts": {
12+
"job_id": {
13+
"type" : "string",
14+
"required": true,
15+
"description": "ID of the job to get bucket results from"
16+
},
17+
"timestamp": {
18+
"type" : "string",
19+
"description" : "The timestamp of the desired single bucket result"
20+
}
21+
},
22+
"params": {
23+
"expand": {
24+
"type": "boolean",
25+
"description" : "Include anomaly records"
26+
},
27+
"exclude_interim": {
28+
"type": "boolean",
29+
"description" : "Exclude interim results"
30+
},
31+
"from": {
32+
"type": "int",
33+
"description": "skips a number of buckets"
34+
},
35+
"size": {
36+
"type": "int",
37+
"description": "specifies a max number of buckets to get"
38+
},
39+
"start": {
40+
"type": "string",
41+
"description" : "Start time filter for buckets"
42+
},
43+
"end": {
44+
"type": "string",
45+
"description" : "End time filter for buckets"
46+
},
47+
"anomaly_score": {
48+
"type": "double",
49+
"description": "Filter for the most anomalous buckets"
50+
},
51+
"sort": {
52+
"type": "string",
53+
"description": "Sort buckets by a particular field"
54+
},
55+
"desc": {
56+
"type": "boolean",
57+
"description": "Set the sort direction"
58+
}
59+
}
60+
},
61+
"body": {
62+
"description" : "Bucket selection details if not provided in URI"
63+
}
64+
}
65+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"xpack.ml.get_categories": {
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html",
4+
"methods": [ "GET", "POST" ],
5+
"url": {
6+
"path": "/_xpack/ml/anomaly_detectors/{job_id}/results/categories/{category_id}",
7+
"paths": [
8+
"/_xpack/ml/anomaly_detectors/{job_id}/results/categories/{category_id}",
9+
"/_xpack/ml/anomaly_detectors/{job_id}/results/categories/"
10+
],
11+
"parts": {
12+
"job_id": {
13+
"type" : "string",
14+
"required": true,
15+
"description": "The name of the job"
16+
},
17+
"category_id": {
18+
"type" : "long",
19+
"description" : "The identifier of the category definition of interest"
20+
}
21+
},
22+
"params": {
23+
"from": {
24+
"type": "int",
25+
"description": "skips a number of categories"
26+
},
27+
"size": {
28+
"type": "int",
29+
"description": "specifies a max number of categories to get"
30+
}
31+
}
32+
},
33+
"body": {
34+
"description" : "Category selection details if not provided in URI"
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)