All Products
Search
Document Center

:CreateVpcPrefixList

最終更新日:Aug 16, 2023

Creates a prefix list.

Usage notes

You cannot repeatedly call the CreateVpcPrefixList operation to create a prefix list in a region within the specified period of time.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateVpcPrefixList

The operation that you want to perform. Set the value to CreateVpcPrefixList.

PrefixListName String No name

The name of the prefix list.

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

PrefixListDescription String No description

The description of the prefix list.

The description must be 1 to 256 characters in length, and cannot start with http:// or https://.

ClientToken String No 123e4567-e89b-12d3-a456-426655440000

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.

Note If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
DryRun Boolean No false

Specifies whether to perform only a dry run, without performing the actual request. Valid values:

  • true: performs a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.
  • false (default): performs a dry run and sends the request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.
MaxEntries Integer No 50

The maximum number of CIDR blocks that you can specify in the prefix list. Default value: 50.

PrefixListEntries.N.Cidr String No 192.168.0.0/16

The CIDR block specified in the prefix list.

PrefixListEntries.N.Description String No CIDR

The description of the CIDR block specified in the prefix list.

The description must be 1 to 256 characters in length, and cannot start with http:// or https://.

ResourceGroupId String No rg-bp67acfmxazb4ph****

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

RegionId String Yes cn-hangzhou

The ID of the region where you want to create the prefix list.

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

IpVersion String No IPv4

The IP version. Valid values:

  • IPv4 (default)
  • IPv6
Tag.N.Key String No FinanceDept

The key of tag N to add to the resource. You can specify at most 20 tag keys. The tag key cannot be an empty string.

A tag key can be up to 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

Tag.N.Value String No FinanceJoshua

The value of tag N to add to the resource. You can specify at most 20 tag values. The tag value can be an empty string.

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

Response parameters

Parameter Type Example Description
PrefixListId String pl-0b700s2ee3***

The ID of the prefix list.

RequestId String 54B48E3D-DF70-471B-AA93-08E683A1B45

The request ID.

ResourceGroupId String rg-bp67acfmxazb4ph****

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

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateVpcPrefixList
&PrefixListName=name
&PrefixListDescription=description
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&DryRun=false
&MaxEntries=50
&PrefixListEntries=[{"Cidr":"192.168.0.0/16","Description":"CIDR"}]
&ResourceGroupId=rg-bp67acfmxazb4ph****
&RegionId=cn-hangzhou
&IpVersion=IPv4
&Tag=[{"Key":"FinanceDept","Value":"FinanceJoshua"}]
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateVpcPrefixListResponse>
    <PrefixListId>pl-0b700s2ee3***</PrefixListId>
    <RequestId>54B48E3D-DF70-471B-AA93-08E683A1B45</RequestId>
    <ResourceGroupId>rg-bp67acfmxazb4ph****</ResourceGroupId>
</CreateVpcPrefixListResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "PrefixListId" : "pl-0b700s2ee3***",
  "RequestId" : "54B48E3D-DF70-471B-AA93-08E683A1B45",
  "ResourceGroupId" : "rg-bp67acfmxazb4ph****"
}

Error codes

HttpCode Error code Error message Description
400 UnsupportedFeature.IpVersion The ipversion type is not supported. The error message returned because the ipVersion parameter is set to an invalid value.
400 QuotaExceeded.PrefixListCidrCount The quota of prefixListMaxEntry count is exceeded. The error message returned because the value of the entryCount parameter exceeds the upper limit.
400 OperationFailed.CidrCountExceedMaxCount The operation is failed because of cidrCountExceedMaxCount. The error message returned because the number of specified CIDR blocks exceeds the upper limit specified by the cidrMaxCount parameter.
400 IllegalParam.CidrBlock The param of cidrBlock is illegal. The error message returned because the cidrBlock parameter is set to an invalid value.
400 IllegalParam.CidrName The param of cidrName is illegal. The error message returned because the cidrName parameter is set to an invalid value.
400 DuplicatedParam.CidrBlock The param of cidrBlock is duplicated. The error message returned because a duplicate CIDR block is specified.
400 QuotaExceeded.PrefixListCount The quota of prefixList count is exceeded. The error message returned because the value of the prefixList parameter exceeds the upper limit.

For a list of error codes, see Service error codes.