全部產品
Search
文件中心

Smart Access Gateway:AddSmartAccessGatewayDnsForward - 添加DNS轉寄

更新時間:Dec 21, 2025

添加DNS轉寄,適用於裝置類型為SCG5000或SCG5000-5G的Smart Access Gateway執行個體,且裝置版本為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

Smart Access Gateway執行個體所屬的地區 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.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情