Skip to content

Commit c876a43

Browse files
committed
Merge branch 'master' of github.com:elastic/elasticsearch-net
2 parents 36d9210 + 824fbb1 commit c876a43

File tree

60 files changed

+1728
-36
lines changed

Some content is hidden

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

60 files changed

+1728
-36
lines changed

build/scripts/scripts.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
<Content Include="..\..\azure-pipelines.yml"><Link>azure-pipelines.yml</Link></Content>
3131
</ItemGroup>
3232
<ItemGroup>
33-
<PackageReference Include="Bullseye" Version="3.0.0-rc.1" />
34-
<PackageReference Include="Elastic.Managed" Version="0.1.0-ci20190927T121631" />
33+
<PackageReference Include="Bullseye" Version="3.0.0" />
34+
<PackageReference Include="Elastic.Managed" Version="0.1.0-ci20191011T011411" />
3535
<PackageReference Include="Fake.Core.Environment" Version="5.15.0" />
3636
<PackageReference Include="Fake.Core.SemVer" Version="5.15.0" />
3737
<PackageReference Include="Fake.IO.FileSystem" Version="5.15.0" />

docs/aggregations/bucket/histogram/histogram-aggregation-usage.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ a => a
2323
.Histogram("commits", h => h
2424
.Field(p => p.NumberOfCommits)
2525
.Interval(100)
26-
.Missing(0)
26+
.MinimumDocumentCount(1)
2727
.Order(HistogramOrder.KeyDescending)
2828
.Offset(1.1)
2929
)
@@ -37,7 +37,7 @@ new HistogramAggregation("commits")
3737
{
3838
Field = Field<Project>(p => p.NumberOfCommits),
3939
Interval = 100,
40-
Missing = 0,
40+
MinimumDocumentCount = 1,
4141
Order = HistogramOrder.KeyDescending,
4242
Offset = 1.1
4343
}
@@ -51,7 +51,7 @@ new HistogramAggregation("commits")
5151
"histogram": {
5252
"field": "numberOfCommits",
5353
"interval": 100.0,
54-
"missing": 0.0,
54+
"min_doc_count": 1,
5555
"order": {
5656
"_key": "desc"
5757
},

src/CodeGeneration/ApiGenerator/Configuration/CodeConfiguration.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ public static class CodeConfiguration
4545
"monitoring.bulk.json",
4646
"snapshot.cleanup_repository.json",
4747
"ml.estimate_memory_usage.json",
48-
"indices.clone.json",
49-
50-
"slm.delete_lifecycle.json",
51-
"slm.execute_lifecycle.json",
52-
"slm.get_lifecycle.json",
53-
"slm.put_lifecycle.json",
5448
};
5549

5650

src/CodeGeneration/ApiGenerator/Domain/Code/CsharpNames.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ private static string CreateCSharpNamespace(string endpointNamespace)
8888
case "ccr": return "CrossClusterReplication";
8989
case "ml": return "MachineLearning";
9090
case "xpack": return "XPack";
91+
case "slm": return "SnapshotLifecycleManagement";
9192
default: return endpointNamespace.ToPascalCase();
9293
}
9394
}

