All Products
Search
Document Center

Virtual Private Cloud:ListPrefixLists

Last Updated:Mar 22, 2024

Queries prefix lists.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:ListPrefixListsList
  • PrefixList
    acs:vpc:{#regionId}:{#accountId}:prefixlist/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
PrefixListIdsarrayNo

The IDs of prefix lists to be queried. Valid values of N are 1 to 100, which specifies that you can query up to 100 prefix lists at a time.

stringNo

The ID of the prefix list.

pl-0b7hwu67****
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results. Valid values:

  • You do not need to specify this parameter for the first request.
  • You must specify the token that is obtained from the previous query as the value of NextToken.
FFmyTO70tTpLG6I3FmYAXGKPd****
MaxResultslongNo

The number of entries per page. Valid values: 1 to 100. Default value: 20.

20
ResourceGroupIdstringNo

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

rg-bp67acfmxazb4ph****
Tagsobject []No

The tags.

KeystringNo

The tag key. You can specify up to 20 tag keys. The tag key cannot be an empty string.

The key cannot exceed 64 characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). The key must start with a letter but cannot start with aliyun or acs:. The key cannot contain http:// or https://.

FinanceDept
ValuestringNo

The tag value. You can specify up to 20 tag values. The tag value can be an empty string.

The tag value cannot exceed 128 characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). The key must start with a letter but cannot start with aliyun or acs:. The key cannot contain http:// or https://.

FinanceJoshua
RegionIdstringYes

The ID of the region where you want to query prefix lists.

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

cn-hangzhou
PrefixListNamestringNo

The name of the prefix list to query.

The name must be 1 to 128 characters in length and cannot start with http:// or https://.

name

Response parameters

ParameterTypeDescriptionExample
object

The request ID.

RequestIdstring

The request ID.

DF72F7BB-5DFA-529C-887E-B0BB70D89C4F
NextTokenstring

A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

  • If NextToken is empty, no next page exists.
  • If a value is returned for NextToken, the value indicates the token that is used for the next request to retrieve a new page of results.
FFmyTO70tTpLG6I3FmYAXGKPd****
TotalCountlong

The total number of entries returned.

1
MaxResultslong

The number of entries per page. Valid values: 1 to 100. Default value: 20.

20
PrefixListsobject []

The information about the prefix lists.

PrefixListIdstring

The ID of the prefix list.

pl-m5estsqsdqwg88hjf****
PrefixListNamestring

The name of the prefix list.

test
PrefixListDescriptionstring

The description of the prefix list.

Created with oss service by system.
IpVersionstring

The IP version of the prefix list. Valid values:

  • IPV4
  • IPV6
IPV4
CreationTimestring

The time when the prefix list was created.

2022-07-12T14:22:32Z
CidrBlocksarray

The CIDR block specified in the prefix list.

string

The CIDR block specified in the prefix list.

100.115.XX.XX/24
ShareTypestring

Indicates whether the prefix list is shared. Valid values:

  • Shared: The prefix list is shared.
  • If an empty value is returned, the prefix list is not shared.
Shared
MaxEntriesinteger

The maximum number of CIDR blocks that you can specify in the prefix list.

10
Statusstring

The status of the prefix list. Valid values:

  • Created
  • Deleted
  • Modifying
Created
OwnerIdstring

The Alibaba Cloud account to which the prefix list belongs.

1210123456123456
PrefixListStatusstring

The status of the prefix list. Valid values:

  • Created
  • Deleted
  • Modifying
Note This parameter is the same as the Status parameter.
Created
RegionIdstring

The region ID of the prefix list.

cn-hangzhou
ResourceGroupIdstring

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

rg-bp67acfmxazb4ph****
Tagsobject []

The tags.

Keystring

The tag key.

FinanceDept
Valuestring

The tag value.

FinanceJoshua
PrefixListTypestring

The type of the prefix list.

Custom

Examples

Sample success responses

JSONformat

{
  "RequestId": "DF72F7BB-5DFA-529C-887E-B0BB70D89C4F",
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "TotalCount": 1,
  "MaxResults": 20,
  "PrefixLists": [
    {
      "PrefixListId": "pl-m5estsqsdqwg88hjf****",
      "PrefixListName": "test",
      "PrefixListDescription": "Created with oss service by system.",
      "IpVersion": "IPV4",
      "CreationTime": "2022-07-12T14:22:32Z",
      "CidrBlocks": [
        "100.115.XX.XX/24"
      ],
      "ShareType": "Shared",
      "MaxEntries": 10,
      "Status": "Created",
      "OwnerId": "1210123456123456",
      "PrefixListStatus": "Created",
      "RegionId": "cn-hangzhou",
      "ResourceGroupId": "rg-bp67acfmxazb4ph****",
      "Tags": [
        {
          "Key": "FinanceDept",
          "Value": "FinanceJoshua"
        }
      ],
      "PrefixListType": "Custom"
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
400IllegalParam.NextTokenThe specified NextToken is invalid.The specified NextToken is invalid.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-12-12The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Output ParametersThe response structure of the API has changed.