-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add promote data stream API to NEST (#5636)
* Add request and response types * Generate NEST code * Add URL tests
- Loading branch information
1 parent
91fc76e
commit 51b594f
Showing
7 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/Nest/XPack/DataStreams/Promote/PromoteDataStreamRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Licensed to Elasticsearch B.V under one or more agreements. | ||
// 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 | ||
|
||
namespace Nest | ||
{ | ||
/// <summary> | ||
/// The purpose of the promote data stream api is to turn a data stream that is replicated by CCR into a regular data stream. | ||
/// </summary> | ||
[MapsApi("indices.promote_data_stream.json")] | ||
[ReadAs(typeof(PromoteDataStreamRequest))] | ||
public partial interface IPromoteDataStreamRequest | ||
{ | ||
} | ||
|
||
/// <inheritdoc cref="IPromoteDataStreamRequest"/> | ||
public partial class PromoteDataStreamRequest : IPromoteDataStreamRequest | ||
{ | ||
} | ||
|
||
/// <inheritdoc cref="IPromoteDataStreamRequest"/> | ||
public partial class PromoteDataStreamDescriptor | ||
{ | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/Nest/XPack/DataStreams/Promote/PromoteDataStreamResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Licensed to Elasticsearch B.V under one or more agreements. | ||
// 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 | ||
|
||
namespace Nest | ||
{ | ||
public class PromoteDataStreamResponse : AcknowledgedResponseBase { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
tests/Tests/XPack/DataStreams/Promote/PromoteDataStreamUrlTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Threading.Tasks; | ||
using Elastic.Elasticsearch.Xunit.XunitPlumbing; | ||
using Nest; | ||
using Tests.Framework.EndpointTests; | ||
using static Tests.Framework.EndpointTests.UrlTester; | ||
|
||
namespace Tests.XPack.DataStreams.Promote | ||
{ | ||
public class PromoteDataStreamUrlTests : UrlTestsBase | ||
{ | ||
[U] public override async Task Urls() => await POST("/_data_stream/_promote/stream") | ||
.Fluent(c => c.Indices.PromoteDataStream("stream", f => f)) | ||
.Request(c => c.Indices.PromoteDataStream(new PromoteDataStreamRequest("stream"))) | ||
.FluentAsync(c => c.Indices.PromoteDataStreamAsync("stream", f => f)) | ||
.RequestAsync(c => c.Indices.PromoteDataStreamAsync(new PromoteDataStreamRequest("stream"))); | ||
} | ||
} |