All Products
Search
Document Center

:PublishVpnRouteEntry

最終更新日:Aug 25, 2023

Advertises a policy-based or destination-based route of a VPN gateway to a virtual private cloud (VPC) 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

PublishVpnRouteEntry

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

RegionId

String

Yes

cn-hangzhou

The ID of the region where the VPN gateway is created.

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

ClientToken

String

No

d7d24a21-f4ba-4454-9173-b382****

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 and cannot exceed 64 characters in length.

Note

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

VpnGatewayId

String

Yes

vpn-bp1a3kqjiiq9legfx****

The ID of the VPN gateway.

RouteDest

String

Yes

10.0.0.0/24

The destination CIDR block of the VPN gateway route.

NextHop

String

Yes

vco-bp15oes1py4i66rmd****

The next hop of the VPN gateway route.

RouteType

String

Yes

pbr

The type of the VPN gateway route. Valid values:

  • pbr: policy-based route

  • dbr: destination-based route

PublishVpc

Boolean

Yes

true

Specifies whether to advertise the VPN gateway route to the VPC route table. Valid values:

  • true

  • false

Response parameters

Parameter

Type

Example

Description

RequestId

String

5BE01CD7-5A50-472D-AC14-CA181C5C03BE

The request ID.

Examples

Sample requests

http(s)://[Endpoint]/?Action=PublishVpnRouteEntry
&RegionId=cn-hangzhou
&ClientToken=d7d24a21-f4ba-4454-9173-b382****
&VpnGatewayId=vpn-bp1a3kqjiiq9legfx****
&RouteDest=10.0.0.0/24
&NextHop=vco-bp15oes1py4i66rmd****
&RouteType=pbr
&PublishVpc=true
&Common request parameters

Sample success responses

XML format

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

<PublishVpnRouteEntryResponse>
    <RequestId>5BE01CD7-5A50-472D-AC14-CA181C5C03BE	</RequestId>
</PublishVpnRouteEntryResponse>

JSON format

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

{
  "RequestId" : "5BE01CD7-5A50-472D-AC14-CA181C5C03BE\t"
}

Error codes

HttpCode

Error code

Error message

Description

400

Resource.QuotaFull

The quota of resource is full

The resource quota is exhausted.

400

VpnGateway.Configuring

The specified service is configuring.

The operation is not allowed when the specified service is being configured. Try again later.

400

VpnGateway.FinancialLocked

The specified service is financial locked.

The service is suspended due to overdue payments. Top up your account balance first.

400

VpnRouteEntry.AlreadyExists

The specified route entry is already exist.

The route already exists.

400

VpnRouteEntry.Conflict

The specified route entry has conflict.

The specified route conflicts with an existing route.

400

InvalidVpnRouteEntry.NotFound

The specified route entry does not exist.

The route is not found.

400

OperationFailed.InvalidStatus

Route entry is not allowed to operate in current status.

You are not allowed to manage the route in the current state.

400

OperationFailed.RouteConflict

Operation failed because there is already a route in VPC route table to another VPN on the same network block.

A route that points to another VPN gateway already exists in the same CIDR block in the route table of the VPC.

400

OperationFailed.InvalidCidrBlock

Operation failed because the specified network block is invalid.

The CIDR block is invalid.

400

OperationFailed.RouteConflict

Operation failed because there is already a route in VPC route table to a non-RI and non-VPN next hop on the same network block.

A route that points to another VPN gateway already exists in the same CIDR block in the route table of the VPC.

400

QuotaExceeded.VpnRouteEntry

The number of route entries to the VPN gateway in the VPC routing table has reached the quota limit.

The number of routes that point to the VPN gateway in the VPC route table reaches the upper limit.

400

TaskConflict

The operation is too frequent, please wait a moment and try again.

Your requests are too frequent. Try again later.

400

IllegalParam.CidrBlock

The specified CidrBlock is illegal.

CidrBlock is set to an invalid value.

400

QuotaExceeded

Route entry quota exceeded in this route table.

The number of route entries in the route table has reached the upper limit.

400

MissingParameter

Miss mandatory parameter.

One or more required parameters are not set. Check whether you have set all required parameters before you call this operation.

400

InvalidCidrBlock.Malformed

Specified CIDR block is not valid.

The format of the specified CIDR block is invalid.

400

InvalidCIDRBlock.Duplicate

Specified CIDR block is already exists.

The specified CIDR block already exists in the route table.

400

IncorrectVpcStatus

Current VPC status does not support this operation.

This operation cannot be performed when the VPC is in the current state.

400

IncorrectInstanceStatus

Current instance status does not support this operation.

This operation cannot be performed while the instance is in the current state.

400

IncorrectRouteEntryStatus

Some route entry status blocked this operation.

One or more routes in the current route table are in the Pending or Modifying state.

400

IncorrectVSwitchStatus

The current virtual switch status does not support this operation.

The vSwitch is in the Pending state and cannot be deleted.

400

InvalidCidrBlock

Specified CIDR block is not valid.

The error message returned for one of the following reasons: 1. You are unauthorized to use the 10.0.0.0/8 CIDR block. Check whether your account is included in the whitelist to use the CIDR block. 2. The destination CIDR block of the added custom route entry cannot be a subset of the CIDR blocks of the vSwitches in the VPC. 3. The CIDR block cannot be 100.64.0.0/10.

400

InvalidNextHopType

Specified parameter "NextHopType" is not valid

