From 6b0afaab5f14c671b303c98fc296fbdd74169765 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Tue, 15 Oct 2019 06:15:02 +0200 Subject: [PATCH] S3 repo settings: path style access (#4136) Add support for S3 repo settings: path style access: elastic/elasticsearch#41966 --- .../Repositories/S3Repository.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Nest/Modules/SnapshotAndRestore/Repositories/S3Repository.cs b/src/Nest/Modules/SnapshotAndRestore/Repositories/S3Repository.cs index a6776896a3a..1ba430a5c9d 100644 --- a/src/Nest/Modules/SnapshotAndRestore/Repositories/S3Repository.cs +++ b/src/Nest/Modules/SnapshotAndRestore/Repositories/S3Repository.cs @@ -92,6 +92,14 @@ public interface IS3RepositorySettings : IRepositorySettings /// [DataMember(Name ="storage_class")] string StorageClass { get; set; } + + /// + /// Whether to force the use of the path style access pattern. If `true`, the + // path style access pattern will be used. If `false`, the access pattern will + // be automatically determined by the AWS Java SDK used internally by Elasticsearch + /// + [DataMember(Name = "path_style_access")] + bool? PathStyleAccess { get; set; } } /// @@ -127,6 +135,9 @@ internal S3RepositorySettings() { } /// public string StorageClass { get; set; } + + /// + public bool? PathStyleAccess { get; set; } } /// @@ -144,6 +155,7 @@ public class S3RepositorySettingsDescriptor bool? IS3RepositorySettings.Compress { get; set; } bool? IS3RepositorySettings.ServerSideEncryption { get; set; } string IS3RepositorySettings.StorageClass { get; set; } + bool? IS3RepositorySettings.PathStyleAccess { get; set; } /// public S3RepositorySettingsDescriptor Bucket(string bucket) => Assign(bucket, (a, v) => a.Bucket = v); @@ -172,6 +184,10 @@ public S3RepositorySettingsDescriptor ServerSideEncryption(bool? serverSideEncry /// public S3RepositorySettingsDescriptor StorageClass(string storageClass) => Assign(storageClass, (a, v) => a.StorageClass = v); + + /// + public S3RepositorySettingsDescriptor PathStyleAccess(bool? pathStyleAccess = true) => + Assign(pathStyleAccess, (a, v) => a.PathStyleAccess = v); } ///