All Products
Search
Document Center

Elastic Compute Service:DescribePrefixLists

Last Updated:Sep 20, 2026

Queries information about one or more prefix lists.

Operation description

The request parameters AddressFamily, PrefixListId.N, and PrefixListName act as filters and have a logical AND relationship. If a parameter is empty, the corresponding filter does not take effect.

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

ecs:DescribePrefixLists

get

*PrefixList

acs:ecs:{#regionId}:{#accountId}:prefixlist/{#PrefixListId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID. You can call DescribeRegions to query the most recent region list.

cn-chengdu

PrefixListName

string

No

The name of the prefix list.

PrefixListNameSample

NextToken

string

No

The pagination token. Set this parameter to the NextToken value returned in the previous call. You do not need to set this parameter for the first request.

AAAAAdDWBF2****

MaxResults

integer

No

The number of entries per page for a paged query.

Maximum value: 100.

Default value: 10.

10

AddressFamily

string

No

The address family of the prefix list. Valid values:

  • IPv4

  • IPv6

Default value: empty, which indicates that information about all prefix lists is queried.

IPv4

PrefixListId

array

No

The prefix list ID. Valid values of N: 0 to 100.

pl-x1j1k5ykzqlixdcy****

string

No

The prefix list ID. Valid values of N: 0 to 100.

pl-x1j1k5ykzqlixdcy****

ResourceGroupId

string

No

The ID of the resource group to which the prefix list belongs.

rg-bp67acfmxazb4p****

Tag

array<object>

No

The tags.

object

No

The tags.

Key

string

No

The tag key of the prefix list. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

TestKey

Value

string

No

The tag value of the prefix list. Valid values of N: 1 to 20. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot contain http:// or https://.

TestValue

Response elements

Element

Type

Description

Example

object

NextToken

string

The pagination token returned in this call. If the return value is empty, no more data is available.

AAAAAdDWBF2****

RequestId

string

The request ID.

38793DB8-A4B2-4AEC-BFD3-111234E9188D

PrefixLists

object

PrefixList

array<object>

The prefix list information.

array<object>

CreationTime

string

The time when the prefix list was created. The time is displayed in ISO 8601 format in UTC.

2021-02-20T07:11Z

AssociationCount

integer

The number of associated resources.

1

MaxEntries

integer

The maximum number of entries that the prefix list supports.

20

Description

string

The description of the prefix list.

This is description.

AddressFamily

string

The address family of the prefix list. Valid values:

  • IPv4

  • IPv6

IPv4

PrefixListName

string

The name of the prefix list.

PrefixListNameSample

PrefixListId

string

The prefix list ID.

pl-x1j1k5ykzqlixdcy****

Tags

object

Tag

array<object>

The tags.

object

The tags.

TagValue

string

The tag key of the prefix list. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

TestKey

TagKey

string

The tag value of the prefix list. Valid values of N: 1 to 20. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot contain http:// or https://.

TestValue

ResourceGroupId

string

The ID of the resource group to which the prefix list belongs.

rg-bp67acfmxazb4p****

Examples

Success response

JSON format

{
  "NextToken": "AAAAAdDWBF2****",
  "RequestId": "38793DB8-A4B2-4AEC-BFD3-111234E9188D",
  "PrefixLists": {
    "PrefixList": [
      {
        "CreationTime": "2021-02-20T07:11Z",
        "AssociationCount": 1,
        "MaxEntries": 20,
        "Description": "This is description.",
        "AddressFamily": "IPv4",
        "PrefixListName": "PrefixListNameSample",
        "PrefixListId": "pl-x1j1k5ykzqlixdcy****",
        "Tags": {
          "Tag": [
            {
              "TagValue": "TestKey",
              "TagKey": "TestValue\n"
            }
          ]
        },
        "ResourceGroupId": "rg-bp67acfmxazb4p****\n"
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter %s The specified parameter is invalid.
400 LimitExceed.PrefixListId The specified number of PrefixListId exceeds the limit. The number of specified prefix list IDs exceeds the upper limit.
404 InvalidRegionId.NotFound The specified RegionId does not exist. The specified region ID does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.