Archive Storage Related

最近更新时间:2020-02-17 15:18:21


Interface Description

KS3 archive storage (ACHIVE) is suitable for archive data that needs to be stored for a long time (more than 3 months is recommended), which is rarely accessed in the storage cycle, and it takes 1 minute to 10 minutes for data to enter the readable state. It is suitable for archival data, medical images, scientific data, film and television materials that need to be preserved for a long time.

Before uploading an archive file, you need to create an archive bucket. You can only upload the archive file to the archive bucket.

Upload Interface

Put Object (Upload Archive)

When uploading a file, if the request header x-kss-storage-class is not specified, if the Bucket is an archive type, the Object will automatically be an archive type, if the Bucket is a non archive type, the Object will automatically be a standard type. If the x-kss-storageClass is ARCHIVE, the Bucket must be an archive type, otherwise 400 will be returned. If the x-kss-storageClass is not ARCHIVE, the Bucket cannot be an archive type, otherwise 400.

Bucket Type x-kss-storage-class Request Header File Type Status Code
Archive Storage Type No Upload Archived Type 200
Archive Storage Type ARCHIVE Archived Type 200
Archive Storage Type STANDAND Upload Failure 400
Archive Storage Type STANDARD_IA Upload Failure 400
Non Archive Storage Type No Upload Standard Type 200
Non Archive Storage Type STANDAND Standard Type 200
Non Archive Storage Type STANDARD_IA Low Frequency Type 200
Non Archive Storage Type ARCHIVE Upload Failure 400

Request Syntax:

PUT /{ObjectKey} HTTP/1.1
Host: {BucketName}.{endpoint}
Date: {date}
Authorization: {SignatureValue}
x-kss-storage-class: {StorageClass}

Attention:

Post Object (Upload Files)

Users can specify the storage type by setting the x-kss-storage-class field in the form field. The rules are consistent with the upload file of put object.

Initiate Multipart Upload (Initialize Block Upload)

The user can set the storage type of the file through the x-kss-storage-class request header when initializing block upload. Valid values are: STANDARD or STANDARD_IA. KS3 rejects this request for an invalid storage type.

Request Syntax:

POST /{ObjectKey}?uploads HTTP/1.1
Host: {BucketName}.{endpoint}
Date: {date}
Authorization: {SignatureValue}
x-kss-storage-class: {StorageClass}

Attention:

All subsequent block upload operations (Upload Part、Complete、Abort) will no longer accept the x-kss-storage-class request header.

Put Object Copy (Copy File)

KS3 does not currently support reassigning storage types for replicated files. The storage type of the destination file must be the same as the storage type of the source file. If the copy source file is an archive storage file, the destination file must be stored in the archive bucket. If the x-kss-storage-class request header is set, the value must be ARCHIVE. If the storage type of the source file is inconsistent with the storage type of the destination file, an error will be reported. Prompt InvalidStorageClass.

Upload Part Copy (Replication Block)

For replication chunking, KS3 does not currently support reassigning storage types. The storage type of the destination file must be the same as the storage type of the source file. For replication chunking, KS3 ignores the x-kss-storage-class request header. If the storage type of the source file is inconsistent with the storage type of the destination file, an error will be reported. Prompt InvalidStorageClass.

Thawing Interface

Detailed explanation Thawing Interface

Download Interface

Get Object (Download File)

GetObjectRequest request = new GetObjectRequest(bucketName, key);
GetObjectResult result = client.getObject(request);
Ks3Object object = result.getObject();
object.getObjectContent();

Head Object (View File Meta Information)

In the Java SDK, you can view the storage type by obtaining the meta information. The example code is as follows:

HeadObjectRequest request = new HeadObjectRequest(bucketName, key);
HeadObjectResult result =client.headObject(request);
String storageClass = result.getObjectMetadata().getStorageClass();

For standard storage files,getStorageClass returns null For standard low frequency storage files,getStorageClass returns STANDARD_IA For archive storage files,getStorageClass returns ARCHIVE

Enumeration Interface

Get Bucket (Enumerate All Files under Bucket)

When a user obtains a file under a bucket, KS3 returns its storage type for each file.

SDK Sample Code:

ListObjectsRequest request = new ListObjectsRequest(bucketName);
ObjectListing listing = client.listObjects(request);
for (Ks3ObjectSummary summary : listing.getObjectSummaries()) {
    String storageClas = summary.getStorageClass();
}

For standard storage files,getStorageClass returns STANDARD For standard low frequency storage files,getStorageClass returns STANDARD_IA For archive storage files,getStorageClass returns ARCHIVE

List Multipart Uploads (View Block Upload under Bucket)

When users view all the block upload requests under the current bucket, KS3 will return its storage type for each block upload.

SDK Sample Code:

ListMultipartUploadsRequest request = new ListMultipartUploadsRequest(bucketName);
ListMultipartUploadsResult result = client.listMultipartUploads(request);
for (MultiPartUploadInfo uploadInfo : result.getUploads()) {
    String storageClass = uploadInfo.getStorageClass();
}

For standard storage files,getStorageClass returns STANDARD For standard low frequency storage files,getStorageClass returns STANDARD_IA For archive storage files,getStorageClass returns ARCHIVE

List Parts (View Uploaded Blocks)

When the user lists the uploaded blocks of a block upload, KS3 will return the storage type of the current block upload.

SDK Sample Code:

ListPartsRequest reqest = new ListPartsRequest(bucketName, key, result.getUploadId());
ListPartsResult result = client.listParts(reqest);
String storageClass = result.getStorageClass();

For standard storage files,getStorageClass returns For standard low frequency storage files,getStorageClass returns STANDARD_IA For archive storage files,getStorageClass returns ARCHIVE

金山云,开启您的云计算之旅

注册有礼