Adds DNS forwarding configurations to an SCG5000 or SCG5000-5G instance. The device version must be 3.4.2 or later.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| smartag:AddSmartAccessGatewayDnsForward | *All Resources * |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| SagInsId | string | Yes | The ID of the instance. | sag-v9un1ccz22owd76lf8 |
| SagSn | string | Yes | The serial number (SN) of the device. | sagf4dkqh78 |
| Domain | string | Yes | The domain name. Note
For example, you can enter *.baidu.com to specify the domain name baidu.com. | www.aliyun.com |
| MasterIp | string | Yes | The primary DNS server. | 114.114.114.114 |
| SlaveIp | string | No | The secondary DNS server. | 172.16.0.14 |
| Mode | string | No | The forwarding mode. Note
| first |
| OutboundPortType | string | No | The type of the egress port. Note
Enumeration Value:
| Tunnel |
| OutboundPortIndex | string | No | The number of the egress port. Note
| 0 |
| OutboundPortName | string | No | The egress port. Note
| eth0 |
| RegionId | string | Yes | The ID of the region where the instance is deployed. | cn-shanghai |
Response parameters
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 code | Error code | Error message | Description |
|---|---|---|---|
| 400 | InvalidSpec.FeatureNotSupport | The current edition of the cloudbranch does not support this feature. | - |
| 400 | GATEWAY.InvalidSN | The specified gateway serial number does not exist. | - |
| 400 | CCN.DuplicateDNSForwardingDomain | Duplicate DNS forwarding domain | - |
| 400 | ConfigUnsynchronized | The configs of device are unsynchronized,please check whether the device is online | - |
| 400 | DeviceNotExist | The specified device does not exist | - |
| 400 | FeatureNotSupport | The current edition of the smart access gateway does not support this feature. | The current version of Smart Access Gateway does not support this feature. |
| 400 | CCN.DNS.Forward.CreateFailed | failed to create dns forward config | - |
| 404 | ResourceNotFound.Device | The specified resource of Device is not found. | - |
For a list of error codes, visit the Service error codes.
