Creates a lifecycle management policy.

Description

You can create a up to 20 lifecycle management policies in one region within an Alibaba Cloud account.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateLifecyclePolicy

The operation that you want to perform.

Set the value to CreateLifecyclePolicy.

FileSystemId String Yes 31a8e4****

The ID of the file system.

LifecyclePolicyName String Yes lifecyclepolicy_01

The name of the lifecycle management policy.

LifecycleRuleName String Yes DEFAULT_ATIME_14

The rules in the lifecycle management policy.

Valid values:

  • DEFAULT_ATIME_14: Files that are not accessed in the last 14 days will be dumped to the IA storage medium.
  • DEFAULT_ATIME_30: Files that are not accessed in the last 30 days will be dumped to the IA storage medium.
  • DEFAULT_ATIME_60: Files that are not accessed in the last 60 days will be dumped to the IA storage medium.
  • DEFAULT_ATIME_90: Files that are not accessed in the last 90 days will be dumped to the IA storage medium.
StorageType String Yes InfrequentAccess

The storage type of the data that is dumped to the IA storage medium.

Default value: InfrequentAccess (IA).

Path String No /pathway/to/folder

The absolute path of the directory with which the lifecycle management policy is associated.

You can associate the policy with only one directory. The path must be prefixed by a forward slash (/). It must be a path that exists in the mount target.

Note We recommend that you configure the Paths.N parameter. This way, you can associate the policy with multiple directories at a time.
Paths.N RepeatList No "/path1", "/path2"

The absolute path of the directory for which the lifecycle management policy is configured.

You can configure the policy for multiple directories at a time. The value of N must be prefixed by a forward slash (/) and must be an existing path in the mount target. Valid values of N: 1 to 10.

Response parameters

Parameter Type Example Description
RequestId String BC7C825C-5F65-4B56-BEF6-98C56C7C****

The ID of the request.

Success Boolean true

Indicates whether the request has succeeded.

Valid values:

  • true: The request has succeeded.
  • false: The request has failed.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateLifecyclePolicy
&FileSystemId=31a8e4****
&LifecyclePolicyName=lifecyclepolicy_01
&LifecycleRuleName=DEFAULT_ATIME_14
&StorageType=InfrequentAccess
&<Common Request Parameters>

Sample success responses

XML format

<RequestId>BC7C825C-5F65-4B56-BEF6-98C56C7C****</RequestId>
<Success>true</Success>

JSON format

{
    "RequestId": "BC7C825C-5F65-4B56-BEF6-98C56C7C****",
    "Success": true
}

Error codes

HttpCode Error code Error message Description
400 OperationDenied.FileSystemNotSupportedForLifecycle The file system does not support lifecycle. The error message returned because the specified file system does not support lifecycle management.
400 OperationDenied.EncryptedFileSystemNotSupportedForLifecycle The encrypted file system does not support lifecycle. The error message returned because an encrypted file system does not support lifecycle management.
400 OperationDenied.LifecyclePolicyCountLimitExceeded The maximum number of LifecyclePolicies is exceeded. The error message returned because the upper limit for lifecycle management policies is reached.
400 InvalidLifecyclePolicy.AlreadyExist The specified LifecyclePolicy already exists. The error message returned because the specified lifecycle management policy exists.
400 InvalidParameter.PathsNumberExceed The maximum number of Path.N for this operation is 10. The error message returned because you cannot associate one policy with more than 10 paths.
400 InvalidFilesystemType.NotSupport The API operation does not support the file system type. The error message returned because this type of file system is not supported by the API.
400 InvalidParameter.PathOrPaths Either Path or Paths.N must be specified. The error message returned because you must specify only one of the Path and Paths.N parameters.
403 OperationDenied.NotSupportPaths.N Your request does not meet the gray condition. The Paths.N parameter is not supported. The error message returned because your request does not meet the canary release policy and the Paths.N parameter is not supported.
404 InvalidFileSystem.NotFound The specified file system does not exist. The error message returned because the specified file system does not exist.
404 InvalidParameter.PathNotExist The specified path does not exist. The error message returned because the specified path does not exist.

For a list of error codes, visit the API Error Center.