Skip to content

Commit f364fc1

Browse files
github-actions[bot]stevejgordon
andauthoredApr 5, 2023
Add generated task endpoints (#7567) (#7574)
Co-authored-by: Steve Gordon <[email protected]>
1 parent 56ac6e8 commit f364fc1

10 files changed

+953
-1
lines changed
 

‎src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ internal static class ApiUrlLookup
109109
internal static ApiUrls SqlGetAsync = new ApiUrls(new[] { "/_sql/async/{id}" });
110110
internal static ApiUrls SqlGetAsyncStatus = new ApiUrls(new[] { "/_sql/async/status/{id}" });
111111
internal static ApiUrls SqlQuery = new ApiUrls(new[] { "/_sql" });
112+
internal static ApiUrls TasksCancel = new ApiUrls(new[] { "/_tasks/_cancel", "/_tasks/{task_id}/_cancel" });
113+
internal static ApiUrls TasksGet = new ApiUrls(new[] { "/_tasks/{task_id}" });
114+
internal static ApiUrls TasksList = new ApiUrls(new[] { "/_tasks" });
112115
internal static ApiUrls NoNamespaceTermsEnum = new ApiUrls(new[] { "/{index}/_terms_enum" });
113116
internal static ApiUrls NoNamespaceUpdateByQuery = new ApiUrls(new[] { "/{index}/_update_by_query" });
114117
internal static ApiUrls NoNamespaceUpdateByQueryRethrottle = new ApiUrls(new[] { "/_update_by_query/{task_id}/_rethrottle" });
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
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+
#nullable restore
19+
20+
using Elastic.Clients.Elasticsearch.Fluent;
21+
using Elastic.Clients.Elasticsearch.Requests;
22+
using Elastic.Clients.Elasticsearch.Serialization;
23+
using Elastic.Transport;
24+
using System;
25+
using System.Collections.Generic;
26+
using System.Linq.Expressions;
27+
using System.Text.Json;
28+
using System.Text.Json.Serialization;
29+
30+
namespace Elastic.Clients.Elasticsearch.Tasks;
31+
32+
public sealed class CancelRequestParameters : RequestParameters
33+
{
34+
/// <summary>
35+
/// <para>A comma-separated list of actions that should be cancelled. Leave empty to cancel all.</para>
36+
/// </summary>
37+
public ICollection<string>? Actions { get => Q<ICollection<string>?>("actions"); set => Q("actions", value); }
38+
39+
/// <summary>
40+
/// <para>A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes</para>
41+
/// </summary>
42+
public ICollection<string>? Nodes { get => Q<ICollection<string>?>("nodes"); set => Q("nodes", value); }
43+
44+
/// <summary>
45+
/// <para>Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.</para>
46+
/// </summary>
47+
public string? ParentTaskId { get => Q<string?>("parent_task_id"); set => Q("parent_task_id", value); }
48+
49+
/// <summary>
50+
/// <para>Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false</para>
51+
/// </summary>
52+
public bool? WaitForCompletion { get => Q<bool?>("wait_for_completion"); set => Q("wait_for_completion", value); }
53+
}
54+
55+
/// <summary>
56+
/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely.
57+
/// <para>Cancels a task, if it can be cancelled through an API.</para>
58+
/// </summary>
59+
public sealed partial class CancelRequest : PlainRequest<CancelRequestParameters>
60+
{
61+
public CancelRequest()
62+
{
63+
}
64+
65+
public CancelRequest(Elastic.Clients.Elasticsearch.TaskId? task_id) : base(r => r.Optional("task_id", task_id))
66+
{
67+
}
68+
69+
internal override ApiUrls ApiUrls => ApiUrlLookup.TasksCancel;
70+
71+
protected override HttpMethod StaticHttpMethod => HttpMethod.POST;
72+
73+
internal override bool SupportsBody => false;
74+
75+
/// <summary>
76+
/// <para>A comma-separated list of actions that should be cancelled. Leave empty to cancel all.</para>
77+
/// </summary>
78+
[JsonIgnore]
79+
public ICollection<string>? Actions { get => Q<ICollection<string>?>("actions"); set => Q("actions", value); }
80+
81+
/// <summary>
82+
/// <para>A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes</para>
83+
/// </summary>
84+
[JsonIgnore]
85+
public ICollection<string>? Nodes { get => Q<ICollection<string>?>("nodes"); set => Q("nodes", value); }
86+
87+
/// <summary>
88+
/// <para>Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.</para>
89+
/// </summary>
90+
[JsonIgnore]
91+
public string? ParentTaskId { get => Q<string?>("parent_task_id"); set => Q("parent_task_id", value); }
92+
93+
/// <summary>
94+
/// <para>Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false</para>
95+
/// </summary>
96+
[JsonIgnore]
97+
public bool? WaitForCompletion { get => Q<bool?>("wait_for_completion"); set => Q("wait_for_completion", value); }
98+
}
99+
100+
/// <summary>
101+
/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely.
102+
/// <para>Cancels a task, if it can be cancelled through an API.</para>
103+
/// </summary>
104+
public sealed partial class CancelRequestDescriptor : RequestDescriptor<CancelRequestDescriptor, CancelRequestParameters>
105+
{
106+
internal CancelRequestDescriptor(Action<CancelRequestDescriptor> configure) => configure.Invoke(this);
107+
108+
public CancelRequestDescriptor()
109+
{
110+
}
111+
112+
internal override ApiUrls ApiUrls => ApiUrlLookup.TasksCancel;
113+
114+
protected override HttpMethod StaticHttpMethod => HttpMethod.POST;
115+
116+
internal override bool SupportsBody => false;
117+
118+
public CancelRequestDescriptor Actions(ICollection<string>? actions) => Qs("actions", actions);
119+
public CancelRequestDescriptor Nodes(ICollection<string>? nodes) => Qs("nodes", nodes);
120+
public CancelRequestDescriptor ParentTaskId(string? parentTaskId) => Qs("parent_task_id", parentTaskId);
121+
public CancelRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion);
122+
123+
public CancelRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.TaskId? task_id)
124+
{
125+
RouteValues.Optional("task_id", task_id);
126+
return Self;
127+
}
128+
129+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
130+
{
131+
}
132+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
#nullable restore
19+
20+
using Elastic.Clients.Elasticsearch.Fluent;
21+
using Elastic.Clients.Elasticsearch.Serialization;
22+
using Elastic.Transport.Products.Elasticsearch;
23+
using System.Collections.Generic;
24+
using System.Text.Json.Serialization;
25+
26+
namespace Elastic.Clients.Elasticsearch.Tasks;
27+
28+
/// <summary>
29+
/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely.
30+
/// </summary>
31+
public sealed partial class CancelResponse : ElasticsearchResponse
32+
{
33+
[JsonInclude, JsonPropertyName("node_failures")]
34+
public IReadOnlyCollection<Elastic.Clients.Elasticsearch.ErrorCause>? NodeFailures { get; init; }
35+
36+
/// <summary>
37+
/// <para>Task information grouped by node, if `group_by` was set to `node` (the default).</para>
38+
/// </summary>
39+
[JsonInclude, JsonPropertyName("nodes")]
40+
public IReadOnlyDictionary<string, Elastic.Clients.Elasticsearch.Tasks.NodeTasks>? Nodes { get; init; }
41+
[JsonInclude, JsonPropertyName("task_failures")]
42+
public IReadOnlyCollection<Elastic.Clients.Elasticsearch.TaskFailure>? TaskFailures { get; init; }
43+
44+
/// <summary>
45+
/// <para>Either a flat list of tasks if `group_by` was set to `none`, or grouped by parents if<br/>`group_by` was set to `parents`.</para>
46+
/// </summary>
47+
[JsonInclude, JsonPropertyName("tasks")]
48+
public Elastic.Clients.Elasticsearch.Tasks.TaskInfos? Tasks { get; init; }
49+
}
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
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+
#nullable restore
19+
20+
using Elastic.Clients.Elasticsearch.Fluent;
21+
using Elastic.Clients.Elasticsearch.Requests;
22+
using Elastic.Clients.Elasticsearch.Serialization;
23+
using Elastic.Transport;
24+
using System;
25+
using System.Collections.Generic;
26+
using System.Linq.Expressions;
27+
using System.Text.Json;
28+
using System.Text.Json.Serialization;
29+
30+
namespace Elastic.Clients.Elasticsearch.Tasks;
31+
32+
public sealed class GetTasksRequestParameters : RequestParameters
33+
{
34+
/// <summary>
35+
/// <para>Explicit operation timeout</para>
36+
/// </summary>
37+
public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q<Elastic.Clients.Elasticsearch.Duration?>("timeout"); set => Q("timeout", value); }
38+
39+
/// <summary>
40+
/// <para>Wait for the matching tasks to complete (default: false)</para>
41+
/// </summary>
42+
public bool? WaitForCompletion { get => Q<bool?>("wait_for_completion"); set => Q("wait_for_completion", value); }
43+
}
44+
45+
/// <summary>
46+
/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely.
47+
/// <para>Returns information about a task.</para>
48+
/// </summary>
49+
public sealed partial class GetTasksRequest : PlainRequest<GetTasksRequestParameters>
50+
{
51+
public GetTasksRequest(Elastic.Clients.Elasticsearch.Id task_id) : base(r => r.Required("task_id", task_id))
52+
{
53+
}
54+
55+
internal override ApiUrls ApiUrls => ApiUrlLookup.TasksGet;
56+
57+
protected override HttpMethod StaticHttpMethod => HttpMethod.GET;
58+
59+
internal override bool SupportsBody => false;
60+
61+
/// <summary>
62+
/// <para>Explicit operation timeout</para>
63+
/// </summary>
64+
[JsonIgnore]
65+
public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q<Elastic.Clients.Elasticsearch.Duration?>("timeout"); set => Q("timeout", value); }
66+
67+
/// <summary>
68+
/// <para>Wait for the matching tasks to complete (default: false)</para>
69+
/// </summary>
70+
[JsonIgnore]
71+
public bool? WaitForCompletion { get => Q<bool?>("wait_for_completion"); set => Q("wait_for_completion", value); }
72+
}
73+
74+
/// <summary>
75+
/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely.
76+
/// <para>Returns information about a task.</para>
77+
/// </summary>
78+
public sealed partial class GetTasksRequestDescriptor : RequestDescriptor<GetTasksRequestDescriptor, GetTasksRequestParameters>
79+
{
80+
internal GetTasksRequestDescriptor(Action<GetTasksRequestDescriptor> configure) => configure.Invoke(this);
81+
82+
public GetTasksRequestDescriptor(Elastic.Clients.Elasticsearch.Id task_id) : base(r => r.Required("task_id", task_id))
83+
{
84+
}
85+
86+
internal GetTasksRequestDescriptor()
87+
{
88+
}
89+
90+
internal override ApiUrls ApiUrls => ApiUrlLookup.TasksGet;
91+
92+
protected override HttpMethod StaticHttpMethod => HttpMethod.GET;
93+
94+
internal override bool SupportsBody => false;
95+
96+
public GetTasksRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout);
97+
public GetTasksRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion);
98+
99+
public GetTasksRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.Id task_id)
100+
{
101+
RouteValues.Required("task_id", task_id);
102+
return Self;
103+
}
104+
105+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
106+
{
107+
}
108+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
#nullable restore
19+
20+
using Elastic.Clients.Elasticsearch.Fluent;
21+
using Elastic.Clients.Elasticsearch.Serialization;
22+
using Elastic.Transport.Products.Elasticsearch;
23+
using System.Collections.Generic;
24+
using System.Text.Json.Serialization;
25+
26+
namespace Elastic.Clients.Elasticsearch.Tasks;
27+
28+
/// <summary>
29+
/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely.
30+
/// </summary>
31+
public sealed partial class GetTasksResponse : ElasticsearchResponse
32+
{
33+
[JsonInclude, JsonPropertyName("completed")]
34+
public bool Completed { get; init; }
35+
[JsonInclude, JsonPropertyName("response")]
36+
public Elastic.Clients.Elasticsearch.Tasks.TaskStatus? Response { get; init; }
37+
[JsonInclude, JsonPropertyName("task")]
38+
public Elastic.Clients.Elasticsearch.Tasks.TaskInfo Task { get; init; }
39+
}
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
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+
#nullable restore
19+
20+
using Elastic.Clients.Elasticsearch.Fluent;
21+
using Elastic.Clients.Elasticsearch.Requests;
22+
using Elastic.Clients.Elasticsearch.Serialization;
23+
using Elastic.Transport;
24+
using System;
25+
using System.Collections.Generic;
26+
using System.Linq.Expressions;
27+
using System.Text.Json;
28+
using System.Text.Json.Serialization;
29+
30+
namespace Elastic.Clients.Elasticsearch.Tasks;
31+
32+
public sealed class ListRequestParameters : RequestParameters
33+
{
34+
/// <summary>
35+
/// <para>Comma-separated list or wildcard expression of actions used to limit the request.</para>
36+
/// </summary>
37+
public ICollection<string>? Actions { get => Q<ICollection<string>?>("actions"); set => Q("actions", value); }
38+
39+
/// <summary>
40+
/// <para>If `true`, the response includes detailed information about shard recoveries.</para>
41+
/// </summary>
42+
public bool? Detailed { get => Q<bool?>("detailed"); set => Q("detailed", value); }
43+
44+
/// <summary>
45+
/// <para>Key used to group tasks in the response.</para>
46+
/// </summary>
47+
public Elastic.Clients.Elasticsearch.Tasks.GroupBy? GroupBy { get => Q<Elastic.Clients.Elasticsearch.Tasks.GroupBy?>("group_by"); set => Q("group_by", value); }
48+
49+
/// <summary>
50+
/// <para>Comma-separated list of node IDs or names used to limit returned information.</para>
51+
/// </summary>
52+
public ICollection<string>? NodeId { get => Q<ICollection<string>?>("node_id"); set => Q("node_id", value); }
53+
54+
/// <summary>
55+
/// <para>Parent task ID used to limit returned information. To return all tasks, omit this parameter or use a value of `-1`.</para>
56+
/// </summary>
57+
public Elastic.Clients.Elasticsearch.Id? ParentTaskId { get => Q<Elastic.Clients.Elasticsearch.Id?>("parent_task_id"); set => Q("parent_task_id", value); }
58+
59+
/// <summary>
60+
/// <para>Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.</para>
61+
/// </summary>
62+
public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Duration?>("master_timeout"); set => Q("master_timeout", value); }
63+
64+
/// <summary>
65+
/// <para>Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.</para>
66+
/// </summary>
67+
public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q<Elastic.Clients.Elasticsearch.Duration?>("timeout"); set => Q("timeout", value); }
68+
69+
/// <summary>
70+
/// <para>If `true`, the request blocks until the operation is complete.</para>
71+
/// </summary>
72+
public bool? WaitForCompletion { get => Q<bool?>("wait_for_completion"); set => Q("wait_for_completion", value); }
73+
}
74+
75+
/// <summary>
76+
/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely.
77+
/// <para>The task management API returns information about tasks currently executing on one or more nodes in the cluster.</para>
78+
/// </summary>
79+
public sealed partial class ListRequest : PlainRequest<ListRequestParameters>
80+
{
81+
internal override ApiUrls ApiUrls => ApiUrlLookup.TasksList;
82+
83+
protected override HttpMethod StaticHttpMethod => HttpMethod.GET;
84+
85+
internal override bool SupportsBody => false;
86+
87+
/// <summary>
88+
/// <para>Comma-separated list or wildcard expression of actions used to limit the request.</para>
89+
/// </summary>
90+
[JsonIgnore]
91+
public ICollection<string>? Actions { get => Q<ICollection<string>?>("actions"); set => Q("actions", value); }
92+
93+
/// <summary>
94+
/// <para>If `true`, the response includes detailed information about shard recoveries.</para>
95+
/// </summary>
96+
[JsonIgnore]
97+
public bool? Detailed { get => Q<bool?>("detailed"); set => Q("detailed", value); }
98+
99+
/// <summary>
100+
/// <para>Key used to group tasks in the response.</para>
101+
/// </summary>
102+
[JsonIgnore]
103+
public Elastic.Clients.Elasticsearch.Tasks.GroupBy? GroupBy { get => Q<Elastic.Clients.Elasticsearch.Tasks.GroupBy?>("group_by"); set => Q("group_by", value); }
104+
105+
/// <summary>
106+
/// <para>Comma-separated list of node IDs or names used to limit returned information.</para>
107+
/// </summary>
108+
[JsonIgnore]
109+
public ICollection<string>? NodeId { get => Q<ICollection<string>?>("node_id"); set => Q("node_id", value); }
110+
111+
/// <summary>
112+
/// <para>Parent task ID used to limit returned information. To return all tasks, omit this parameter or use a value of `-1`.</para>
113+
/// </summary>
114+
[JsonIgnore]
115+
public Elastic.Clients.Elasticsearch.Id? ParentTaskId { get => Q<Elastic.Clients.Elasticsearch.Id?>("parent_task_id"); set => Q("parent_task_id", value); }
116+
117+
/// <summary>
118+
/// <para>Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.</para>
119+
/// </summary>
120+
[JsonIgnore]
121+
public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Duration?>("master_timeout"); set => Q("master_timeout", value); }
122+
123+
/// <summary>
124+
/// <para>Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.</para>
125+
/// </summary>
126+
[JsonIgnore]
127+
public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q<Elastic.Clients.Elasticsearch.Duration?>("timeout"); set => Q("timeout", value); }
128+
129+
/// <summary>
130+
/// <para>If `true`, the request blocks until the operation is complete.</para>
131+
/// </summary>
132+
[JsonIgnore]
133+
public bool? WaitForCompletion { get => Q<bool?>("wait_for_completion"); set => Q("wait_for_completion", value); }
134+
}
135+
136+
/// <summary>
137+
/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely.
138+
/// <para>The task management API returns information about tasks currently executing on one or more nodes in the cluster.</para>
139+
/// </summary>
140+
public sealed partial class ListRequestDescriptor : RequestDescriptor<ListRequestDescriptor, ListRequestParameters>
141+
{
142+
internal ListRequestDescriptor(Action<ListRequestDescriptor> configure) => configure.Invoke(this);
143+
144+
public ListRequestDescriptor()
145+
{
146+
}
147+
148+
internal override ApiUrls ApiUrls => ApiUrlLookup.TasksList;
149+
150+
protected override HttpMethod StaticHttpMethod => HttpMethod.GET;
151+
152+
internal override bool SupportsBody => false;
153+
154+
public ListRequestDescriptor Actions(ICollection<string>? actions) => Qs("actions", actions);
155+
public ListRequestDescriptor Detailed(bool? detailed = true) => Qs("detailed", detailed);
156+
public ListRequestDescriptor GroupBy(Elastic.Clients.Elasticsearch.Tasks.GroupBy? groupBy) => Qs("group_by", groupBy);
157+
public ListRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? masterTimeout) => Qs("master_timeout", masterTimeout);
158+
public ListRequestDescriptor NodeId(ICollection<string>? nodeId) => Qs("node_id", nodeId);
159+
public ListRequestDescriptor ParentTaskId(Elastic.Clients.Elasticsearch.Id? parentTaskId) => Qs("parent_task_id", parentTaskId);
160+
public ListRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout);
161+
public ListRequestDescriptor WaitForCompletion(bool? waitForCompletion = true) => Qs("wait_for_completion", waitForCompletion);
162+
163+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
164+
{
165+
}
166+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
#nullable restore
19+
20+
using Elastic.Clients.Elasticsearch.Fluent;
21+
using Elastic.Clients.Elasticsearch.Serialization;
22+
using Elastic.Transport.Products.Elasticsearch;
23+
using System.Collections.Generic;
24+
using System.Text.Json.Serialization;
25+
26+
namespace Elastic.Clients.Elasticsearch.Tasks;
27+
28+
/// <summary>
29+
/// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely.
30+
/// </summary>
31+
public sealed partial class ListResponse : ElasticsearchResponse
32+
{
33+
[JsonInclude, JsonPropertyName("node_failures")]
34+
public IReadOnlyCollection<Elastic.Clients.Elasticsearch.ErrorCause>? NodeFailures { get; init; }
35+
36+
/// <summary>
37+
/// <para>Task information grouped by node, if `group_by` was set to `node` (the default).</para>
38+
/// </summary>
39+
[JsonInclude, JsonPropertyName("nodes")]
40+
public IReadOnlyDictionary<string, Elastic.Clients.Elasticsearch.Tasks.NodeTasks>? Nodes { get; init; }
41+
[JsonInclude, JsonPropertyName("task_failures")]
42+
public IReadOnlyCollection<Elastic.Clients.Elasticsearch.TaskFailure>? TaskFailures { get; init; }
43+
44+
/// <summary>
45+
/// <para>Either a flat list of tasks if `group_by` was set to `none`, or grouped by parents if<br/>`group_by` was set to `parents`.</para>
46+
/// </summary>
47+
[JsonInclude, JsonPropertyName("tasks")]
48+
public Elastic.Clients.Elasticsearch.Tasks.TaskInfos? Tasks { get; init; }
49+
}

