Brief Introduction
Product Introduction
User Guide (Dash)
API
Overview
restV1
Term Description
Security Mechanism
Upload
Resource Management
List Bucket
Obtain Bucket Stat
Download Files
Delete Files
Uncompress zip package
Get File Info
List Resources
Fetch Resource
Move Resource
Copy Resource
Set File Retention Period
Convert Storage Classes
Restore Object
Advanced Resource Management
Appendix
SDK
restV2
Tools
Tutorials

Convert Storage Classes

Last update:2024-06-18 17:11:47

This API converts file storage types in Object Storage.

Request Syntax

To call this API, send a POST request in the following format:

POST /converttype/{encodedEntry}/{storageType}
Host: {mgrDomain}
Authorization: {managementcredential}

Parameter Description

The following table provides the necessary information and description of the parameters:

Parameter Required Description
param1 Yes Specifies the file whose storage type needs to be converted. The format is Urlsafe_Base64_Encode(bucket:key), where bucket is the name of the storage bucket, and key is the file name (including path). For example, to convert the storage type of the file 1.jpg in the bucket bucket1, this parameter should be YnVja2V0MToxLmpwZw==, which is the URL-safe Base64 encoded form of bucket1:1.jpg.
storageType Yes Specifies the target storage type. The available storage types are:
Standard - Standard Storage
IA - Infrequent Access Storage
Archive - Archive Storage
mgrDomain Yes The management domain. You can find the management domain in the Overview section of the bucket. The format is usually *.v1.wcsapi.com.
managementcredential Yes The management credential is used for authentication in API calls. For more details on creating the management credential, please refer to Management Credential.

Request Example

The following example shows how to initiate a request to convert the storage type using the curl command:

curl -v -X POST "http://mgrDomain/converttype/aW1hZ2VzOkltYWdlLnBuZw==/Standard"

Response Description

Successful Request

Upon a successful request, the response will be:

{"code": 200, "message": "ok"}

Failed Request

If the target storage type is the same as the original storage type, or if the original file is in Archive Storage and has not been restored first, the response will be:

{"code": 403, "message": "Invalid Object State"}

If the file does not exist, the response will be:

{"code": 403, "message": "File Not Found"}
Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!