AddSmartAccessGatewayDnsForward - 添加DNS转发

更新时间:
复制 MD 格式

添加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

是

域名

说明
  • 支持泛域名,支持全量匹配(域名填写“*”)。例如: *.baidu.com 允许输入的格式为 baidu.com

www.aliyun.com

MasterIp

string

是

主 DNS

114.114.114.114

SlaveIp

string

否

备 DNS

172.16.0.14

Mode

string

否

转发模式

说明
  • 无效字段,不用关注。

first

OutboundPortType

string

否

出接口类型

说明
  • Tunnel 代表隧道口,PhysicalPort 代表物理口。

枚举值:

  • Tunnel :

    Tunnel

  • PhysicalPort :

    PhysicalPort

  • None :

    None

Tunnel

OutboundPortIndex

string

否

出接口序号

说明
  • OutboundPortType 为 PhysicalPort 时选填,OutboundPortType 为 Tunnel 时不用填写;

  • OutboundPortIndex 和 OutboundPortName 一一对应:0 - eth0;2 - lte。

枚举值:

  • 0 :

    0

  • 2 :

    2

0

OutboundPortName

string

否

出接口

说明
  • OutboundPortType 为 PhysicalPort 时选填,OutboundPortType 为 Tunnel 时不用填写;

  • OutboundPortIndex 和 OutboundPortName 一一对应:0 - eth0;2 - lte。

枚举值:

  • eth0 :

    eth0

  • lte :

    lte

eth0

RegionId

string

是

智能接入网关实例所属的地域 ID。

cn-shanghai

返回参数

名称

类型

描述

示例值

object

Schema of Response

RequestId

string

Id of the request

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

Success

boolean

是否成功

true

Code

string

错误码。200 标识查询任务成功

200

Message

string

返回信息

Successful

HttpStatusCode

integer

HTTP 状态码

200

Data

object

业务数据

InstanceId

string

实例 ID

sagv3dnsforward-nc7qabskj17werc7su

Domain

string

域名

yfiy.cn

MasterIp

string

主 DNS

14.104.81.13

SlaveIp

string

备 DNS

172.16.0.14

Mode

string

转发模式

first

OutboundPortType

string

出接口类型

PhysicalPort

OutboundPortIndex

integer

出接口序号

0

OutboundPortName

string

出接口

eth0

示例

正常返回示例

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.

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。