# Create Decompression Rule - CreateUdsRule

## Overview

Automatically trigger decompression for files in object storage (US3).






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `CreateUdsRule`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.genesissai.com/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RuleName** | string | Rule Name |**Yes**|
| **SrcBucket** | string | Source Bucket name, globally unique |**Yes**|
| **SrcTokenId** | string | One of the tokens' tokenId from the source bucket |**Yes**|
| **DstBucket** | string | Target Bucket name, globally unique |**Yes**|
| **DstTokenId** | string | One of the target bucket's tokenIds |**Yes**|
| **DstDirectory** | string | Destination directory after decompression |**Yes**|
| **KeepUS3Name** | boolean | Whether to use the prefix of the compressed file as the last directory layer |**Yes**|
| **Prefixes** | string | Prefix Triggered by Decompression |**Yes**|
| **Ops.N** | string | The ops array of operations, "Ops.0":"unzip". |**Yes**|
| **Events.** | string | Array of notification events |No|
| **ContactGroupId** | string | Contacted User Group ID |No|
| **NotificationTypes.N** | string | Array of notification types |No|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **RuleId** | string | Rule ID for creating rules |**Yes**|




## Example

### Request Example
    
```
https://api.genesissai.com/?Action=CreateUdsRule
&RuleName="name"
&SrcBucketName="SrcBucketName"
&SrcTokenId="SrcTokenId"
&DstBucketName=“DstBucketName”
&DstTokenId="DstTokenId"
&DstDirectory="DstDirectory"
&KeepUS3Name=true
&Prefixes="Prefixes"
&Ops.0="Ops.0"
&Events.0="Events.0"
&Events.1="Events.0"
&ContactGroupId="ContactGroupId"
&NotificationTypes.0="NotificationTypes.0"
&NotificationTypes.1="NotificationTypes.0"
&RuleName="RuleName"
```

### Response Example
    
```json
{
  "Action": "CreateUdsRuleResponse",
  "Message": "xJSozFTo",
  "RetCode": 0,
  "RuleId": "RuleId"
}
```





