# Create Lifecycle Management - CreateUFileLifeCycle

## Overview

Create Lifecycle Management






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `CreateUFileLifeCycle`.                      | **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 |
|:---|:---|:---|:---|
| **Region** | string | Region. See [List of Regions and Availability Zones](/docs/api/summary/regionlist) |No|
| **ProjectId** | string | Project ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the [GetProjectList interface](/docs/api/summary/get_project_list). |No|
| **LifeCycleName** | string | Lifecycle Name |**Yes**|
| **Prefix** | string | The prefix applicable to the lifecycle; * for all files in the storage space; one rule only supports one file prefix. |**Yes**|
| **Status** | string | Enabled -- Enabled, Disabled -- Not enabled |**Yes**|
| **BucketName** | string | Storage Space Name |**Yes**|
| **Days** | int | Specify an expiration day N, the file will expire and be automatically deleted N days after its most recent update; parameter range: [7,36500], 0 represents not enabled. |No|
| **ArchivalDays** | int | Specify an expiration day N, the file will automatically change to the archive storage type N days after its most recent update time; parameter range: [7,36500], 0 represents not enabled. |No|
| **IADays** | int | Specify an expiration day N, the file will automatically change to the infrequent access storage type N days after its most recent update time; parameter range: [7,36500], 0 represents not enabled. |No|
| **HistVerDeleteDays** | int | A historical file expiration period N is specified, and the file will expire and be automatically deleted N days after its last modified time; range: [7,36500] |No|
| **HistVerArchivalDays** | int | A historical file expiration period N is specified, and the file will expire and be automatically deleted N days after its last modified time; range: [7,36500] |No|
| **HistVerIADays** | int | A historical file expiration period N is specified, and the file will expire and be automatically deleted N days after its last modified time; range: [7,36500] |No|
| **Tags** | string | Tag, parameter format 'k1=v1&k2=v2', the maximum length of key is 128, the maximum length of value is 256byte, the maximum number of tags is 10. |No|
| **MinSize** | int | Minimum size of the file |No|
| **MaxSize** | int | Maximum size of the file |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|
| **LifeCycleId** | string | Lifecycle Id |**Yes**|




## Example

### Request Example
    
```
https://api.genesissai.com/?Action=CreateUFileLifeCycle
&Region=cn-gd
&ProjectId=orf-sdfssd
&LifeCyCleName=lifecycle
&Prefix=test-
&Days=10
&Status=Enabled
&BucketName=lifecycle-test1
&ArchivalDays=1
&ArchivalDays=6
&IADays=2
&Tags=wMsqQyzv
&MinSize=2
&MaxSize=5
&HistVerDeleteDays=5
&HistVerArchivalDays=6
&HistVerIADays=2
```

### Response Example
    
```json
{
  "Action": "CreateUFileLifeCycleResponse",
  "LifeCycleId": "dc7eca04-edbc-4ae9-aefd-816253123456",
  "RetCode": 0
}
```





