Skip to content

Commit 32a8de6

Browse files
committed
Implement Clone Snapshot API (#5240)
Implement Clone Snapshot API - Implement new API - Remove CRUD snapshot tests and replace with coordinated tests - Move tests to IntrusiveOperationCluster
1 parent 580b181 commit 32a8de6

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/Nest/Descriptors.Snapshot.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ protected CleanupRepositoryDescriptor(): base()
6262
public partial class CloneSnapshotDescriptor : RequestDescriptorBase<CloneSnapshotDescriptor, CloneSnapshotRequestParameters, ICloneSnapshotRequest>, ICloneSnapshotRequest
6363
{
6464
internal override ApiUrls ApiUrls => ApiUrlsLookups.SnapshotClone;
65+
protected override HttpMethod HttpMethod => HttpMethod.PUT;
66+
protected override bool SupportsBody => true;
6567
///<summary>/_snapshot/{repository}/{snapshot}/_clone/{target_snapshot}</summary>
6668
///<param name = "repository">this parameter is required</param>
6769
///<param name = "snapshot">this parameter is required</param>
@@ -349,4 +351,4 @@ protected VerifyRepositoryDescriptor(): base()
349351
///<summary>Explicit operation timeout</summary>
350352
public VerifyRepositoryDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
351353
}
352-
}
354+
}

src/Nest/Requests.Snapshot.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ public partial class CloneSnapshotRequest : PlainRequestBase<CloneSnapshotReques
107107
{
108108
protected ICloneSnapshotRequest Self => this;
109109
internal override ApiUrls ApiUrls => ApiUrlsLookups.SnapshotClone;
110+
protected override HttpMethod HttpMethod => HttpMethod.PUT;
111+
protected override bool SupportsBody => true;
110112
///<summary>/_snapshot/{repository}/{snapshot}/_clone/{target_snapshot}</summary>
111113
///<param name = "repository">this parameter is required</param>
112114
///<param name = "snapshot">this parameter is required</param>
@@ -624,4 +626,4 @@ public Time Timeout
624626
set => Q("timeout", value);
625627
}
626628
}
627-
}
629+
}

tests/Tests/Modules/SnapshotAndRestore/Snapshot/CloneSnapshot/CloneSnapshotApiTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
using System;
66
using Elastic.Elasticsearch.Xunit.XunitPlumbing;
7-
using Elasticsearch.Net;
7+
using Elastic.Transport;
88
using Nest;
99
using Tests.Core.ManagedElasticsearch.Clusters;
1010
using Tests.Framework.EndpointTests;

0 commit comments

Comments
 (0)