Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz authored and awelburn committed Nov 6, 2017
1 parent 2498848 commit 332fcef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
22 changes: 5 additions & 17 deletions src/Nest/Modules/SnapshotAndRestore/Repositories/S3Repository.cs
Expand Up @@ -21,9 +21,6 @@ public interface IS3RepositorySettings : IRepositorySettings
[JsonProperty("bucket")]
string Bucket { get; set; }

[JsonProperty("region")]
string Region { get; set; }

[JsonProperty("base_path")]
string BasePath { get; set; }

Expand Down Expand Up @@ -53,7 +50,6 @@ public S3RepositorySettings(string bucket)
}

public string Bucket { get; set; }
public string Region { get; set; }
public string BasePath { get; set; }
public string AccessKey { get; set; }
public string SecretKey { get; set; }
Expand All @@ -62,11 +58,10 @@ public S3RepositorySettings(string bucket)
public string ChunkSize { get; set; }
}

public class S3RepositorySettingsDescriptor
public class S3RepositorySettingsDescriptor
: DescriptorBase<S3RepositorySettingsDescriptor, IS3RepositorySettings>, IS3RepositorySettings
{
string IS3RepositorySettings.Bucket { get; set; }
string IS3RepositorySettings.Region { get; set; }
string IS3RepositorySettings.BasePath { get; set; }
string IS3RepositorySettings.AccessKey { get; set; }
string IS3RepositorySettings.SecretKey { get; set; }
Expand All @@ -80,13 +75,6 @@ public class S3RepositorySettingsDescriptor
/// <param name="bucket"></param>
public S3RepositorySettingsDescriptor Bucket(string bucket) => Assign(a => a.Bucket = bucket);

/// <summary>
/// The region where bucket is located. Defaults to US Standard
/// </summary>
/// <param name="region"></param>
/// <returns></returns>
public S3RepositorySettingsDescriptor Region(string region) => Assign(a => a.Region = region);

/// <summary>
/// Specifies the path within bucket to repository data. Defaults to root directory.
/// </summary>
Expand All @@ -109,7 +97,7 @@ public class S3RepositorySettingsDescriptor
public S3RepositorySettingsDescriptor SecretKey(string secretKey) => Assign(a => a.SecretKey = secretKey);

/// <summary>
/// When set to true metadata files are stored in compressed format. This setting doesn't
/// When set to true metadata files are stored in compressed format. This setting doesn't
/// affect index files that are already compressed by default. Defaults to false.
/// </summary>
/// <param name="compress"></param>
Expand All @@ -122,15 +110,15 @@ public class S3RepositorySettingsDescriptor
public S3RepositorySettingsDescriptor ConcurrentStreams(int concurrentStreams) => Assign(a => a.ConcurrentStreams = concurrentStreams);

/// <summary>
/// Big files can be broken down into chunks during snapshotting if needed.
/// The chunk size can be specified in bytes or by using size value notation,
/// Big files can be broken down into chunks during snapshotting if needed.
/// The chunk size can be specified in bytes or by using size value notation,
/// i.e. 1g, 10m, 5k. Defaults to 100m.
/// </summary>
/// <param name="chunkSize"></param>
public S3RepositorySettingsDescriptor ChunkSize(string chunkSize) => Assign(a => a.ChunkSize = chunkSize);
}

public class S3RepositoryDescriptor
public class S3RepositoryDescriptor
: DescriptorBase<S3RepositoryDescriptor, IS3Repository>, IS3Repository
{
string ISnapshotRepository.Type { get; } = "s3";
Expand Down
Expand Up @@ -251,7 +251,6 @@ public class CreateS3RepositoryApiTests : ApiTestBase<WritableCluster, ICreateRe
type = "s3",
settings = new {
bucket = "foobucket",
region = "us-east",
base_path = "some/path",
access_key = "fooaccess",
secret_key = "foosecret",
Expand All @@ -266,7 +265,6 @@ public class CreateS3RepositoryApiTests : ApiTestBase<WritableCluster, ICreateRe
protected override Func<CreateRepositoryDescriptor, ICreateRepositoryRequest> Fluent => d => d
.S3(fs => fs
.Settings("foobucket", s => s
.Region("us-east")
.BasePath("some/path")
.AccessKey("fooaccess")
.SecretKey("foosecret")
Expand All @@ -280,7 +278,6 @@ public class CreateS3RepositoryApiTests : ApiTestBase<WritableCluster, ICreateRe
{
Repository = new S3Repository(new S3RepositorySettings("foobucket")
{
Region = "us-east",
BasePath = "some/path",
AccessKey = "fooaccess",
SecretKey = "foosecret",
Expand Down

0 comments on commit 332fcef

Please sign in to comment.