Last update:2024-06-18 17:11:47
This API converts file storage types in Object Storage.
To call this API, send a POST request in the following format:
POST /converttype/{encodedEntry}/{storageType}
Host: {mgrDomain}
Authorization: {managementcredential}
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. |
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"
Upon a successful request, the response will be:
{"code": 200, "message": "ok"}
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"}