Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion docs/plugins/repository-s3.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ include::repository-shared-settings.asciidoc[]
`storage_class`::

Sets the S3 storage class for objects stored in the snapshot repository.
Values may be `standard`, `reduced_redundancy`, `standard_ia`
Values may be `standard`, `reduced_redundancy`, `standard_ia`, `onezone_ia`
and `intelligent_tiering`. Defaults to `standard`.
Changing this setting on an existing repository only affects the
storage class for newly created objects, resulting in a mixed usage of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class S3Repository extends BlobStoreRepository {

/**
* Sets the S3 storage class type for the backup files. Values may be standard, reduced_redundancy,
* standard_ia and intelligent_tiering. Defaults to standard.
* standard_ia, onezone_ia and intelligent_tiering. Defaults to standard.
*/
static final Setting<String> STORAGE_CLASS_SETTING = Setting.simpleString("storage_class");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,18 @@ public void testInitStorageClass() {
assertThat(S3BlobStore.initStorageClass(null), equalTo(StorageClass.Standard));
assertThat(S3BlobStore.initStorageClass(""), equalTo(StorageClass.Standard));

// it should accept [standard, standard_ia, reduced_redundancy, intelligent_tiering]
// it should accept [standard, standard_ia, onezone_ia, reduced_redundancy, intelligent_tiering]
assertThat(S3BlobStore.initStorageClass("standard"), equalTo(StorageClass.Standard));
assertThat(S3BlobStore.initStorageClass("standard_ia"), equalTo(StorageClass.StandardInfrequentAccess));
assertThat(S3BlobStore.initStorageClass("onezone_ia"), equalTo(StorageClass.OneZoneInfrequentAccess));
assertThat(S3BlobStore.initStorageClass("reduced_redundancy"), equalTo(StorageClass.ReducedRedundancy));
assertThat(S3BlobStore.initStorageClass("intelligent_tiering"), equalTo(StorageClass.IntelligentTiering));
}

public void testCaseInsensitiveStorageClass() {
assertThat(S3BlobStore.initStorageClass("sTandaRd"), equalTo(StorageClass.Standard));
assertThat(S3BlobStore.initStorageClass("sTandaRd_Ia"), equalTo(StorageClass.StandardInfrequentAccess));
assertThat(S3BlobStore.initStorageClass("oNeZoNe_iA"), equalTo(StorageClass.OneZoneInfrequentAccess));
assertThat(S3BlobStore.initStorageClass("reduCED_redundancy"), equalTo(StorageClass.ReducedRedundancy));
assertThat(S3BlobStore.initStorageClass("intelLigeNt_tieriNG"), equalTo(StorageClass.IntelligentTiering));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,15 @@ protected void createRepository(String repoName) {
.put("base_path", System.getProperty("test.s3.base", "testpath"));
final String endpoint = System.getProperty("test.s3.endpoint");
if (endpoint != null) {
settings = settings.put("endpoint", endpoint);
settings.put("endpoint", endpoint);
} else {
// only test different storage classes when running against the default endpoint, i.e. a genuine S3 service
if (randomBoolean()) {
final String storageClass
= randomFrom("standard", "reduced_redundancy", "standard_ia", "onezone_ia", "intelligent_tiering");
logger.info("--> using storage_class [{}]", storageClass);
settings.put("storage_class", storageClass);
}
}
AcknowledgedResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("test-repo")
.setType("s3")
Expand Down