Skip to content

Commit 785e275

Browse files
Mpdreamzrusscam
authored andcommitted
Deprecate the ability to update datafeed's job_id (#4137)
Relates: elastic/elasticsearch#44691 * Deprecate the ability to update datafeed's job_id * remove deprecated usage of job id in update data_feed tests
1 parent 83bf3e3 commit 785e275

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Nest/XPack/MachineLearning/UpdateDataFeed/UpdateDatafeedRequest.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public partial interface IUpdateDatafeedRequest
3838
/// <summary>
3939
/// A numerical character string that uniquely identifies the job.
4040
/// </summary>
41+
[Obsolete("As of 7.4.0 the ability to associate a feed with a different job is being deprecated as it adds unnecessary complexity")]
4142
[DataMember(Name ="job_id")]
4243
Id JobId { get; set; }
4344

@@ -85,6 +86,7 @@ public partial class UpdateDatafeedRequest
8586
public Indices Indices { get; set; }
8687

8788
/// <inheritdoc />
89+
[Obsolete("As of 7.4.0 the ability to associate a feed with a different job is being deprecated as it adds unnecessary complexity")]
8890
public Id JobId { get; set; }
8991

9092
/// <inheritdoc />
@@ -133,6 +135,7 @@ public UpdateDatafeedDescriptor<TDocument> ChunkingConfig(Func<ChunkingConfigDes
133135
public UpdateDatafeedDescriptor<TDocument> AllIndices() => Indices(Nest.Indices.All);
134136

135137
/// <inheritdoc />
138+
[Obsolete("As of 7.4.0 the ability to associate a feed with a different job is being deprecated as it adds unnecessary complexity")]
136139
public UpdateDatafeedDescriptor<TDocument> JobId(Id jobId) => Assign(jobId, (a, v) => a.JobId = v);
137140

138141
/// <inheritdoc />

src/Tests/Tests/XPack/MachineLearning/UpdateDatafeed/UpdateDatafeedApiTests.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public UpdateDatafeedApiTests(MachineLearningCluster cluster, EndpointUsage usag
1919
protected override object ExpectJson => new
2020
{
2121
indices = new[] { "server-metrics" },
22-
job_id = CallIsolatedValue,
2322
query = new
2423
{
2524
match_all = new
@@ -33,7 +32,6 @@ public UpdateDatafeedApiTests(MachineLearningCluster cluster, EndpointUsage usag
3332

3433
protected override Func<UpdateDatafeedDescriptor<Metric>, IUpdateDatafeedRequest> Fluent => f => f
3534
.Indices("server-metrics") //goes on body not in the url
36-
.JobId(CallIsolatedValue)
3735
.Query(q => q
3836
.MatchAll(m => m.Boost(2))
3937
);
@@ -43,7 +41,6 @@ public UpdateDatafeedApiTests(MachineLearningCluster cluster, EndpointUsage usag
4341
protected override UpdateDatafeedRequest Initializer =>
4442
new UpdateDatafeedRequest(CallIsolatedValue + "-datafeed")
4543
{
46-
JobId = CallIsolatedValue,
4744
Indices = "server-metrics",
4845
Query = new MatchAllQuery
4946
{

0 commit comments

Comments
 (0)