Changing the OBS Storage Class for a Media Asset
Function
This API is used to change the OBS storage class for a media asset.
By default, media files are stored to the Standard storage class when they are uploaded to OBS. You can change the storage class to Infrequent Access or Archive.
-
Infrequent Access can be changed to Standard or Archive.
-
Archive can only be changed to Standard. It cannot be directly changed to Infrequent Access.
-
The storage class cannot be changed when a media asset has an ongoing task, such as snapshot capturing or transcoding.
About OBS billing:
-
Infrequent Access has a minimum storage duration of 30 days, and Archive requires a minimum of 90 days. If media files are restored or deleted before the minimum storage duration reaches, you will still be billed for that full storage duration.
-
You will be billed for restoring media assets from Infrequent Access or Archive to Standard.
Infrequent Access is used as an example here. If the actual storage duration is less than 30 days, you will still be billed for the full 30-day duration. If the actual storage duration exceeds 30 days, billing will be based on the actual number of days stored.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
URI
PUT /v1/{project_id}/asset/storage-mode
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
No |
String |
User token. This parameter is mandatory when token authentication is used. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
|
Authorization |
No |
String |
Authentication information. This parameter is mandatory for AK/SK authentication. |
|
X-Sdk-Date |
No |
String |
Time when a request is sent. This parameter is mandatory for AK/SK authentication. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
asset_id |
Yes |
String |
Original media asset ID. |
|
storage_mode |
Yes |
String |
Storage class. The options include:
|
|
restore_mode |
No |
String |
How the storage class is changed from Archive to another class. The options include:
|
|
days |
No |
Integer |
Time period when the storage class remains in Standard after being restored from Archive. Value range: 1 to 30. Unit: days |
|
restore_tier |
No |
String |
Archive restoration option.
Default value: EXPEDITED |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
task_result_array |
Array of TaskResult objects |
Delivery result of the task for changing the media asset storage class. |
|
Parameter |
Type |
Description |
|---|---|---|
|
asset_id |
String |
Media asset ID. |
|
status |
String |
Whether the task for changing the media asset storage class is successfully delivered. The options are:
|
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error description. |
Example Requests
This example changes the OBS storage class for a media asset.
PUT https://{endpoint}/v1/{project_id}/asset/storage-mode
Content-Type: application/json
{
"asset_id": "2305739f855413a84af9e6ad6e2b21be",
"storage_mode": "WARM"
}
Example Responses
Status code: 200
Returned when the request succeeded.
{
"task_result_array" : [ {
"asset_id" : "2305739f855413a84af9e6ad6e2b21be",
"status" : "SUCCEED"
} ]
}
Status code: 400
Returned when the request failed.
{
"error_code" : "VOD.10053",
"error_msg" : "The request parameter is illegal, illegal field: {xx}."
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Returned when the request succeeded. |
|
400 |
Returned when the request failed. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot