diff --git a/src/Nest/XPack/MachineLearning/OpenJob/OpenJobResponse.cs b/src/Nest/XPack/MachineLearning/OpenJob/OpenJobResponse.cs
index 174b4b03792..d99ce070270 100644
--- a/src/Nest/XPack/MachineLearning/OpenJob/OpenJobResponse.cs
+++ b/src/Nest/XPack/MachineLearning/OpenJob/OpenJobResponse.cs
@@ -10,5 +10,13 @@ public class OpenJobResponse : ResponseBase
{
[DataMember(Name ="opened")]
public bool Opened { get; internal set; }
+
+ ///
+ /// The node that the job was assigned to
+ ///
+ /// Available in Elasticsearch 7.8.0+
+ ///
+ [DataMember(Name = "node")]
+ public string Node { get; internal set; }
}
}
diff --git a/src/Nest/XPack/MachineLearning/StartDatafeed/StartDatafeedResponse.cs b/src/Nest/XPack/MachineLearning/StartDatafeed/StartDatafeedResponse.cs
index f28c925406a..aae67edd817 100644
--- a/src/Nest/XPack/MachineLearning/StartDatafeed/StartDatafeedResponse.cs
+++ b/src/Nest/XPack/MachineLearning/StartDatafeed/StartDatafeedResponse.cs
@@ -10,5 +10,13 @@ public class StartDatafeedResponse : ResponseBase
{
[DataMember(Name ="started")]
public bool Started { get; internal set; }
+
+ ///
+ /// The node that the job was assigned to
+ ///
+ /// Available in Elasticsearch 7.8.0+
+ ///
+ [DataMember(Name = "node")]
+ public string Node { get; internal set; }
}
}
diff --git a/tests/Tests/XPack/MachineLearning/OpenJob/OpenJobApiTests.cs b/tests/Tests/XPack/MachineLearning/OpenJob/OpenJobApiTests.cs
index 5a1de4d58ce..35f53b389c0 100644
--- a/tests/Tests/XPack/MachineLearning/OpenJob/OpenJobApiTests.cs
+++ b/tests/Tests/XPack/MachineLearning/OpenJob/OpenJobApiTests.cs
@@ -6,6 +6,8 @@
using Elasticsearch.Net;
using FluentAssertions;
using Nest;
+using Tests.Core.Client;
+using Tests.Core.Extensions;
using Tests.Framework.EndpointTests.TestState;
namespace Tests.XPack.MachineLearning.OpenJob
@@ -45,6 +47,12 @@ protected override LazyResponses ClientUsage() => Calls(
protected override OpenJobDescriptor NewDescriptor() => new OpenJobDescriptor(CallIsolatedValue);
- protected override void ExpectResponse(OpenJobResponse response) => response.Opened.Should().BeTrue();
+ protected override void ExpectResponse(OpenJobResponse response)
+ {
+ response.Opened.Should().BeTrue();
+
+ if (TestClient.Configuration.InRange(">=7.8.0"))
+ response.Node.Should().NotBeNullOrEmpty();
+ }
}
}
diff --git a/tests/Tests/XPack/MachineLearning/StartDatafeed/StartDatafeedApiTests.cs b/tests/Tests/XPack/MachineLearning/StartDatafeed/StartDatafeedApiTests.cs
index 4dad11f67f4..3192f973a13 100644
--- a/tests/Tests/XPack/MachineLearning/StartDatafeed/StartDatafeedApiTests.cs
+++ b/tests/Tests/XPack/MachineLearning/StartDatafeed/StartDatafeedApiTests.cs
@@ -2,10 +2,12 @@
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
-using System;
+using System;
using Elasticsearch.Net;
using FluentAssertions;
using Nest;
+using Tests.Core.Client;
+using Tests.Core.Extensions;
using Tests.Framework.EndpointTests.TestState;
namespace Tests.XPack.MachineLearning.StartDatafeed
@@ -51,6 +53,12 @@ protected override LazyResponses ClientUsage() => Calls(
protected override StartDatafeedDescriptor NewDescriptor() => new StartDatafeedDescriptor(CallIsolatedValue + "-datafeed");
- protected override void ExpectResponse(StartDatafeedResponse response) => response.Started.Should().BeTrue();
+ protected override void ExpectResponse(StartDatafeedResponse response)
+ {
+ response.Started.Should().BeTrue();
+
+ if (TestClient.Configuration.InRange(">=7.8.0"))
+ response.Node.Should().NotBeNullOrEmpty();
+ }
}
}