You can call this operation to modify the routing protocol of a port.

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 No ModifySagPortRouteProtocol

The operation that you want to perform.

Set the value to ModifySagPortRouteProtocol.

PortName String Yes 2

The name of the port.

RegionId String Yes cn-shanghai

The ID of the region where the Smart Access Gateway (SAG) instance is deployed.

RouteProtocol String Yes STATIC

The routing protocol. Valid values:

  • STATIC: the static routing protocol.
  • OSPF: the Open Shortest Path First (OSPF) protocol.
  • BGP: the Border Gateway Protocol (BGP).
SmartAGId String Yes sag-whfn****

The ID of the SAG instance.

SmartAGSn String Yes sag32a30****

The serial number of the SAG device associated with the SAG instance.

Vlan String No 2

The VLAN ID.

RemoteIp String No 192.XX.XX.1

The IP address of the peer device.

Note When you enable BGP, you must set this parameter.
RemoteAs String No 12345

The BGP autonomous system number (ASN) of the peer device.

Note When you enable BGP, you must set this parameter.

Response parameters

Parameter Type Example Description
RequestId String CE6642D4-21EB-4168-9BF9-F217953F9892

The ID of the request.

Examples

Sample requests

http(s)://smartag.cn-shanghai.aliyuncs.com/? Action=ModifySagPortRouteProtocol
&PortName=2
&RegionId=cn-shanghai
&RouteProtocol=STATIC
&SmartAGId=sag-whfn****
&SmartAGSn=sag32a30****
&<Common request parameters>

Sample success responses

XML format

<ModifySagPortRouteProtocolResponse>
     <RequestId>CE6642D4-21EB-4168-9BF9-F217953F9892</RequestId>
</ModifySagPortRouteProtocolResponse>

JSON format

{
"RequestId":"CE6642D4-21EB-4168-9BF9-F217953F9892"
}

Error codes

HttpCode Error code Error message Description
400 Sag.RouteProtocolPortNotExist The port specified for the dynamic routing protocol does not exist. The port specified for the dynamic routing protocol does not exist.
400 Sag.EccRouteTypeError An ECC port supports the BGP protocol only. A VLAN interface of a leased line port only supports BGP.
400 Sag.RouteTypeNotMatch The routing protocol type must be the same as the global routing protocol type. The routing protocol type must be the same as the global routing protocol type.

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