Restore frozen objects with the OSS API

更新时间:
复制 MD 格式

If the object freezing feature of OSS compliance detection Inclusive Edition has frozen some of your objects, you can restore them by calling the OSS API.

OSS billing

Restoring frozen objects requires calling the OSS API. For pricing information, see Billing overview.

Step 1: Obtain the frozen object name

To restore a mistakenly frozen object, you must first obtain its name. You can obtain the name by using one of the following methods.

Method 1: Use a callback

If you configured a callback URL for notifications before creating the detection task, you can obtain the object name from the detection results sent to that URL. Example:

{
    "Code": 200,
    "Data": {
        "OssObjectName": "test/img.webp",
        "OssBucketName": "tmpsample",
        "OssRegionId": "cn-shanghai",
        "Results": [
            {
                "Service": "oss_baselineCheck",
                "riskLevel": "high",
                "Result": [
                    {
                        "Confidence": 95.89,
                        "Label": "sexual_partialNudity"
                    }
                ]
            }
        ]
    },
    "RequestId": "AAAAA-BBBBB-CCCC-DDDDD"
}

Method 2: Export results from the console

  1. Log on to the Content Moderation console.

  2. In the left-side navigation pane, choose OSS Scan Plus > Scan Tasks.

  3. Find the task whose data you want to export and click Actions in the View Results column. Set the search criteria and click the image icon to export.

    Note

    You can query and export up to 50,000 entries at a time. If a task has more than 50,000 entries, refine your search criteria before exporting.

Step 2: Restore the frozen object

The required restoration method depends on the freezing method you configured for the detection task.

Freezing method

Description

Actions

Modify permissions

This method changes the permissions of non-compliant objects from public-read or public-read-write to private, which prevents public access. You can, however, share these private objects with partners by using signed URLs. For more information, see Signature Version 1.

Call the Object ACL operation to restore the access permission of the object to a non-private state.

Move object

This method moves non-compliant objects to a backup directory in the bucket (${bucket}/alicip_riskfile_backup/) and deletes the original objects. OSS automatically creates this directory if it does not already exist.

Call the CopyObject operation to restore the object to its original path.