Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Nest/XPack/MachineLearning/OpenJob/OpenJobResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,13 @@ public class OpenJobResponse : ResponseBase
{
[DataMember(Name ="opened")]
public bool Opened { get; internal set; }

/// <summary>
/// The node that the job was assigned to
/// <para />
/// Available in Elasticsearch 7.8.0+
/// </summary>
[DataMember(Name = "node")]
public string Node { get; internal set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,13 @@ public class StartDatafeedResponse : ResponseBase
{
[DataMember(Name ="started")]
public bool Started { get; internal set; }

/// <summary>
/// The node that the job was assigned to
/// <para />
/// Available in Elasticsearch 7.8.0+
/// </summary>
[DataMember(Name = "node")]
public string Node { get; internal set; }
}
}
10 changes: 9 additions & 1 deletion tests/Tests/XPack/MachineLearning/OpenJob/OpenJobApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
}
}
}