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

Note If you modify the role of a port, the role configurations set for the port will be deleted.

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 ModifySagPortRole

The operation that you want to perform.

Set the value to ModifySagPortRole.

PortName String Yes 0

The name of the port.

RegionId String Yes cn-shanghai

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

Role String Yes NONE

The role of the port. Valid values:

  • NONE: No role is assigned to the port.
  • WAN: The port is used as a WAN port. By default, port 5 of an SAG device is used as a WAN port and supports a Dynamic Host Configuration Protocol (DHCP) client, PPPoE, or a static IP address to access the Internet.
  • LAN: The port is used as a LAN port. The LAN port supports a DHCP server or a static IP address to connect to a local terminal or switch.
  • ECC: The port is used as a leased line port to connect to a leased line.
  • MGT: The port is used as the management port. By default, port 2 of an SAG device is used as the management port.
Note
  • In exclusive mode, the management traffic is separated from the workload traffic. The management port is only used to access the SAG web console and cannot be used to transfer your workload data. You can access the SAG web console only through the management port.
  • A WAN port can be used when it is connected. If a port is the first one that obtains an IP address over DHCP and can access the Internet, it is set as a WAN port. In the SAG web console, you can set another port as a WAN port.
SmartAGId String Yes sag-whfn****

The ID of the SAG instance.

SmartAGSn String Yes sag32a30****

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

Response parameters

Parameter Type Example Description
RequestId String 3200E8A3-563F-4FFC-8BDB-0F1263FA69E8

The ID of the request.

Examples

Sample requests

http(s)://smartag.cn-shanghai.aliyuncs.com/? Action=ModifySagPortRole
&PortName=0
&RegionId=cn-shanghai
&Role=NONE
&SmartAGId=sag-whfn****
&SmartAGSn=sag32a30****
&<Common request parameters>

Sample success responses

XML format

<ModifySagPortRoleResponse>
     <RequestId>3200E8A3-563F-4FFC-8BDB-0F1263FA69E8</RequestId>
</ModifySagPortRoleResponse>

JSON format

{
"RequestId":"3200E8A3-563F-4FFC-8BDB-0F1263FA69E8"
}

Error codes

HttpCode Error code Error message Description
400 Sag.PortNotExist The specified port does not exist. The specified port does not exist.
400 Sag.HaPortExist The specified port is used by the HA configuration. You must modify high availability (HA) configurations before you can modify the role of the specified port.
400 Sag.PortRoleLimit The maximum number of ports with the specified role is exceeded. The role number of the specified port exceeds the upper limit.
400 Sag.PortMgtError The role of a management port cannot be changed. The management port role cannot be modified.

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