‎src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Tasks.g.cs

Lines changed: 320 additions & 0 deletions
Large diffs are not rendered by default.

‎src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
using Elastic.Clients.Elasticsearch.IndexManagement;
2424
using Elastic.Clients.Elasticsearch.Ingest;
2525
using Elastic.Clients.Elasticsearch.Sql;
26+
using Elastic.Clients.Elasticsearch.Tasks;
2627
using System;
2728
using System.Threading;
2829
using System.Threading.Tasks;
@@ -37,10 +38,11 @@ public partial class ElasticsearchClient
3738
public virtual IndicesNamespacedClient Indices { get; private set; }
3839
public virtual IngestNamespacedClient Ingest { get; private set; }
3940
public virtual SqlNamespacedClient Sql { get; private set; }
41+
public virtual TasksNamespacedClient Tasks { get; private set; }
4042

4143
private partial void SetupNamespaces()
4244
{
43-
AsyncSearch = new AsyncSearchNamespacedClient(this); Cluster = new ClusterNamespacedClient(this); Eql = new EqlNamespacedClient(this); Indices = new IndicesNamespacedClient(this); Ingest = new IngestNamespacedClient(this); Sql = new SqlNamespacedClient(this);
45+
AsyncSearch = new AsyncSearchNamespacedClient(this); Cluster = new ClusterNamespacedClient(this); Eql = new EqlNamespacedClient(this); Indices = new IndicesNamespacedClient(this); Ingest = new IngestNamespacedClient(this); Sql = new SqlNamespacedClient(this); Tasks = new TasksNamespacedClient(this);
4446
}
4547

