All Products
Search
Document Center

Virtual Private Cloud:UpdateGatewayRouteTableEntryAttribute

Last Updated:Jul 11, 2024

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.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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.

ap-southeast-6
IPv4GatewayRouteTableIdstringNo

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

vtb-5ts0ohchwkp3dydt2****
GatewayRouteTableIdstringYes

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

vtb-5ts0ohchwkp3dydt2****
ClientTokenstringNo

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 client 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.
123e4567-e89b-12d3-a456-426655440000
DryRunbooleanNo

Specifies whether to precheck only this request. Valid values:

  • true: prechecks the request without modifying the gateway route table. The system checks the required parameters, request format, and service limits. If the request fails to pass the precheck, an error code is returned. If the request passes the precheck, the DryRunOperation error code is returned.
  • false: sends the request. This is the default value. If the request passes the precheck, a 2xx HTTP status code is returned and the gateway route table is modified.
false
DestinationCidrBlockstringYes

The destination CIDR block of the route entry in the gateway route table.

47.100.XX.XX/16
NextHopTypestringYes

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

  • Instance: Elastic Compute Service (ECS) instance
  • NetworkInterface: elastic network interface (ENI)
  • Local: local next hop
EcsInstance
NextHopIdstringNo

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. This indicates a local next hop.
Note If the value of NextHopType is Instance or NetworkInterface, and you want to modify the next hop, you must set NextHopType to Local first. Then, set NextHopType to Instance or NetworkInterface and specify NextHopId based on your requirements. If the next hop type of a route entry is Instance or NetworkInterface, you cannot directly specify a different ENI ID or ECS instance ID for the NextHopId parameter.
i-bp18xq9yguxoxe7m****
NamestringNo

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.

test
DescriptionstringNo

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://.

new

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

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

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400OperationDenied.UpdateGatewayRouteEntryThe operation is not allowed because of need switch to local first.The system failed to modify the route. You must first set the next hop to a local route before you can set a custom next hop.
400IllegalParam.DestCidrBlockThe destCidrBlock is invalid.The specified destination address is invalid.
400ResourceNotFound.NetworkInterfaceThe specified resource nextHop is not found.The next hop instance does not exist.
400ResourceNotFound.RouteEntryThe specified resource routeEntry is not found.The specified route entry does not exist
400IncorrectStatus.RouteEntryThe status of %s [%s] is incorrect.Route entry is in non-steady state
400IncorrectStatus.VswitchThe status of %s [%s] is incorrect.The status of the specified vSwitch is incorrect.
400ResourceNotFound.InstanceThe specified resource nextHop is not found.The next hop instance does not exist.
400IncorrectStatus.NextHopThe status of %s [%s] is incorrect.Specified next hop resource
400OperationDenied.NextHopTypeNonsupportThe operation is not allowed because of nextHopType is nonsupport.Specifying the next hop of the resource type is not supported.
400OperationDenied.LocalEntryCanOnlyModifyNextHopOnly the nextHop parameter can be modified for a local route entry.You can modify only the next hop of a local route.
400ExclusiveParam.NextHopTypeAndNextHopIdThe param of nextHopType and nextHopId are mutually exclusive.The next hop type does not match the next hop instance.
400ResourceNotFound.RouteTableThe specified resource gatewayRouteTable is not found.The gateway route table does not exist.
400InvalidRouterInterfaceId.NotFoundThe specified RouterInterfaceId does not exist in our record.The specified router interface does not exist.
400OperationUnsupported.OnlySupportNormalNetworkInterfaceNext hop only supports binding normal network Interface.Next hop only supports binding to common ENIs

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

Change history

Change timeSummary of changesOperation
2023-12-19The Error code has changedView Change Details
2023-12-08The Error code has changedView Change Details
2023-08-07API Description Update. The Error code has changedView Change Details
2023-07-20API Description Update. The Error code has changedView Change Details
2023-05-05The Error code has changedView Change Details