添加DNS转发,适用于设备类型为SCG5000或SCG5000-5G的智能接入网关实例,且设备版本为3.4.2及以上。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用前面加 * 表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
smartag:AddSmartAccessGatewayDnsForward | *全部资源 * |
| 无 |
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
SagInsId | string | 是 | 网关实例 id | sag-v9un1ccz22owd76lf8 |
SagSn | string | 是 | 设备 SN | sagf4dkqh78 |
Domain | string | 是 | 域名 说明
| www.aliyun.com |
MasterIp | string | 是 | 主 DNS | 114.114.114.114 |
SlaveIp | string | 否 | 备 DNS | 172.16.0.14 |
Mode | string | 否 | 转发模式 说明
| first |
OutboundPortType | string | 否 | 出接口类型 说明
枚举值:
| Tunnel |
OutboundPortIndex | string | 否 | 出接口序号 说明
| 0 |
OutboundPortName | string | 否 | 出接口 说明
| eth0 |
RegionId | string | 是 | 智能接入网关实例所属的地域 ID。 | cn-shanghai |
返回参数
示例
正常返回示例
JSON
格式
{
"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"
}
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
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. | 智能接入网关当前版本不支持该功能特性。 |
400 | CCN.DNS.Forward.CreateFailed | failed to create dns forward config | - |
404 | ResourceNotFound.Device | The specified resource of Device is not found. | - |
访问错误中心查看更多错误码。