CreatePrefixList
Creates a prefix list.
Operation description
Operation description
-
A prefix list is a collection of network prefixes, which are Classless Inter-Domain Routing. You can reference a prefix list when you configure network rules for other resources. For more information about prefix lists, see Prefix list overview.
-
When you create a prefix list:
You must specify an address family (IPv4 or IPv6) for the prefix list. Entries in the same prefix list must belong to the same address family, and the address family cannot be modified after the prefix list is created.
You must configure the Settings for the maximum number of entries for the prefix list, which cannot be modified after the prefix list is created.
You can specify entries for the prefix list. Each entry consists of a Classless Inter-Domain Routing and a description. The number of entries cannot exceed the maximum number of entries that you configured in the Settings.
-
For information about the limits on prefix lists and other resources, see Limits.
-
RAM users help you avoid sharing the credentials of your Alibaba Cloud account with other users. You can allocate least privilege to users on demand to reduce information security risks for your enterprise. For more information about how to grant prefix list-related permissions to Resource Access Management (RAM) users, see Grant prefix list-related permissions to RAM users.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:CreatePrefixList |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. |
cn-chengdu |
| MaxEntries |
integer |
Yes |
The maximum number of entries supported by the prefix list. Valid values: 1 to 200. |
10 |
| AddressFamily |
string |
Yes |
The address family of the prefix list. Valid values:
|
IPv4 |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see Ensure idempotence. |
0c593ea1-3bea-11e9-b96b-88e9fe637760 |
| PrefixListName |
string |
Yes |
The name of the prefix list. The name must be 2 to 128 characters in length, and must start with a letter or a Chinese character. It cannot start with |
PrefixListNameSample |
| Description |
string |
No |
The description of the prefix list. The description must be 2 to 256 characters in length, and cannot start with |
This is description. |
| Entry |
array<object> |
No |
The prefix list entry information. |
|
|
object |
No |
|||
| Description |
string |
No |
The description of the prefix list entry. The description must be 2 to 32 characters in length, and cannot start with |
Description Sample 01 |
| Cidr |
string |
Yes |
The Classless Inter-Domain Routing of the prefix list entry. Valid values of N: 0 to 200. Precautions:
For more information about Classless Inter-Domain Routing, see What is CIDR. Default value: empty. |
192.168.1.0/24 |
| 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. If you specify this parameter, it cannot be an empty string. The tag key can be up to 128 characters in length, and cannot start with |
TestKey |
| Value |
string |
No |
The tag value of the prefix list. Valid values of N: 1 to 20. This parameter can be an empty string. The tag value can be up to 128 characters in length, and cannot contain |
TestValue |
| ResourceGroupId |
string |
No |
The ID of the resource group to which the prefix list belongs. |
rg-bp67acfmxazb4p**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| PrefixListId |
string |
The ID of the prefix list. |
pl-x1j1k5ykzqlixdcy**** |
| RequestId |
string |
The request ID. |
38793DB8-A4B2-4AEC-BFD3-111234E9188D |
Examples
Success response
JSON format
{
"PrefixListId": "pl-x1j1k5ykzqlixdcy****",
"RequestId": "38793DB8-A4B2-4AEC-BFD3-111234E9188D"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | MissingParameter | %s | A parameter is not specified. |
| 400 | InvalidParameter.AddressFamily | The parameter AddressFamily should be IPv4 or IPv6. | The specified AddressFamily parameter is invalid. The valid values of this parameter are IPv4 and IPv6. |
| 400 | InvalidParameter | %s | The specified parameter is invalid. |
| 400 | InvalidParameter.PrefixListName | The parameter PrefixListName is not valid. | The prefix list name is invalid. |
| 400 | InvalidDescription.Malformed | The specified Description is wrongly formed. | |
| 400 | InvalidClientToken.ValueNotSupported | The ClientToken provided is invalid. | The specified ClientToken parameter is invalid. |
| 400 | InvalidParameter.CidrMalformed | %s | The specified CIDR block is invalid. |
| 400 | InvalidParameter.CidrDuplicated | %s | Duplicate CIDR blocks are specified. |
| 400 | LimitExceed.Entry | The number of entries added or removed exceeds the limit. | The number of entries to add or remove at a time exceeds the upper limit. |
| 400 | LimitExceed.MaxEntries | The number of entries exceeds the MaxEntries of the specified prefix list. | The number of specified entries exceeds the MaxEntries value. |
| 404 | LimitExceed.PrefixListPerRegion | The number of prefix lists in the region exceeds the limit. | The maximum number of prefix lists in the current region has been reached. |
| 404 | InvalidRegionId.NotFound | The specified RegionId does not exist. | The specified region ID does not exist. |
| 404 | InvalidResourceGroup.NotFound | The specified resource group is not found. | Cannot find the corresponding resource group |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.