Skip to content

Commit fee0892

Browse files
Add Autoscaling APIs (#6298) (#6299)
Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
1 parent c148c4d commit fee0892

16 files changed

+726
-0
lines changed

src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ internal static class ApiUrlsLookups
2323
internal static ApiUrls AsyncSearchSubmit = new ApiUrls(new[] { "/_async_search", "/{index}/_async_search" });
2424
internal static ApiUrls AsyncSearchDelete = new ApiUrls(new[] { "/_async_search/{id}" });
2525
internal static ApiUrls AsyncSearchGet = new ApiUrls(new[] { "/_async_search/{id}" });
26+
internal static ApiUrls AutoscalingDeleteAutoscalingPolicy = new ApiUrls(new[] { "/_autoscaling/policy/{name}" });
27+
internal static ApiUrls AutoscalingGetAutoscalingCapacity = new ApiUrls(new[] { "/_autoscaling/capacity" });
28+
internal static ApiUrls AutoscalingGetAutoscalingPolicy = new ApiUrls(new[] { "/_autoscaling/policy/{name}" });
29+
internal static ApiUrls AutoscalingPutAutoscalingPolicy = new ApiUrls(new[] { "/_autoscaling/policy/{name}" });
2630
internal static ApiUrls NoNamespaceBulk = new ApiUrls(new[] { "/_bulk", "/{index}/_bulk" });
2731
internal static ApiUrls CrossClusterReplicationDeleteAutoFollowPattern = new ApiUrls(new[] { "/_ccr/auto_follow/{name}" });
2832
internal static ApiUrls CrossClusterReplicationFollowInfo = new ApiUrls(new[] { "/{index}/_ccr/info" });
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
//
5+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+
// ------------------------------------------------
12+
//
13+
// This file is automatically generated.
14+
// Please do not edit these files manually.
15+
//
16+
// ------------------------------------------------
17+
18+
using Elastic.Transport;
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Linq.Expressions;
22+
using System.Text.Json;
23+
using System.Text.Json.Serialization;
24+
25+
#nullable restore
26+
namespace Elastic.Clients.Elasticsearch.Autoscaling
27+
{
28+
public class AutoscalingDeleteAutoscalingPolicyRequestParameters : RequestParameters<AutoscalingDeleteAutoscalingPolicyRequestParameters>
29+
{
30+
}
31+
32+
public partial class AutoscalingDeleteAutoscalingPolicyRequest : PlainRequestBase<AutoscalingDeleteAutoscalingPolicyRequestParameters>
33+
{
34+
public AutoscalingDeleteAutoscalingPolicyRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name))
35+
{
36+
}
37+
38+
internal override ApiUrls ApiUrls => ApiUrlsLookups.AutoscalingDeleteAutoscalingPolicy;
39+
protected override HttpMethod HttpMethod => HttpMethod.DELETE;
40+
protected override bool SupportsBody => false;
41+
}
42+
43+
public sealed partial class AutoscalingDeleteAutoscalingPolicyRequestDescriptor : RequestDescriptorBase<AutoscalingDeleteAutoscalingPolicyRequestDescriptor, AutoscalingDeleteAutoscalingPolicyRequestParameters>
44+
{
45+
internal AutoscalingDeleteAutoscalingPolicyRequestDescriptor(Action<AutoscalingDeleteAutoscalingPolicyRequestDescriptor> configure) => configure.Invoke(this);
46+
public AutoscalingDeleteAutoscalingPolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name))
47+
{
48+
}
49+
50+
internal AutoscalingDeleteAutoscalingPolicyRequestDescriptor()
51+
{
52+
}
53+
54+
internal override ApiUrls ApiUrls => ApiUrlsLookups.AutoscalingDeleteAutoscalingPolicy;
55+
protected override HttpMethod HttpMethod => HttpMethod.DELETE;
56+
protected override bool SupportsBody => false;
57+
public AutoscalingDeleteAutoscalingPolicyRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name)
58+
{
59+
RouteValues.Required("name", name);
60+
return Self;
61+
}
62+
63+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
64+
{
65+
}
66+
}
67+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
//
5+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+
// ------------------------------------------------
12+
//
13+
// This file is automatically generated.
14+
// Please do not edit these files manually.
15+
//
16+
// ------------------------------------------------
17+
18+
using Elastic.Transport.Products.Elasticsearch;
19+
using System.Collections.Generic;
20+
using System.Text.Json.Serialization;
21+
22+
#nullable restore
23+
namespace Elastic.Clients.Elasticsearch.Autoscaling
24+
{
25+
public partial class AutoscalingDeleteAutoscalingPolicyResponse : ElasticsearchResponseBase
26+
{
27+
[JsonInclude]
28+
[JsonPropertyName("acknowledged")]
29+
public bool Acknowledged { get; init; }
30+
}
31+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
//
5+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+
// ------------------------------------------------
12+
//
13+
// This file is automatically generated.
14+
// Please do not edit these files manually.
15+
//
16+
// ------------------------------------------------
17+
18+
using Elastic.Transport;
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Linq.Expressions;
22+
using System.Text.Json;
23+
using System.Text.Json.Serialization;
24+
25+
#nullable restore
26+
namespace Elastic.Clients.Elasticsearch.Autoscaling
27+
{
28+
public class AutoscalingGetAutoscalingCapacityRequestParameters : RequestParameters<AutoscalingGetAutoscalingCapacityRequestParameters>
29+
{
30+
}
31+
32+
public partial class AutoscalingGetAutoscalingCapacityRequest : PlainRequestBase<AutoscalingGetAutoscalingCapacityRequestParameters>
33+
{
34+
internal override ApiUrls ApiUrls => ApiUrlsLookups.AutoscalingGetAutoscalingCapacity;
35+
protected override HttpMethod HttpMethod => HttpMethod.GET;
36+
protected override bool SupportsBody => false;
37+
}
38+
39+
public sealed partial class AutoscalingGetAutoscalingCapacityRequestDescriptor : RequestDescriptorBase<AutoscalingGetAutoscalingCapacityRequestDescriptor, AutoscalingGetAutoscalingCapacityRequestParameters>
40+
{
41+
internal AutoscalingGetAutoscalingCapacityRequestDescriptor(Action<AutoscalingGetAutoscalingCapacityRequestDescriptor> configure) => configure.Invoke(this);
42+
public AutoscalingGetAutoscalingCapacityRequestDescriptor()
43+
{
44+
}
45+
46+
internal override ApiUrls ApiUrls => ApiUrlsLookups.AutoscalingGetAutoscalingCapacity;
47+
protected override HttpMethod HttpMethod => HttpMethod.GET;
48+
protected override bool SupportsBody => false;
49+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
50+
{
51+
}
52+
}
53+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
//
5+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+
// ------------------------------------------------
12+
//
13+
// This file is automatically generated.
14+
// Please do not edit these files manually.
15+
//
16+
// ------------------------------------------------
17+
18+
using Elastic.Transport.Products.Elasticsearch;
19+
using System.Collections.Generic;
20+
using System.Text.Json.Serialization;
21+
22+
#nullable restore
23+
namespace Elastic.Clients.Elasticsearch.Autoscaling
24+
{
25+
public partial class AutoscalingGetAutoscalingCapacityResponse : ElasticsearchResponseBase
26+
{
27+
[JsonInclude]
28+
[JsonPropertyName("policies")]
29+
public Dictionary<string, Elastic.Clients.Elasticsearch.Autoscaling.AutoscalingDeciders> Policies { get; init; }
30+
}
31+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
//
5+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+
// ------------------------------------------------
12+
//
13+
// This file is automatically generated.
14+
// Please do not edit these files manually.
15+
//
16+
// ------------------------------------------------
17+
18+
using Elastic.Transport;
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Linq.Expressions;
22+
using System.Text.Json;
23+
using System.Text.Json.Serialization;
24+
25+
#nullable restore
26+
namespace Elastic.Clients.Elasticsearch.Autoscaling
27+
{
28+
public class AutoscalingGetAutoscalingPolicyRequestParameters : RequestParameters<AutoscalingGetAutoscalingPolicyRequestParameters>
29+
{
30+
}
31+
32+
public partial class AutoscalingGetAutoscalingPolicyRequest : PlainRequestBase<AutoscalingGetAutoscalingPolicyRequestParameters>
33+
{
34+
public AutoscalingGetAutoscalingPolicyRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name))
35+
{
36+
}
37+
38+
internal override ApiUrls ApiUrls => ApiUrlsLookups.AutoscalingGetAutoscalingPolicy;
39+
protected override HttpMethod HttpMethod => HttpMethod.GET;
40+
protected override bool SupportsBody => false;
41+
}
42+
43+
public sealed partial class AutoscalingGetAutoscalingPolicyRequestDescriptor : RequestDescriptorBase<AutoscalingGetAutoscalingPolicyRequestDescriptor, AutoscalingGetAutoscalingPolicyRequestParameters>
44+
{
45+
internal AutoscalingGetAutoscalingPolicyRequestDescriptor(Action<AutoscalingGetAutoscalingPolicyRequestDescriptor> configure) => configure.Invoke(this);
46+
public AutoscalingGetAutoscalingPolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name))
47+
{
48+
}
49+
50+
internal AutoscalingGetAutoscalingPolicyRequestDescriptor()
51+
{
52+
}
53+
54+
internal override ApiUrls ApiUrls => ApiUrlsLookups.AutoscalingGetAutoscalingPolicy;
55+
protected override HttpMethod HttpMethod => HttpMethod.GET;
56+
protected override bool SupportsBody => false;
57+
public AutoscalingGetAutoscalingPolicyRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name)
58+
{
59+
RouteValues.Required("name", name);
60+
return Self;
61+
}
62+
63+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
64+
{
65+
}
66+
}
67+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
//
5+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+
// ------------------------------------------------
12+
//
13+
// This file is automatically generated.
14+
// Please do not edit these files manually.
15+
//
16+
// ------------------------------------------------
17+
18+
using Elastic.Transport.Products.Elasticsearch;
19+
using System.Collections.Generic;
20+
using System.Text.Json.Serialization;
21+
22+
#nullable restore
23+
namespace Elastic.Clients.Elasticsearch.Autoscaling
24+
{
25+
public partial class AutoscalingGetAutoscalingPolicyResponse : ElasticsearchResponseBase
26+
{
27+
[JsonInclude]
28+
[JsonPropertyName("deciders")]
29+
public Dictionary<string, object> Deciders { get; init; }
30+
31+
[JsonInclude]
32+
[JsonPropertyName("roles")]
33+
public IReadOnlyCollection<string> Roles { get; init; }
34+
}
35+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
//
5+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+
// ------------------------------------------------
12+
//
13+
// This file is automatically generated.
14+
// Please do not edit these files manually.
15+
//
16+
// ------------------------------------------------
17+
18+
using Elastic.Transport;
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Linq.Expressions;
22+
using System.Text.Json;
23+
using System.Text.Json.Serialization;
24+
25+
#nullable restore
26+
namespace Elastic.Clients.Elasticsearch.Autoscaling
27+
{
28+
public class AutoscalingPutAutoscalingPolicyRequestParameters : RequestParameters<AutoscalingPutAutoscalingPolicyRequestParameters>
29+
{
30+
}
31+
32+
public partial class AutoscalingPutAutoscalingPolicyRequest : PlainRequestBase<AutoscalingPutAutoscalingPolicyRequestParameters>
33+
{
34+
public AutoscalingPutAutoscalingPolicyRequest(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name))
35+
{
36+
}
37+
38+
internal override ApiUrls ApiUrls => ApiUrlsLookups.AutoscalingPutAutoscalingPolicy;
39+
protected override HttpMethod HttpMethod => HttpMethod.PUT;
40+
protected override bool SupportsBody => false;
41+
}
42+
43+
public sealed partial class AutoscalingPutAutoscalingPolicyRequestDescriptor : RequestDescriptorBase<AutoscalingPutAutoscalingPolicyRequestDescriptor, AutoscalingPutAutoscalingPolicyRequestParameters>
44+
{
45+
internal AutoscalingPutAutoscalingPolicyRequestDescriptor(Action<AutoscalingPutAutoscalingPolicyRequestDescriptor> configure) => configure.Invoke(this);
46+
public AutoscalingPutAutoscalingPolicyRequestDescriptor(Elastic.Clients.Elasticsearch.Name name) : base(r => r.Required("name", name))
47+
{
48+
}
49+
50+
internal AutoscalingPutAutoscalingPolicyRequestDescriptor()
51+
{
52+
}
53+
54+
internal override ApiUrls ApiUrls => ApiUrlsLookups.AutoscalingPutAutoscalingPolicy;
55+
protected override HttpMethod HttpMethod => HttpMethod.PUT;
56+
protected override bool SupportsBody => false;
57+
public AutoscalingPutAutoscalingPolicyRequestDescriptor Name(Elastic.Clients.Elasticsearch.Name name)
58+
{
59+
RouteValues.Required("name", name);
60+
return Self;
61+
}
62+
63+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
64+
{
65+
}
66+
}
67+
}

0 commit comments

Comments
 (0)