src/CodeGeneration/ApiGenerator/Domain/Specification/UrlPart.cs

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,37 +53,39 @@ public string HighLevelTypeName
5353
case "timestamp": return "Timestamp";
5454
case "index_metric": return "IndexMetrics";
5555
case "metric": return "Metrics";
56-
57-
case "node_id" when Type == "list":
56+
57+
case "node_id" when Type == "list":
5858
return "NodeIds";
59-
60-
case "fields" when Type == "list":
59+
60+
case "fields" when Type == "list":
6161
return "Fields";
62-
62+
6363
case "parent_task_id":
64-
case "task_id":
64+
case "task_id":
6565
return "TaskId";
66-
66+
6767
case "forecast_id":
6868
case "action_id":
6969
return "Ids";
70-
70+
7171
case "index":
7272
case "new_index":
73-
case "target":
73+
case "target":
7474
return Type == "string" ? "IndexName" : "Indices";
75-
75+
7676
case "watch_id":
7777
case "job_id":
7878
case "calendar_id":
7979
case "event_id":
8080
case "datafeed_id":
8181
case "snapshot_id":
8282
case "filter_id":
83-
case "policy_id":
84-
case "id":
83+
case "id":
8584
return "Id";
86-
85+
86+
case "policy_id":
87+
return Type == "string" ? "Id" : "Ids";
88+
8789
case "application":
8890
case "repository":
8991
case "snapshot":
@@ -96,8 +98,8 @@ public string HighLevelTypeName
9698
case "thread_pool_patterns":
9799
case "type":
98100
return Type == "string" ? "Name" : "Names";
99-
100-
101+
102+
101103
//This forces a compilation error post code generation as intended
102104
default: return Type + "_";
103105
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"slm.get_lifecycle":{
3+
"url":{
4+
"parts":{
5+
"policy_id":{
6+
"type":"list",
7+
"description":"Comma-separated list of snapshot lifecycle policies to retrieve"
8+
}
9+
}
10+
}
11+
}
12+
}

src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.Indices.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,33 @@ public bool? Request
102102
}
103103
}
104104

105+
///<summary>Request options for Clone <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html</para></summary>
106+
public class CloneIndexRequestParameters : RequestParameters<CloneIndexRequestParameters>
107+
{
108+
public override HttpMethod DefaultHttpMethod => HttpMethod.PUT;
109+
public override bool SupportsBody => true;
110+
///<summary>Specify timeout for connection to master</summary>
111+
public TimeSpan MasterTimeout
112+
{
113+
get => Q<TimeSpan>("master_timeout");
114+
set => Q("master_timeout", value);
115+
}
116+
117+
///<summary>Explicit operation timeout</summary>
118+
public TimeSpan Timeout
119+
{
120+
get => Q<TimeSpan>("timeout");
121+
set => Q("timeout", value);
122+
}
123+
124+
///<summary>Set the number of active shards to wait for on the cloned index before the operation returns.</summary>
125+
public string WaitForActiveShards
126+
{
127+
get => Q<string>("wait_for_active_shards");
128+
set => Q("wait_for_active_shards", value);
129+
}
130+
}
131+
105132
///<summary>Request options for Close <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html</para></summary>
106133
public class CloseIndexRequestParameters : RequestParameters<CloseIndexRequestParameters>
107134
{
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
2+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
3+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
4+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
5+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
6+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
7+
// -----------------------------------------------
8+
//
9+
// This file is automatically generated
10+
// Please do not edit these files manually
11+
// Run the following in the root of the repos:
12+
//
13+
// *NIX : ./build.sh codegen
14+
// Windows : build.bat codegen
15+
//
16+
// -----------------------------------------------
17+
// ReSharper disable RedundantUsingDirective
18+
using System;
19+
using System.Collections.Generic;
20+
using System.Linq;
21+
using System.Text;
22+
using System.Linq.Expressions;
23+
24+
// ReSharper disable once CheckNamespace
25+
namespace Elasticsearch.Net.Specification.SnapshotLifecycleManagementApi
26+
{
27+
///<summary>Request options for DeleteSnapshotLifecycle <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete.html</para></summary>
28+
public class DeleteSnapshotLifecycleRequestParameters : RequestParameters<DeleteSnapshotLifecycleRequestParameters>
29+
{
30+
public override HttpMethod DefaultHttpMethod => HttpMethod.DELETE;
31+
public override bool SupportsBody => false;
32+
}
33+
34+
///<summary>Request options for ExecuteSnapshotLifecycle <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute.html</para></summary>
35+
public class ExecuteSnapshotLifecycleRequestParameters : RequestParameters<ExecuteSnapshotLifecycleRequestParameters>
36+
{
37+
public override HttpMethod DefaultHttpMethod => HttpMethod.PUT;
38+
public override bool SupportsBody => false;
39+
}
40+
41+
///<summary>Request options for GetSnapshotLifecycle <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get.html</para></summary>
42+
public class GetSnapshotLifecycleRequestParameters : RequestParameters<GetSnapshotLifecycleRequestParameters>
43+
{
44+
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
45+
public override bool SupportsBody => false;
46+
}
47+
48+
///<summary>Request options for PutSnapshotLifecycle <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put.html</para></summary>
49+
public class PutSnapshotLifecycleRequestParameters : RequestParameters<PutSnapshotLifecycleRequestParameters>
50+
{
51+
public override HttpMethod DefaultHttpMethod => HttpMethod.PUT;
52+
public override bool SupportsBody => true;
53+
}
54+
}

src/Elasticsearch.Net/ElasticLowLevelClient.Indices.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,20 @@ public TResponse ClearCache<TResponse>(string index, ClearCacheRequestParameters
8383
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
8484
public Task<TResponse> ClearCacheAsync<TResponse>(string index, ClearCacheRequestParameters requestParameters = null, CancellationToken ctx = default)
8585
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, Url($"{index:index}/_cache/clear"), ctx, null, RequestParams(requestParameters));
86+
///<summary>PUT on /{index}/_clone/{target} <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html</para></summary>
87+
///<param name = "index">The name of the source index to clone</param>
88+
///<param name = "target">The name of the target index to clone into</param>
89+
///<param name = "body">The configuration for the target index (`settings` and `aliases`)</param>
90+
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
91+
public TResponse Clone<TResponse>(string index, string target, PostData body, CloneIndexRequestParameters requestParameters = null)
92+
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(PUT, Url($"{index:index}/_clone/{target:target}"), body, RequestParams(requestParameters));
93+
///<summary>PUT on /{index}/_clone/{target} <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html</para></summary>
94+
///<param name = "index">The name of the source index to clone</param>
95+
///<param name = "target">The name of the target index to clone into</param>
96+
///<param name = "body">The configuration for the target index (`settings` and `aliases`)</param>
97+
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
98+
public Task<TResponse> CloneAsync<TResponse>(string index, string target, PostData body, CloneIndexRequestParameters requestParameters = null, CancellationToken ctx = default)
99+
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(PUT, Url($"{index:index}/_clone/{target:target}"), ctx, body, RequestParams(requestParameters));
86100
///<summary>POST on /{index}/_close <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html</para></summary>
87101
///<param name = "index">A comma separated list of indices to close</param>
88102
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>

src/Elasticsearch.Net/ElasticLowLevelClient.NoNamespace.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
using Elasticsearch.Net.Specification.RollupApi;
3838
using Elasticsearch.Net.Specification.SecurityApi;
3939
using Elasticsearch.Net.Specification.SnapshotApi;
40+
using Elasticsearch.Net.Specification.SnapshotLifecycleManagementApi;
4041
using Elasticsearch.Net.Specification.SqlApi;
4142
using Elasticsearch.Net.Specification.TasksApi;
4243
using Elasticsearch.Net.Specification.WatcherApi;
@@ -136,6 +137,12 @@ public LowLevelSnapshotNamespace Snapshot
136137
private set;
137138
}
138139

140+
public LowLevelSnapshotLifecycleManagementNamespace SnapshotLifecycleManagement
141+
{
142+
get;
143+
private set;
144+
}
145+
139146
public LowLevelSqlNamespace Sql
140147
{
141148
get;
@@ -176,6 +183,7 @@ partial void SetupNamespaces()
176183
Rollup = new LowLevelRollupNamespace(this);
177184
Security = new LowLevelSecurityNamespace(this);
178185
Snapshot = new LowLevelSnapshotNamespace(this);
186+
SnapshotLifecycleManagement = new LowLevelSnapshotLifecycleManagementNamespace(this);
179187
Sql = new LowLevelSqlNamespace(this);
180188
Tasks = new LowLevelTasksNamespace(this);
181189
Watcher = new LowLevelWatcherNamespace(this);

0 commit comments

Comments
 (0)