Help Center> Object Storage Service> Console Operation Guide> Configuring an Online Decompression Policy (Beta Testing)

Configuring an Online Decompression Policy (Beta Testing)

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

To achieve online decompression, configure a decompression policy before a package upload. If an uploaded package matches the configured policy, OBS automatically decompresses the package. Decompression policies do not apply to the ZIP packages that already exist in OBS before the policies are created.

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

Online decompression is currently available only in the CN North-Beijing4, CN South-Guangzhou, and CN East-Shanghai2 regions.

Creating an Online Decompression Policy

  1. In the navigation pane on the left of OBS Console, choose Object Storage.
  2. In the bucket list, click a bucket name, and then the Overview page of the bucket is displayed.
  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, periods (.), 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 kinds of object creation operations, including PUT, POST, and COPY of objects, as well as the merging parts of multipart tasks
    • Put: object upload using PUT
    • Post: object upload using POST
    • Copy: object copying using COPY
    • CompleteMultipartUpload: merging parts of multipart tasks
      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 1024 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.

    Suffix

    If this parameter is specified, the decompression policy applies to the packages whose name contains this suffix. Currently, only ZIP packages are supported.

    Duplicate Name Processing

    This parameter 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 in the bucket, 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 with the same name 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 1023 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 folder in the bucket, the system automatically creates one for storing the decompressed 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 permission OBS OperateAccess assigned to this agency.

    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 on the left of OBS Console, choose Object Storage.
  2. In the bucket list, click a bucket name, and then the Overview page of the bucket is displayed.
  3. In the navigation pane, choose Data Processing > Online Decompression. The Online Decompression page is displayed.
  4. Click Replicate.
  5. Select a replication source, that is, the source bucket for which the online decompression policies were configured.

    • 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 the 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.