Help Center/ Video On Demand/ API Reference/ Media Asset Storage Mode Management/ Changing the OBS Storage Class of a Media Asset
Updated on 2024-12-04 GMT+08:00

Changing the OBS Storage Class of a Media Asset

Function

Changes the OBS storage class of a media file.

By default, the Standard storage class applies to media file upload. You can change the storage class to Infrequent Access or Archive.

  • Infrequent Access can be changed to Standard or downgraded to Archive.

  • Archive can only be changed to Standard and cannot be directly changed to Infrequent Access.

About OBS billing:

  • The minimum storage period of Infrequent Access is 30 days, and that of Archive is 90 days. If media files are retrieved or deleted before the storage period expires, you will still be charged based on the minimum storage period.

    Infrequent Access is used as an example. If the actual storage period is < 30 days, you will be charged based on the minimum storage period (30 days). If the actual storage period is ≥ 30 days, you will be charged based on the actual storage period.

  • You will be charged for media file retrieval when changing the storage class from Infrequent Access or Archive to Standard.

URI

PUT /v1/{project_id}/asset/storage-mode

Table 1 Path Parameters

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

Table 2 Request header 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 a token.

Authorization

No

String

Authentication information. This parameter is mandatory for AK/SK authentication.

X-Sdk-Date

No

String

Time when the request is sent. This parameter is mandatory for AK/SK authentication.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

asset_id

Yes

String

Original media asset ID.

storage_mode

Yes

String

Storage mode.

Options:

  • STANDARD: OBS Standard

  • WARM: Infrequent Access

  • COLD: Archive

restore_mode

No

String

How the storage class is changed from Archive to another option.

Options:

  • TEMP: temporarily

  • FOREVER: permanently

days

No

Integer

Time when the storage class is temporarily changed from Archive to Standard.

Value range: 1–30. Unit: day

restore_tier

No

String

Archive restoration options:

  • EXPEDITED: quick restoration

  • STANDARD: standard restoration

Default value: EXPEDITED

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

task_result_array

Array of TaskResult objects

Delivery result of the task for changing the media asset storage mode.

Table 5 TaskResult

Parameter

Type

Description

asset_id

String

Media asset ID.

status

String

Checks whether the task for changing the media asset storage mode is successfully delivered. Options:

  • SUCCEED

  • FAILED

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error description

Example Requests

Changing the OBS Storage Class of 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

The information is returned when the request succeeded.

{
  "task_result_array" : [ {
    "asset_id" : "2305739f855413a84af9e6ad6e2b21be",
    "status" : "SUCCEED"
  } ]
}

Status code: 400

The information is 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

The information is returned when the request succeeded.

400

The information is returned when the request failed.

Error Codes

See Error Codes.