All Products
Search
Document Center

ApsaraVideo VOD:RestoreMediaComplete

Last Updated:Jul 29, 2024

This topic describes the RestoreMediaComplete event and provides sample callbacks.

Event type

RestoreMediaComplete

Event description

The RestoreMediaComplete event is triggered after a media asset is restored. For more information about how to restore media assets, see Restore a media asset.

Event notification

Parameter

Type

Required

Description

EventTime

String

Yes

The time when the event was generated. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.

EventType

String

Yes

The event type. The value is RestoreMediaComplete.

Status

String

Yes

Indicates whether the restoration task is successful. Valid values:

  • Success

  • Failed

MediaId

String

Yes

The ID of the media asset. The ID can be the video ID or audio ID.

RestoreExpiration

String

No

The period of time in which the media asset remains in the restored state. The time is displayed in the yyyy-MM-ddTHH:mm:ssZ format and in UTC.

This parameter is returned when the media asset is restored.

ErrorCode

String

No

The error code. This parameter is returned if the media asset failed to be restored.

ErrorMessage

String

No

The error message. This parameter is returned if the media asset failed to be restored.

Sample callbacks

Description:

  • For an HTTP callback, the following example is the message body of the HTTP POST request.

  • For an MNS callback, the following example is the message body.

    • Example of successful restoration

      {
          "EventType": "RestoreMediaComplete",
          "EventTime": "2022-06-23T13:11:33Z",
          "Status": "Success",
          "MediaId": "71151b80f2d471ecb21b472190a9****",
          "RestoreExpiration": "2023-01-23T13:11:33Z"
      }
    • Example of failed restoration

      {
          "EventType": "RestoreMediaComplete",
          "EventTime": "2022-06-23T13:11:33Z",
          "Status": "Failed",
          "MediaId": "71151b80f2d471ecb21b472190a9****",
          "ErrorCode": "NoSuchKey",
          "ErrorMessage": "OSS bucket or object does not exist"
      }