Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 repo settings: path style access #4136

Merged
merged 2 commits into from
Oct 15, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
russcam marked this conversation as resolved.
Show resolved Hide resolved
/// </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