Help Center> Object Storage Service> Console Operation Guide> Data Processing> Configuring an Online Decompression Policy
Updated on 2024-05-31 GMT+08:00

Configuring an Online Decompression Policy

You can compress multiple files into a ZIP package and then upload it to OBS for auto decompression online.

If the package you uploaded matches the configured decompression policy, it will be automatically decompressed upon upload. A decompression policy does not apply to the ZIP packages that already exist in OBS before the policy is created.

You can create online decompression policies or replicate existing policies from another bucket.

Online decompression is only available in some regions. For details, see Function Overview.

Creating an Online Decompression Policy

  1. In the navigation pane of OBS Console, choose Object Storage.
  2. In the bucket list, click the bucket you want to operate to go to the Objects page.
  3. In the navigation pane, choose Data Processing > Online Decompression. The Online Decompression page is displayed.
  4. Click Create. The dialog box shown in Figure 1 is displayed.

    Figure 1 Create Online Decompression Policy

  5. Configure the online decompression policy. Table 1 describes the related parameters.

    Table 1 Parameter description

    Parameter

    Description

    Policy Name

    Enter a policy name that is easy to remember. The value can contain 1 to 256 characters, and only uppercase letters, lowercase letters, digits, underscores (_), and hyphens (-) are allowed, for example, event_0001.

    Events

    Events that you want to trigger the online decompression policy for. Currently, the following event types are supported:

    • ObjectCreated: all object creation operations, including PUT, POST, COPY, and part assembling
    • Put: object upload using PUT
    • Post: object upload using POST
    • Copy: object copying using COPY
    • CompleteMultipartUpload: assembling of parts in a multipart upload
      NOTE:

      To decompress the ZIP package that contains other ZIP packages, set the event type to ObjectCreated or CompleteMultipartUpload.

    Prefix

    Optional. If this parameter is configured, the decompression policy applies to the packages whose name contains this prefix. The prefix cannot start with a slash (/) or contain double slashes (//), or contain special characters (\ : * ? " < > |). The total length of the prefix and suffix cannot exceed 512 characters.

    • With this parameter configured, ZIP packages whose name contains the specified prefix will trigger online decompression.
    • With this parameter left blank, the decompression policy applies to all the uploaded ZIP packages.
      CAUTION:
      • You are advised to configure a prefix. Otherwise, cyclic decompression may occur if a package contains other packages.
      • The configured prefix must contain all levels of the directory for storing the object.

        For example, there is an object example123 that is stored under bucket/file/example123. If you want example to be the prefix, set the prefix to file/example.

    Suffix

    If this parameter is specified, the decompression policy applies to the packages whose name contains this suffix. Currently, .zip is the default and only value.

    Duplicate Name Processing

    It specifies how the decompressed objects are processed if they have the same names as the existing objects in the bucket.
    • Do not decompress: Retains the existing objects, and does not decompress the objects with the same name.
    • Rename the file: Renames the decompressed objects with the CRC32 value.
    • Overwrite: Overwrites the existing objects in the bucket.

    Decompress To

    Optional, this parameter specifies the path for storing decompressed files. It cannot contain special characters (\ : * ? \ " < > |), start or end with a period (.), or contain two or more consecutive slashes (/). The value can contain 0 to 1,023 characters.
    • With this parameter configured, the path must end with a slash (/). After a ZIP package is decompressed, the decompressed files are stored in the folder with the same name as the path.

      If there is no such a folder in the bucket, OBS automatically creates one for storing the files.

    • With this parameter left blank, decompressed objects are stored in the home directory of the bucket.

    IAM Agency

    Select an IAM agency of OBS, with the OBS OperateAccess permission assigned.

    If no such agency is available, create one.

  6. Click OK. The online decompression policy is created.

Replicating Online Decompression Policies

  1. In the navigation pane of OBS Console, choose Object Storage.
  2. In the bucket list, click the bucket you want to operate to go to the Objects page.
  3. In the navigation pane, choose Data Processing > Online Decompression. The Online Decompression page is displayed.
  4. Click Replicate.
  5. Select a replication source, which is the bucket whose online decompression policies you want to replicate.

    • The online decompression policies replicated from a source bucket will not overwrite existing policies in the destination bucket, and any that conflict with the existing ones will not be replicated.
    • The version of both source and destination buckets must be 3.0.
    • You can remove the policies that you do not want to replicate.
    • There can be 10 online decompression policies at most in a bucket. If the number of policies you will replicate plus the number of existing policies in the destination bucket exceeds 10, the replication will fail. Before replicating the policies, delete some if necessary.
    Figure 2 Replicating online decompression policies

  6. Click OK to replicate the online decompression policies to the destination bucket.