Skip to content

Commit

Permalink
S3 repo settings: path style access (#4136)
Browse files Browse the repository at this point in the history
Add support for S3 repo settings: path style access: elastic/elasticsearch#41966
  • Loading branch information
Mpdreamz authored and russcam committed Oct 15, 2019
1 parent 9734f04 commit 6b0afaa
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Nest/Modules/SnapshotAndRestore/Repositories/S3Repository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ public interface IS3RepositorySettings : IRepositorySettings
/// </summary>
[DataMember(Name ="storage_class")]
string StorageClass { get; set; }

/// <summary>
/// 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
/// </summary>
[DataMember(Name = "path_style_access")]
bool? PathStyleAccess { get; set; }
}

/// <inheritdoc />
Expand Down Expand Up @@ -127,6 +135,9 @@ internal S3RepositorySettings() { }

/// <inheritdoc />
public string StorageClass { get; set; }

/// <inheritdoc />
public bool? PathStyleAccess { get; set; }
}

/// <inheritdoc cref="IS3RepositorySettings"/>
Expand All @@ -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; }

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

/// <inheritdoc cref="IS3RepositorySettings.StorageClass" />
public S3RepositorySettingsDescriptor StorageClass(string storageClass) => Assign(storageClass, (a, v) => a.StorageClass = v);

/// <inheritdoc cref="IS3RepositorySettings.PathStyleAccess" />
public S3RepositorySettingsDescriptor PathStyleAccess(bool? pathStyleAccess = true) =>
Assign(pathStyleAccess, (a, v) => a.PathStyleAccess = v);
}

/// <inheritdoc cref="IS3Repository"/>
Expand Down

0 comments on commit 6b0afaa

Please sign in to comment.