Archive Storage Related

最近更新时间:2020-07-13 23:02:07


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.

If you want to take the archive storage type to store files, you can do so in the following ways:

  1. Using the upload interface, specify the request header x-kss-storage-class as ARCHIVE
  2. Create an archive type Bucket, which can be stored according to the default archive type without specifying the storage type.
  3. Set storage type conversion rules through life cycle conversion, and automatically convert to archive storage type according to the rules

Upload Interface

Put Object (Upload Archive)

When uploading files, if the request header x-kss-storage-class is not specified, if the bucket is the archive type, the object will be the archive type automatically. If the bucket is the non archive type, the object will be the standard type automatically. If the x-kss-storageClass of the object is specified, the user specified will prevail. For example, in the non archive storage space, the object specified. When the x-kss-storageClass of is ARCHIVE, the file is of archive storage type.

Bucket Type x-kss-storage-class Request Header File Type
Archive Storage Class No Upload Archived Class
Archive Storage Class ARCHIVE Archived Class
Archive Storage Class STANDAND Standard Class
Archive Storage Class STANDARD_IA Standard Infrequent Access Class
Non Archive Storage Class No Upload Standard Class
Non Archive Storage Class STANDAND Standard Class
Non Archive Storage Class STANDARD_IA Standard Infrequent Access Class
Non Archive Storage Class ARCHIVE Archived Class

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: STANDARDSTANDARD_IAARCHIVE. The rules are consistent with the upload file of Put Object. 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)

For replicated files, KS3 supports the reassignment of storage types. If the copy source file is an archive storage file, the precondition for successful copy is that the source file must be unfrozen and in a readable state.

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.

Restore Object

Detailed explanation Restore Object

Download Interface

Note The archive file must be unfrozen before it can be downloaded normally.

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 infrequent access 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 infrequent access 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 infrequent access 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 STANDARD.
For standard infrequent access storage files,getStorageClass returns STANDARD_IA.
For archive storage files,getStorageClass returns ARCHIVE.

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 STANDARD.
For standard infrequent access storage files,getStorageClass returns STANDARD_IA.
For archive storage files,getStorageClass returns ARCHIVE.

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

免费注册