UpdateGatewayRouteTableEntryAttribute

更新时间:
复制 MD 格式

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

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vpc:UpdateGatewayRouteTableEntryAttribute

update

*RouteTable

acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

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

You can call the DescribeRegions operation to query the region ID.

ap-southeast-6

IPv4GatewayRouteTableId

string

No

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

vtb-5ts0ohchwkp3dydt2****

GatewayRouteTableId

string

No

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

vtb-5ts0ohchwkp3dydt2****

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 ClientToken value can contain only ASCII characters.

Note

If you do not specify this parameter, the system automatically uses the RequestId as the ClientToken. The RequestId of each API request is different.

123e4567-e89b-12d3-a456-426655440000

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run without modifying the gateway route table. The system checks the required parameters, request format, 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, an HTTP 2xx status code is returned and the gateway route table is modified.

false

DestinationCidrBlock

string

Yes

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

47.100.XX.XX/16

NextHopType

string

Yes

The next hop type of the route that you want to modify. Valid values:

  • Instance: ECS instance.

  • NetworkInterface: elastic network interface (ENI) instance.

  • Local: local.

Instance

NextHopId

string

No

The instance ID of the next hop that you want to modify.

  • If NextHopType is set to Instance, set NextHopId to the ID of the ECS instance.

  • If NextHopType is set to NetworkInterface, set NextHopId to the ID of the elastic network interface (ENI) instance.

  • If NextHopType is set to Local, leave NextHopId empty, which indicates a local next hop.

Note

If the next hop type of the route is Instance or NetworkInterface and you want to modify the next hop, you must first change NextHopType to Local, and then change NextHopType to Instance or NetworkInterface and specify the NextHopId. You cannot directly change the next hop from one ENI or ECS instance to another ENI or ECS instance.

i-bp18xq9yguxoxe7m****

Name

string

No

The name of the gateway route table.

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

test

Description

string

No

The description of the gateway route table.

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

new

RegionId

string

Yes

要修改的网关路由表所在地域 ID。

您可以通过调用 DescribeRegions 接口获取地域 ID。

ap-southeast-6

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

Examples

Success response

JSON format

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

Error codes

HTTP status code

Error code

Error message

Description

400 OperationDenied.UpdateGatewayRouteEntry The 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.
400 IllegalParam.DestCidrBlock The destCidrBlock is invalid. The specified destination address is invalid.
400 ResourceNotFound.NetworkInterface The specified resource nextHop is not found. The next hop instance does not exist.
400 ResourceNotFound.RouteEntry The specified resource routeEntry is not found. The specified route entry does not exist
400 IncorrectStatus.RouteEntry The status of %s [%s] is incorrect. Route entry is in non-steady state
400 IncorrectStatus.Vswitch The status of %s [%s] is incorrect. The status of the specified vSwitch is incorrect.
400 ResourceNotFound.Instance The specified resource nextHop is not found. The next hop instance does not exist.
400 IncorrectStatus.NextHop The status of %s [%s] is incorrect. Specified next hop resource
400 OperationDenied.NextHopTypeNonsupport The operation is not allowed because of nextHopType is nonsupport. Specifying the next hop of the resource type is not supported.
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.
400 ExclusiveParam.NextHopTypeAndNextHopId The param of nextHopType and nextHopId are mutually exclusive. The next hop type does not match the next hop instance.
400 ResourceNotFound.RouteTable The specified resource gatewayRouteTable is not found. The gateway route table does not exist.
400 InvalidRouterInterfaceId.NotFound The specified RouterInterfaceId does not exist in our record.
400 OperationUnsupported.OnlySupportNormalNetworkInterface Next hop only supports binding normal network Interface. Next hop only supports binding to common ENIs
400 UnsupportedRegion The feature is not supported in current region. The feature is not supported in the current region.
400 UnsupportedFeature.Ipv6GatewayRouteTable The feature of %s is not supported. The border gateway route table cannot be associated with the gateway.
400 OperationDenied.TrAttachmentIpv6Disabled The operation is not allowed because tr attachment Ipv6 is disabled. The operation is not allowed because tr attachment Ipv6 is disabled.
400 InvalidAttachment.NotFound The attachment is not found. The specified transit router does not exist.
400 BothEmptyParam.GatewayRouteTableIdAndIpv4GatewayRouteTableId The parameter GatewayRouteTableId and Ipv4GatewayRouteTableId cannot be empty at the same time. We recommend that you use GatewayRouteTableId. The parameter GatewayRouteTableId and Ipv4GatewayRouteTableId cannot be empty at the same time. We recommend that you use GatewayRouteTableId.
400 OperationUnsupported.Ipv6EntryOnPrimaryNetworkInterface You cannot create IPv6 route entries on a primary network interface. You cannot create an IPv6 route whose next hop is a primary ENI.
404 ResourceNotFound.GatewayLoadBalancerEndpoint GatewayLoadBalancerEndpoint instance not found. GatewayLoadBalancerEndpoint instance not found.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.