All Products
Search
Document Center

Smart Access Gateway:AddSmartAccessGatewayDnsForward

Last Updated:Mar 29, 2024

Adds DNS forwarding configurations to an SCG5000 or SCG5000-5G instance. The device version must be 3.4.2 or later.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
SagInsIdstringYes

The ID of the instance.

sag-v9un1ccz22owd76lf8
SagSnstringYes

The serial number (SN) of the device.

sagf4dkqh78
DomainstringYes

The domain name.

Note
  • Wildcard domain names are supported. You can use the wildcard character asterisk (*) to specify a wildcard domain name.

For example, you can enter *.baidu.com to specify the domain name baidu.com.

www.aliyun.com
MasterIpstringYes

The primary DNS server.

114.114.114.114
SlaveIpstringNo

The secondary DNS server.

172.16.0.14
ModestringNo

The forwarding mode.

Note
  • This parameter is not in use. Ignore this parameter.
first
OutboundPortTypestringNo

The type of the egress port.

Note
  • A value of Tunnel specifies a tunnel, and a value of PhysicalPort specifies a physical port.
Enumeration Value:
  • Tunnel: Tunnel.
  • PhysicalPort: PhysicalPort.
  • None: None.
Tunnel
OutboundPortIndexstringNo

The number of the egress port.

Note
  • This parameter is optional if OutboundPortType is set to PhysicalPort. Ignore this parameter if OutboundPortType is set to Tunnel.
  • The value of OutboundPortIndex is the unique index of the port name specified by poOutboundPortName. For example, 0 is the index for the port named eth0, and 2 is the index for the port named lte.
0
OutboundPortNamestringNo

The egress port.

Note
  • This parameter is optional if OutboundPortType is set to PhysicalPort. Ignore this parameter if OutboundPortType is set to Tunnel.
  • The value of OutboundPortIndex is the unique index of the port name specified by poOutboundPortName. For example, 0 is the index for the port named eth0, and 2 is the index for the port named lte.
eth0
RegionIdstringYes

The ID of the region where the instance is deployed.

cn-shanghai

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

Id of the request

E93884AC-6C21-4FEA-8E3A-7377D33B194F
Successboolean

Indicates whether the request is successful.

true
Codestring

The error code. A value of 200 indicates that the call is successful.

200
Messagestring

The response message.

Successful
HttpStatusCodeinteger

The HTTP status code.

200
Dataobject

The information returned for the request.

InstanceIdstring

The ID of the instance.

sagv3dnsforward-nc7qabskj17werc7su
Domainstring

The domain name.

yfiy.cn
MasterIpstring

The primary DNS server.

14.104.81.13
SlaveIpstring

The secondary DNS server.

172.16.0.14
Modestring

The forwarding mode.

first
OutboundPortTypestring

The type of the egress port.

PhysicalPort
OutboundPortIndexinteger

The number of the egress port.

0
OutboundPortNamestring

The egress port.

eth0

Examples

Sample success responses

JSONformat

{
  "RequestId": "E93884AC-6C21-4FEA-8E3A-7377D33B194F",
  "Success": true,
  "Code": "200",
  "Message": "Successful",
  "HttpStatusCode": 200,
  "Data": {
    "InstanceId": "sagv3dnsforward-nc7qabskj17werc7su",
    "Domain": "yfiy.cn",
    "MasterIp": "14.104.81.13",
    "SlaveIp": "172.16.0.14",
    "Mode": "first",
    "OutboundPortType": "PhysicalPort",
    "OutboundPortIndex": 0,
    "OutboundPortName": "eth0"
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidSpec.FeatureNotSupportThe current edition of the cloudbranch does not support this feature.-
400GATEWAY.InvalidSNThe specified gateway serial number does not exist.-
400CCN.DuplicateDNSForwardingDomainDuplicate DNS forwarding domain-
400ConfigUnsynchronizedThe configs of device are unsynchronized,please check whether the device is online-
400DeviceNotExistThe specified device does not exist-
400FeatureNotSupportThe current edition of the smart access gateway does not support this feature.The current version of Smart Access Gateway does not support this feature.
400CCN.DNS.Forward.CreateFailedfailed to create dns forward config-
404ResourceNotFound.DeviceThe specified resource of Device is not found.-

For a list of error codes, visit the Service error codes.