Add support for glacier storage class.

Just a copy of what have been done in PR #271.
This commit is contained in:
Eric Vantillard 2020-06-22 15:49:23 +02:00 committed by Andrew Gaul
parent 9dc4148743
commit 7d0c66e08a
5 changed files with 12 additions and 3 deletions

View File

@ -83,7 +83,7 @@ delete local file cache when s3fs starts and exits.
\fB\-o\fR storage_class (default="standard")
store object with specified storage class.
this option replaces the old option use_rrs.
Possible values: standard, standard_ia, onezone_ia, reduced_redundancy, and intelligent_tiering.
Possible values: standard, standard_ia, onezone_ia, reduced_redundancy, intelligent_tiering, and glacier.
.TP
\fB\-o\fR use_rrs (default is disable)
use Amazon's Reduced Redundancy Storage.

View File

@ -3280,6 +3280,8 @@ int S3fsCurl::PutHeadRequest(const char* tpath, headers_t& meta, bool is_copy)
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "ONEZONE_IA");
} else if(INTELLIGENT_TIERING == GetStorageClass()) {
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "INTELLIGENT_TIERING");
} else if(GLACIER == GetStorageClass()) {
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "GLACIER");
}
// SSE
if(!is_copy){
@ -3411,6 +3413,8 @@ int S3fsCurl::PutRequest(const char* tpath, headers_t& meta, int fd)
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "ONEZONE_IA");
} else if(INTELLIGENT_TIERING == GetStorageClass()) {
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "INTELLIGENT_TIERING");
} else if(GLACIER == GetStorageClass()) {
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "GLACIER");
}
// SSE
string ssevalue;
@ -3674,6 +3678,8 @@ int S3fsCurl::PreMultipartPostRequest(const char* tpath, headers_t& meta, string
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "ONEZONE_IA");
} else if(INTELLIGENT_TIERING == GetStorageClass()) {
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "INTELLIGENT_TIERING");
} else if(GLACIER == GetStorageClass()) {
requestHeaders = curl_slist_sort_insert(requestHeaders, "x-amz-storage-class", "GLACIER");
}
// SSE
if(!is_copy){

View File

@ -202,7 +202,8 @@ enum storage_class_t {
STANDARD_IA,
ONEZONE_IA,
REDUCED_REDUNDANCY,
INTELLIGENT_TIERING
INTELLIGENT_TIERING,
GLACIER
};
enum acl_t {

View File

@ -4626,6 +4626,8 @@ static int my_fuse_opt_proc(void* data, const char* arg, int key, struct fuse_ar
S3fsCurl::SetStorageClass(REDUCED_REDUNDANCY);
}else if(0 == strcmp(storage_class, "intelligent_tiering")){
S3fsCurl::SetStorageClass(INTELLIGENT_TIERING);
}else if(0 == strcmp(storage_class, "glacier")){
S3fsCurl::SetStorageClass(GLACIER);
}else{
S3FS_PRN_EXIT("unknown value for storage_class: %s", storage_class);
return -1;

View File

@ -1153,7 +1153,7 @@ void show_help ()
"\n"
" storage_class (default=\"standard\")\n"
" - store object with specified storage class. Possible values:\n"
" standard, standard_ia, onezone_ia, reduced_redundancy and intelligent_tiering.\n"
" standard, standard_ia, onezone_ia, reduced_redundancy, intelligent_tiering and glacier.\n"
"\n"
" use_rrs (default is disable)\n"
" - use Amazon's Reduced Redundancy Storage.\n"