Modifies the role of a port.

Note If you modify the role of a port, the current role configurations of the port are 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 Yes ModifySagPortRole

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

RegionId String Yes cn-shanghai

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

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

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.

PortName String Yes 0

The name of the port.

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 access to the Internet by using a Dynamic Host Configuration Protocol (DHCP) client, PPPoE, or a static IP address.
  • LAN: The port is used as a LAN port. The LAN port allows a DHCP server or a static IP address to connect to an on-premises terminal or switch.
  • ECC: The port is used as a port to connect to an Express Connect circuit.
  • 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.

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

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

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

JSON format

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

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

Error codes

HttpCode Error code Error message Description
400 Sag.PortNotExist The specified port does not exist. The error message returned because the specified port does not exist.
400 Sag.HaPortExist The specified port is used by the HA configuration. The error message returned because the port is already specified in HA configurations.
400 Sag.PortRoleLimit The maximum number of ports with the specified role is exceeded. The error message returned because the number of ports assigned this role exceeds the upper limit.
400 Sag.PortMgtError The role of a management port cannot be changed. The error message returned because the role of the management port cannot be changed.
400 Sag.PortRoleInvalid The port role is invalid. The error message returned because the port role is invalid.
400 ConfigUnsynchronized The network configuration is not synchronized. The error message returned because the network configurations are not synchronized.

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