Modifies the next hop type and next hop of the route entry in a gateway route table.

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 UpdateGatewayRouteTableEntryAttribute

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

RegionId String Yes ap-southeast-6

The ID of the region to which the gateway route table that you want to modify belongs.

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

IPv4GatewayRouteTableId String Yes vtb-5ts0ohchwkp3dydt2****

The ID of the gateway route table that you want to modify.

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 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 only 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 code is returned. If the request passes the dry run, the DryRunOperation error code is returned.
  • false (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.
DestinationCidrBlock String Yes 47.100.XX.XX/16

The destination CIDR block of the route entry.

NextHopType String Yes EcsInstance

The new next hop type of the route entry. Valid values:

  • EcsInstance: an Elastic Compute Service (ECS) instance
  • NetworkInterface: an elastic network interface (ENI)
  • Local: a local next hop
NextHopId String No i-bp18xq9yguxoxe7m****

The new next hop ID of the route entry.

  • If you set NextHopType to Instance, specify an ECS instance ID for NextHopId.
  • If you set NextHopType to NetworkInterface, specify an ENI ID for NextHopId.
  • If you set NextHopType to Local, leave NextHopId empty, which specifies a local next hop.
Note If you want to modify a route entry whose next hop type is Instance or NetworkInterface, you must first change the value of NextHopType to Local. Then, change the value of NextHopType to Instance or NetworkInterface and specify NextHopId. When you modify a route entry whose next hop type is Instance or NetworkInterface, you cannot directly specify a different ENI ID or ECS instance ID for NextHopId.
Name String No test

The name of the gateway route table.

The name must be 2 to 128 characters in length and can contain letter, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.

Description String No new

The description of the gateway route table.

The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.

Response parameters

Parameter Type Example Description
RequestId String 54B48E3D-DF70-471B-AA93-08E683A1B45

The request ID.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UpdateGatewayRouteTableEntryAttribute
&RegionId=ap-southeast-6
&IPv4GatewayRouteTableId=vtb-5ts0ohchwkp3dydt2****
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&DryRun=false
&DestinationCidrBlock=47.100.XX.XX/16
&NextHopType=EcsInstance
&NextHopId=i-bp18xq9yguxoxe7m****
&Name=test
&Description=new
&Common request parameters

Sample success responses

XML format

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

<UpdateGatewayRouteTableEntryAttributeResponse>
    <RequestId>54B48E3D-DF70-471B-AA93-08E683A1B45</RequestId>
</UpdateGatewayRouteTableEntryAttributeResponse>

JSON format

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

{
  "RequestId" : "54B48E3D-DF70-471B-AA93-08E683A1B45"
}

Error codes

HttpCode Error code Error message Description
400 OperationDenied.UpdateGatewayRouteEntry The operation is not allowed because of need switch to local first. The error message returned because you must first set the next hop to a local next hop before you can set a custom next hop.
400 IllegalParam.DestCidrBlock The destCidrBlock is invalid. The error message returned because the specified CIDR block is invalid.
400 ResourceNotFound.NetworkInterface The specified resource nextHop is not found. The error message returned because the specified next hop does not exist.
400 ResourceNotFound.Instance The specified resource nextHop is not found. The error message returned because the specified next hop does not exist.
400 OperationDenied.LocalEntryCanOnlyModifyNextHop Only the nextHop parameter can be modified for a local route entry. You can modify only the next hop of a local route.

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