Creates a lifecycle management policy.
Operation description
Only General-purpose NAS file systems and CPFS for Lingjun support creating lifecycle management policies.
Each CPFS for Lingjun file system supports a maximum of 10 Auto-type and 100 OnDemand-type lifecycle management policies.
A maximum of 20 lifecycle management policies can be created 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 file system ID. |
31a8e4**** |
| LifecyclePolicyName |
string |
No |
The Policy Name of the lifecycle management policy. The name must be 3 to 64 characters in length, start with an uppercase letter or lowercase letter, and can contain letters, digits, underscores (_), or 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. Only General-purpose NAS is supported.
Note
Only General-purpose NAS is supported. For General-purpose NAS, use 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. Only General-purpose NAS is supported. Valid values:
Note
Valid values:
|
DEFAULT_ATIME_14 |
| StorageType |
string |
Yes |
The storage type.
Note
General-purpose NAS supports InfrequentAccess and Archive. CPFS for Lingjun supports only InfrequentAccess. Valid values:
|
InfrequentAccess |
| Paths |
array |
No |
The absolute paths of directories associated with the lifecycle management policy. |
"/path1", "/path2" |
|
string |
No |
The absolute path of a 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, start with a letter, and can contain letters, digits, underscores (_), or hyphens (-). Note
Only CPFS for Lingjun is supported. |
描述 |
| LifecyclePolicyType |
string |
No |
The policy type.
Valid values:
|
Auto |
| TransitRules |
array<object> |
No |
The file data transit rules. A maximum of one rule can be configured. Note
Supported only when LifecyclePolicyType is set to Auto for CPFS for Lingjun file systems. |
|
|
object |
No |
The file data transit rule. A maximum of one rule can be configured. Note
Supported only when LifecyclePolicyType is set to Auto for CPFS for Lingjun file systems. |
||
| Attribute |
string |
No |
The rule attribute. Valid values:
Valid values:
|
Atime |
| Threshold |
string |
No |
The rule threshold. Valid values:
|
3 |
| RetrieveRules |
array<object> |
No |
The file data retrieval rules. A maximum of one rule can be configured. Note
Only CPFS for Lingjun file systems are supported. Note
When LifecyclePolicyType is set to OnDemand, at least one of TransitRules or RetrieveRules must be specified. |
|
|
object |
No |
The file data retrieval rule. A maximum of one rule can be configured. |
||
| Attribute |
string |
No |
The rule attribute. Valid values:
Valid values:
|
RetrieveType |
| Threshold |
string |
No |
The rule threshold. Valid values:
Valid values:
|
All |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
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. | |
| 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.