Modifies the configuration of a prefix list.

Usage notes

  • The ModifyVpcPrefixList operation is asynchronous. After you send the request, the system returns a request ID. However, the operation is still being performed in the system background. You can call the ListPrefixLists to query the status of a prefix list.
    • If the prefix list is in the Modifying state, the configuration of the prefix list is being modified.
    • If the prefix list is in the Created state, the configuration of the prefix list is modified.
    • After the configuration of the prefix list is modified, you can call the GetVpcPrefixListAssociations operation to query information about the network instances that are associated with the prefix list and determine whether the associated network instances use the new CIDR blocks. If the association status of the prefix list is Created, the new CIDR blocks are used by the network instances that are associated with the prefix list.
  • You cannot repeatedly call ModifyVpcPrefixList to modify the configuration of a prefix list 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 ModifyVpcPrefixList

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

PrefixListId String Yes pl-0b7hwu67****

The ID of the prefix list.

PrefixListName String No newname

The new name of the prefix list.

The name must be 1 to 128 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 value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters.

Note If you do not specify this parameter, the system uses RequestId as ClientToken. RequestId may be different for each API request.
DryRun Boolean No false

Specifies whether to only precheck the request. Valid values:

  • true: checks the request without performing the operation. The system prechecks the required parameters, request syntax, and limits. If the request fails the precheck, an error message is returned. If the request passes the precheck, the DryRunOperation error code is returned.
  • false (default): sends the request. If the request passes the check, a 2xx HTTP status code is returned and the operation is performed.
AddPrefixListEntry.N.Cidr String No 172.16.0.0/12

The CIDR block to be added to the prefix list.

Note If the CIDR block already exists in the prefix list, you can only modify the description of the CIDR block by setting the AddPrefixListEntry.N.Description parameter.
AddPrefixListEntry.N.Description String No newcidr

The description of the CIDR block to be added to the prefix list.

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

RemovePrefixListEntry.N.Cidr String No 192.168.0.0/16

The CIDR block that you want to delete from the prefix list.

RemovePrefixListEntry.N.Description String No cidr

The description of the CIDR block that you want to delete.

RegionId String Yes cn-hangzhou

The region ID of the prefix list.

PrefixListDescription String No newdescription

The new description of the prefix list.

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

MaxEntries Integer No 20

The maximum number of CIDR blocks supported by the prefix list after the configuration of the prefix list is modified.

Response parameters

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

The ID of the prefix list.

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

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ModifyVpcPrefixList
&PrefixListId=pl-0b7hwu67****
&PrefixListName=newname
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&DryRun=false
&AddPrefixListEntry=[{"Cidr":"172.16.0.0/12","Description":"newcidr"}]
&RemovePrefixListEntry=[{"Cidr":"192.168.0.0/16","Description":"cidr"}]
&RegionId=cn-hangzhou
&PrefixListDescription=newdescription
&MaxEntries=20
&Common request parameters

Sample success responses

XML format

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

<ModifyVpcPrefixListResponse>
    <PrefixListId>pl-0b7hwu67****</PrefixListId>
    <RequestId>54B48E3D-DF70-471B-AA93-08E683A1B45</RequestId>
</ModifyVpcPrefixListResponse>

JSON format

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

{
  "PrefixListId" : "pl-0b7hwu67****",
  "RequestId" : "54B48E3D-DF70-471B-AA93-08E683A1B45"
}

Error codes

HttpCode Error code Error message Description
400 ResourceNotFound.PrefixList The specified resource of prefixList is not found. The error message returned because the prefix list does not exist.
400 OperationFailed.CidrCountExceedMaxCount The operation is failed because of cidrCountExceedMaxCount. The error message returned because the specified number of CIDR blocks exceeds the upper limit.
400 OperationDenied.RemoveCountExceedExistCount The operation is not allowed because of remove-count exceed exist-count. The error message returned because the number of CIDR blocks to be deleted exceeds the number of current CIDR blocks.
400 DuplicatedParam.CidrBlock The param of cidrBlock is duplicated. The error message returned because a duplicate CIDR block is specified.
400 IllegalParam.CidrBlock The param of cidrBlock is illegal. The error message returned because cidrBlock is set to an invalid value.
400 IllegalParam.CidrName The param of cidrName is illegal. The error message returned because cidrName is set to an invalid value.
400 OperationFailed.OperateShareResource This is not allowed to operate shared prefixList. The error message returned because you cannot manage a shared prefix list.
400 IncorrectStatus.PrefixList The status of prefixList is incorrect. The error message returned because the prefix list is in an unstable state.
400 QuotaExceeded.PrefixListCidrCount The quota of prefixList entry maxEntry count is exceeded. The error message returned because the number of allowed routes exceeds the upper limit.
400 QuotaExceeded Route entry quota exceeded in associated route table. The error message returned because the maximum number of routes supported by the prefix list exceeds the maximum number of routes supported by the associated route table.

For a list of error codes, visit the API Error Center.