The specified next hop type is invalid.

400

InvalidNextHop.NotFound

Specified next hop does not exist.

The specified next hop does not exist.

400

InvalidVRouter.NotFound

vRouter not exists.

The specified vRouter does not exist. Check whether the specified vRouter is valid.

400

InvalidVPC.NotFound

vpc not exists.

The specified VPC does not exist. Check whether the specified VPC is valid.

400

InvalidNexthopTypeAndList.BothNull

both nexthopType and nextHopList are null.

NextHopType and NextHopList are not specified.

400

InvalidNexthopTypeAndList.BothNotNull

both nexthopType and nextHopList are not null.

You cannot leave both NextHopType and the NextHopList empty.

400

InvalidRouterInterface

invalid router interface.

The specified router interface does not exist.

400

InvalidOppositeRouterType

nexthop list cannot only contain router interface whose opposite router interface is on vbr.

The specified next hop is invalid. The peer router of the router interface that you specify as the next hop must be a VBR.

400

InvalidNexthopListSize

nexthop size is illegal. Must be between 2 and 4.

You must specify two to four router interfaces as next hops.

400

InvalidEntryRuleQuota.NotFound

Route entry quota rule not exists.

The quota rules of route entries do not exist.

400

Forbidden.CheckEntryRuleQuota

Route entry quota rule check error.

An error occurred when the system was checking the quota of route entries.

400

InvalidVBRStatus

invalid virtual border router status.

The VBR is in an invalid state.

400

InvalidPhysicalConnectionBusinessStatus

invalid physical connection business status.

The Express Connect circuit is in an invalid state.

400

IncorrectHaVipStatus

This operation is denied because satus of the specified HaVip is neither Available nor InUse.

You cannot perform the operation when the specified HAVIP is in the Available or InUse state.

400

CountLimitExceed.HaVipRouteEntry

There can be 5 route entry to HaVip at most in one route table.

The number of route entries that point to the HAVIP has reached the upper limit.

400

InvalidRouteEntry.Duplicate

The route entry already exist.

The specified route entry already exists.

400

IncorrectRouteEntryStatus

Specified routeEntry status error.

One or more routes in the current route table are in the Pending or Modifying state.

400

IncorrectRouteEntryStatus

VBR has NotStable route entry.

One or more routes in the current VBR are in the Pending or Modifying state.

400

INVALID_WEIGHT_PARAM

Specified value of weight invalid

The specified weight is invalid.

400

FORBIDDEN_USE_VPC_AS_INTERNET_GATEWAY

The Specified CIDR must be in vpc CIDR.

The specified CIDR block must be a subset of the VPC CIDR block.

400

INVALID_VPC_ID

The Specified VpcId not match.

The VPC is not found.

400

InvalidRouteEntrySize

The Specified routerEntry size not legal.

You must specify two to four router interfaces as next hops if you want to configure ECMP routing.

400

RouteConflict.AlreadyExist

Route conflict exists in routing table.

Route conflicts exist in the route table.

400

InvalidRouteEntryName.Malformed

Specified RouteEntry name is not valid.

The name of the route entry is invalid.

400

Duplicated.VpcNextHop

Route entry nexthop duplicate.

Duplicate next hops are specified.

400

InvalidNexthop.DirectEni

The direct Eni cannot be nexthop.

An ENI in cut-through mode cannot be specified as a next hop.

400

InvalidAttachment.NotFound

The attachment is not found.

The specified transit router does not exist.

400

OperationFailed.ActiveNetworkInterfaceNotFound

No active network interface is found on the attachment.

No ENI is available on the specified transit router.

400

InvalidNetworkInterface.NotFound

The network interface is not found on the attachment.

No ENI is associated with the specified transit router.

400

OperationFailed.QueryAttachmentInfo

Failed to query attachment information.

The system fails to query the transit router.

400

IllegalParam.AttachmentId

The attachment is invalid.

The specified transit router is invalid.

400

OperationFailed.NotSupportIPV6

The specified next hop does not support IPv6.

The specified next hop does not support IPv6.

400

IncorrectStatus.Ipv6Address

The IPv6 address of the specified next hop is being assigned or deleted.

An IPv6 address is being assigned to or removed from the next hop.

400

OperationUnsupported.Ipv6EntryOnPrimaryNetworkInterface

You cannot create IPv6 route entries on a primary network interface.

You cannot create an IPv6 route entry whose next hop is a primary ENI.

400

OperationUnsupported.SpecifyIpOnIpv6Entry

You cannot specify the private IP address when you create IPv6 route entries.

You cannot specify a private IPv6 address as the destination CIDR block.

400

OperationUnsupported.MutipleIpv6Address

You cannot specify a next hop that has bound multiple IPv6 addresses.

You cannot specify a next hop that is assigned multiple IPv6 addresses.

400

OperationDenied.Ipv6EntryOnCustomTable

You cannot create any IPv6 route entry on a custom route table.

You cannot add an IPv6 route entry to a custom route table.

403

Forbbiden.SubUser

User not authorized to operate on the specified resource as your account is created by another user.

You are unauthorized to perform this operation on the specified resource. You can apply for the required permissions and try again.

403

Forbidden

User not authorized to operate on the specified resource.

You are unauthorized to perform this operation on the specified resource. You can apply for the required permissions and try again.

404

InvalidVpnGatewayInstanceId.NotFound

The specified vpn gateway instance id does not exist.

The VPN gateway is not found.

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