4648
/// <summary>
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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+
#nullable restore
19+
20+
using System;
21+
using System.Text.Json;
22+
using System.Text.Json.Serialization;
23+
using System.Runtime.Serialization;
24+
using Elastic.Transport;
25+
using Elastic.Clients.Elasticsearch.Serialization;
26+
27+
namespace Elastic.Clients.Elasticsearch.Tasks;
28+
29+
[JsonConverter(typeof(GroupByConverter))]
30+
public enum GroupBy
31+
{
32+
/// <summary>
33+
/// <para>Parent task ID</para>
34+
/// </summary>
35+
[EnumMember(Value = "parents")]
36+
Parents,
37+
/// <summary>
38+
/// <para>Do not group tasks.</para>
39+
/// </summary>
40+
[EnumMember(Value = "none")]
41+
None,
42+
/// <summary>
43+
/// <para>Node ID</para>
44+
/// </summary>
45+
[EnumMember(Value = "nodes")]
46+
Nodes
47+
}
48+
49+
internal sealed class GroupByConverter : JsonConverter<GroupBy>
50+
{
51+
public override GroupBy Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
52+
{
53+
var enumString = reader.GetString();
54+
switch (enumString)
55+
{
56+
case "parents":
57+
return GroupBy.Parents;
58+
case "none":
59+
return GroupBy.None;
60+
case "nodes":
61+
return GroupBy.Nodes;
62+
}
63+
64+
ThrowHelper.ThrowJsonException(); return default;
65+
}
66+
67+
public override void Write(Utf8JsonWriter writer, GroupBy value, JsonSerializerOptions options)
68+
{
69+
switch (value)
70+
{
71+
case GroupBy.Parents:
72+
writer.WriteStringValue("parents");
73+
return;
74+
case GroupBy.None:
75+
writer.WriteStringValue("none");
76+
return;
77+
case GroupBy.Nodes:
78+
writer.WriteStringValue("nodes");
79+
return;
80+
}
81+
82+
writer.WriteNullValue();
83+
}
84+
}

0 commit comments

Comments
 (0)
Please sign in to comment.