Creates a lifecycle management policy.
Operation description
Only General-purpose NAS file systems and CPFS for Lingjun support the creation of lifecycle management policies.
You can create up to 10 Auto-type and 100 OnDemand-type lifecycle management policies for each CPFS for Lingjun file system.
You can create up to 20 lifecycle management policies for General-purpose NAS in each region.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
nas:CreateLifecyclePolicy |
create |
*LifecyclePolicy
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| FileSystemId |
string |
Yes |
The ID of the file system. |
31a8e4**** |
| LifecyclePolicyName |
string |
No |
The lifecycle management policy name. The name must be 3 to 64 characters in length, and must start with an uppercase letter or a lowercase letter. It can contain letters, digits, underscores (_), and hyphens (-). Note
This parameter is required for General-purpose NAS, but not required for CPFS for Lingjun. |
lifecyclepolicy_01 |
| Path |
string |
No |
The absolute path of the directory associated with the lifecycle management policy. This parameter is supported only by General-purpose NAS.
Note
This parameter is supported only by General-purpose NAS. For General-purpose NAS, configure Paths.N to associate multiple directories at the same time.
|
/pathway/to/folder |
| LifecycleRuleName |
string |
No |
The management rule associated with the lifecycle management policy. This parameter is supported only by General-purpose NAS. Valid values:
Note
Valid values:
|
DEFAULT_ATIME_14 |
| StorageType |
string |
Yes |
The tiered storage type.
Note
General-purpose NAS supports both InfrequentAccess and Archive. CPFS for Lingjun supports only InfrequentAccess. Valid values:
|
InfrequentAccess |
| Paths |
array |
No |
The absolute paths of the directories associated with the lifecycle management policy. |
"/path1", "/path2" |
|
string |
No |
The absolute path of the directory associated with the lifecycle management policy. Multiple directories can be associated. The path must start with a forward slash (/) and must be an existing path in the mount target. Valid values of N: 1 to 10. Note
|
“/path1" |
|
| Description |
string |
No |
The description of the lifecycle policy. Format: The description must be 3 to 64 characters in length, and must start with a letter. It can contain letters, digits, underscores (_), and hyphens (-). Note
This parameter is supported only by CPFS for Lingjun. |
Description |
| LifecyclePolicyType |
string |
No |
The policy type.
Valid values:
|
Auto |
| TransitRules |
array<object> |
No |
The file data transit rules. You can configure up to 1 rule. Note
This parameter is supported only when LifecyclePolicyType is set to Auto for CPFS for Lingjun file systems. |
|
|
object |
No |
The file data transit rule. You can configure up to 1 rule. Note
This parameter is supported only when LifecyclePolicyType is set to Auto for CPFS for Lingjun file systems. |
||
| Attribute |
string |
No |
The attribute of the rule. Valid values:
Valid values:
|
Atime |
| Threshold |
string |
No |
The threshold of the rule. Valid values:
|
3 |
| RetrieveRules |
array<object> |
No |
The file data retrieval rules. You can configure up to 1 rule. Note
This parameter is supported only by CPFS for Lingjun file systems. Note
When LifecyclePolicyType is set to OnDemand, you must specify at least one of the active transition rules (TransitRules) and retrieval rules (RetrieveRules). |
|
|
object |
No |
The file data retrieval rule. You can configure up to 1 rule. |
||
| Attribute |
string |
No |
The attribute of the rule. Valid values:
Valid values:
|
RetrieveType |
| Threshold |
string |
No |
The threshold of the rule. Valid values:
Valid values:
|
All |
| DeleteRules |
array<object> |
No |
The file data expiration and deletion rules. You can configure up to 1 rule. |
|
|
object |
No |
The file data expiration and deletion rules. You can configure up to 1 rule. |
||
| Attribute |
string |
No |
The attribute of the rule. Valid values:
Valid values:
|
Atime |
| Threshold |
string |
No |
The threshold of the rule. Valid values:
|
1 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The ID of the request. |
BC7C825C-5F65-4B56-BEF6-98C56C7C**** |
| Success |
boolean |
The request status. Valid values:
|
true |
| LifecyclePolicyId |
string |
The ID of the lifecycle policy. |
lsp-bp1234567890ab**** |
Examples
Success response
JSON format
{
"RequestId": "BC7C825C-5F65-4B56-BEF6-98C56C7C****",
"Success": true,
"LifecyclePolicyId": "lsp-bp1234567890ab****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | OperationDenied.FileSystemNotSupportedForLifecycle | The file system does not support lifecycle. | The file system does not support lifecycle. |
| 400 | OperationDenied.EncryptedFileSystemNotSupportedForLifecycle | The encrypted file system does not support lifecycle. | The encrypted file system does not support lifecycle. |
| 400 | OperationDenied.LifecyclePolicyCountLimitExceeded | The maximum number of LifecyclePolicies is exceeded. | The maximum number of LifecyclePolicies is exceeded. |
| 400 | InvalidLifecyclePolicy.AlreadyExist | The specified LifecyclePolicy already exists. | The specified LifecyclePolicy already exists. |
| 400 | InvalidParameter.PathsNumberExceed | The maximum number of Path.N for this operation is 10. | The maximum number of Path.N for this operation is 10. |
| 400 | InvalidFilesystemType.NotSupport | The API operation does not support the file system type. | The API operation does not support the file system type. |
| 400 | InvalidParameter.PathOrPaths | Either Path or Paths.N must be specified. | Either Path or Paths.N must be specified. |
| 400 | MissingFileSystemId | FileSystemId is mandatory for this action. | The FileSystemId parameter is not specified. |
| 400 | Lifecycle.Count.Exceeded | The lifecycle policy count exceeds the max limit per type per filesystem. | Lifecycle policy exceeds limit. |
| 403 | OperationDenied.NotSupportPaths.N | Your request does not meet the gray condition. The Paths.N parameter is not supported. | Your request does not meet the gray condition. The Paths.N parameter is not supported. |
| 404 | InvalidFileSystem.NotFound | The specified file system does not exist. | The specified file system does not exist. |
| 404 | InvalidParameter.PathNotExist | The specified path does not exist. | The specified path does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.