Skip to content

Commit 96563a6

Browse files
Mpdreamzrusscam
authored andcommitted
S3 repo settings: path style access (#4136)
Add support for S3 repo settings: path style access: elastic/elasticsearch#41966 (cherry picked from commit 6b0afaa)
1 parent aea44a3 commit 96563a6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Nest/Modules/SnapshotAndRestore/Repositories/S3Repository.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ public interface IS3RepositorySettings : IRepositorySettings
9292
/// </summary>
9393
[DataMember(Name ="storage_class")]
9494
string StorageClass { get; set; }
95+
96+
/// <summary>
97+
/// Whether to force the use of the path style access pattern. If `true`, the
98+
// path style access pattern will be used. If `false`, the access pattern will
99+
// be automatically determined by the AWS Java SDK used internally by Elasticsearch
100+
/// </summary>
101+
[DataMember(Name = "path_style_access")]
102+
bool? PathStyleAccess { get; set; }
95103
}
96104

97105
/// <inheritdoc />
@@ -127,6 +135,9 @@ internal S3RepositorySettings() { }
127135

128136
/// <inheritdoc />
129137
public string StorageClass { get; set; }
138+
139+
/// <inheritdoc />
140+
public bool? PathStyleAccess { get; set; }
130141
}
131142

132143
/// <inheritdoc cref="IS3RepositorySettings"/>
@@ -144,6 +155,7 @@ public class S3RepositorySettingsDescriptor
144155
bool? IS3RepositorySettings.Compress { get; set; }
145156
bool? IS3RepositorySettings.ServerSideEncryption { get; set; }
146157
string IS3RepositorySettings.StorageClass { get; set; }
158+
bool? IS3RepositorySettings.PathStyleAccess { get; set; }
147159

148160
/// <inheritdoc cref="IS3RepositorySettings.Bucket" />
149161
public S3RepositorySettingsDescriptor Bucket(string bucket) => Assign(bucket, (a, v) => a.Bucket = v);
@@ -172,6 +184,10 @@ public S3RepositorySettingsDescriptor ServerSideEncryption(bool? serverSideEncry
172184

173185
/// <inheritdoc cref="IS3RepositorySettings.StorageClass" />
174186
public S3RepositorySettingsDescriptor StorageClass(string storageClass) => Assign(storageClass, (a, v) => a.StorageClass = v);
187+
188+
/// <inheritdoc cref="IS3RepositorySettings.PathStyleAccess" />
189+
public S3RepositorySettingsDescriptor PathStyleAccess(bool? pathStyleAccess = true) =>
190+
Assign(pathStyleAccess, (a, v) => a.PathStyleAccess = v);
175191
}
176192

177193
/// <inheritdoc cref="IS3Repository"/>

0 commit comments

Comments
 (0)