All Products
Search
Document Center

Elastic Compute Service:DescribePrefixLists

Last Updated:Aug 27, 2026

Queries the information of prefix lists.

Operation description

You can specify the AddressFamily, PrefixListId.N, and PrefixListName request parameters in the request. Specified parameters have logical AND relations. Only the parameters that you set are included in the filter conditions.

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 the DescribeRegions operation to query the most recent region list.

cn-chengdu

RegionId

string

Yes

The region ID. You can call the DescribeRegions operation 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 that is used in the request to retrieve a new page of results. Set the value to the NextToken value returned in the last call to this operation. Leave this parameter empty the first time you call this operation.

AAAAAdDWBF2****

MaxResults

integer

No

The number of entries per page.

Valid values: 1 to 100.

Default value: 10.

10

AddressFamily

string

No

The IP address family. Valid values:

  • IPv4

  • IPv6

This parameter is empty by default, which indicates that all prefix lists are queried.

IPv4

PrefixListId

array

No

The IDs of prefix lists. Valid values of N: 0 to 100.

pl-x1j1k5ykzqlixdcy****

string

No

The ID of prefix list N. 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 of the prefix list.

object

No

Tag N of the prefix list.

Key

string

No

The key of tag N 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. It cannot start with aliyun or acs: and cannot contain http:// or https://.

TestKey

Value

string

No

The value of tag N 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 query token that is returned in this call. If the return value is empty, no more data is returned.

AAAAAdDWBF2****

RequestId

string

The request ID.

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

PrefixLists

object

PrefixList

array<object>

Details about the prefix lists.

array<object>

CreationTime

string

The time when the prefix list was created.

2021-02-20T07:11Z

AssociationCount

integer

The number of associated resources.

1

MaxEntries

integer

The maximum number of entries that the prefix list can contain.

20

Description

string

The description of the prefix list.

This is description.

AddressFamily

string

The IP address family of the prefix list. Valid values:

  • IPv4

  • IPv6

IPv4

PrefixListName

string

The name of the prefix list.

PrefixListNameSample

PrefixListId

string

The ID of the prefix list.

pl-x1j1k5ykzqlixdcy****

Tags

object

Tag

array<object>

The tags of the prefix list.

object

The tag of the prefix list.

TagValue

string

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

TestKey

TagKey

string

The tag value. A prefix list can have 1 to 20 tags. 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.