DescribeLifecyclePolicies

Updated at:

Queries a list of lifecycle management policies.

Operation description

This feature is supported only by General-purpose NAS file systems and CPFS for Lingjun.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

nas:DescribeLifecyclePolicies

get

*LifecyclePolicy

acs:nas:{#regionId}:{#accountId}:filesystem/{#filesystemId}

None None

Request parameters

Parameter

Type

Required

Description

Example

FileSystemId

string

No

The ID of the file system.

31a8e4****

LifecyclePolicyName

string

No

Policy Name of the lifecycle policy. Policy Name must meet the following naming rules:

Policy Name must be 3 to 64 characters in length. It must start with a letter and can contain letters, digits, underscores (_), and hyphens (-).

Note

For General-purpose NAS file systems, this parameter is optional. If this parameter is specified, it takes precedence. If this parameter is not specified, LifecyclePolicyId is used.

lifecyclepolicy_01

PageSize

integer

No

The number of lifecycle management policies per page.

Valid values: 1 to 100.

Default value: 10.

10

PageNumber

integer

No

The page number.

Starting value (default value): 1.

1

StorageType

string

No

The tiered storage type. Valid values:

  • InfrequentAccess: IA storage class.

  • Archive: Archive storage class.

Note

If StorageType is not specified, all lifecycle policies are returned.

Valid values:

  • Archive :

    Archive storage class.

  • InfrequentAccess :

    IA storage class.

InfrequentAccess

LifecyclePolicyId

string

No

The ID of the lifecycle policy.

lc-xxx

LifecyclePolicyType

string

No

The policy type.

Valid values:

  • Auto: Automatic execution.

  • OnDemand: On-demand execution.

Note

Supported only by CPFS for Lingjun.

Valid values:

  • Auto :

    Automatic execution.

  • OnDemand :

    On-demand execution.

Auto

Description

string

No

The description of the policy.

Note

Supported only by CPFS for Lingjun.

Description

Path

string

No

Filters policies by path.

Note

Supported only by CPFS for Lingjun.

/abc/

Response elements

Element

Type

Description

Example

object

TotalCount

integer

The total number of lifecycle management policies.

10

RequestId

string

The ID of the request.

BC7C825C-5F65-4B56-BEF6-98C56C7C****

PageSize

integer

The number of lifecycle management policies per page.

10

PageNumber

integer

The page number.

1

LifecyclePolicies

array<object>

The lifecycle management policies.

array<object>

FileSystemId

string

The ID of the file system.

31a8e4****

LifecycleRuleName

string

The management rule associated with the lifecycle management policy.

Valid values:

  • DEFAULT_ATIME_14: Files that have not been accessed for 14 days.

  • DEFAULT_ATIME_30: Files that have not been accessed for 30 days.

  • DEFAULT_ATIME_60: Files that have not been accessed for 60 days.

  • DEFAULT_ATIME_90: Files that have not been accessed for 90 days.

DEFAULT_ATIME_14

CreateTime

string

The time when the lifecycle management policy was created.

The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.

2019-10-30T10:08:08Z

Path

string

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

/pathway/to/folder

StorageType

string

The tiered storage type. Valid values:

  • InfrequentAccess: IA storage class.

  • Archive: Archive storage class.

InfrequentAccess

LifecyclePolicyName

string

The name of the lifecycle management policy.

lifecyclepolicy_01

Paths

array

The absolute paths of the multiple directories configured for the lifecycle management policy.

string

The absolute paths of the multiple directories configured for the lifecycle management policy.

["/path1","/path2"]

LifecyclePolicyId

string

The ID of the lifecycle policy.

lc-xxx

Description

string

The description.

Description

LifecyclePolicyType

string

The policy type.

Auto

TransitRules

array<object>

The file data transition rules.

object

The file data transition rules.

Attribute

string

The attribute of the transition rule.

Atime

Threshold

string

The threshold of the transition rule.

3

RetrieveRules

array<object>

The file data retrieval rules.

object

The file data retrieval rules.

Attribute

string

The attribute of the retrieval rule.

RetrieveType

Threshold

string

The threshold of the retrieval rule.

All

DeleteRules

array<object>

The expiration and deletion rules for file data. You can configure up to one rule.

object

The expiration and deletion rules for file data. You can configure up to one rule.

Attribute

string

The attribute of the rule.

Valid values:

  • Atime: The access time of the file.

Atime

Threshold

string

The threshold of the rule.

Valid values:

  • If Attribute is set to Atime, the value indicates the number of days a file has not been accessed. Valid values: 1 to 365.

5

Examples

Success response

JSON format

{
  "TotalCount": 10,
  "RequestId": "BC7C825C-5F65-4B56-BEF6-98C56C7C****",
  "PageSize": 10,
  "PageNumber": 1,
  "LifecyclePolicies": [
    {
      "FileSystemId": "31a8e4****",
      "LifecycleRuleName": "DEFAULT_ATIME_14",
      "CreateTime": "2019-10-30T10:08:08Z",
      "Path": "/pathway/to/folder",
      "StorageType": "InfrequentAccess",
      "LifecyclePolicyName": "lifecyclepolicy_01",
      "Paths": [
        "[\"/path1\",\"/path2\"]"
      ],
      "LifecyclePolicyId": "lc-xxx",
      "Description": "Description",
      "LifecyclePolicyType": "Auto",
      "TransitRules": [
        {
          "Attribute": "Atime",
          "Threshold": "3"
        }
      ],
      "RetrieveRules": [
        {
          "Attribute": "RetrieveType",
          "Threshold": "All"
        }
      ],
      "DeleteRules": [
        {
          "Attribute": "Atime",
          "Threshold": "5"
        }
      ]
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

404 InvalidFileSystem.NotFound The specified file system does not exist. The specified file system does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.