You need to enable JavaScript to run this app.
文档中心
文档控制台
注册
TrafficRoute DNS 套件

TrafficRoute DNS 套件

复制全文
下载 pdf
自定义解析管理接口
AddDomainRecord - 创建自定义解析记录
复制全文
下载 pdf
AddDomainRecord - 创建自定义解析记录

在指定的域名下添加自定义解析记录。

请求说明

您只能使用 POST 方法。

请求鉴权

您需要 对请求进行鉴权

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

const columns = [
  {
    width: '20%',
    title: '参数',
    dataIndex: 'Name',
    className: 'openapi-doc-parameter-table-name'
  },
  {
    width: 130,
    title: '类型',
    dataIndex: 'DataType',
    className: 'openapi-doc-parameter-table-type'
  },
  {
    width: 90,
    title: '是否必填',
    dataIndex: 'IsRequired',
    className: 'openapi-doc-parameter-table-required'
  },
  {
    width: '20%',
    title: '示例值',
    dataIndex: 'Example',
    className: 'openapi-doc-parameter-table-example'
  },
  {
    title: '描述',
    dataIndex: 'Description',
    className: 'openapi-doc-parameter-table-description'
  },
];

const data = [
  {
    rowKey: '->Action',
    Name: 'Action',
    DataType: 'String',
    IsRequired: '是',
    Example: <RenderMd content={"AddDomainRecord"} />,
    Description: <RenderMd content={"要执行的操作,取值:AddDomainRecord。"} />,
    children: [
    ]
  },
  {
    rowKey: '->Version',
    Name: 'Version',
    DataType: 'String',
    IsRequired: '是',
    Example: <RenderMd content={"2023-09-01"} />,
    Description: <RenderMd content={"API的版本,取值:2023-09-01。"} />,
    children: [
    ]
  },
  {
    rowKey: '->Domain',
    Name: 'Domain',
    DataType: 'String',
    IsRequired: '是',
    Example: <RenderMd content={"www.douyin.com"} />,
    Description: <RenderMd content={"解析记录的域名"} />,
    children: [
    ]
  },
  {
    rowKey: '->Type',
    Name: 'Type',
    DataType: 'String',
    IsRequired: '是',
    Example: <RenderMd content={"CNAME"} />,
    Description: <RenderMd content={"解析记录的类型:\n- A\n- AAAA\n- CNAME"} />,
    children: [
    ]
  },
  {
    rowKey: '->Ttl',
    Name: 'Ttl',
    DataType: 'Integer',
    IsRequired: '是',
    Example: <RenderMd content={"10"} />,
    Description: <RenderMd content={"解析记录的过期时间(秒)。\n- 对于 A 或 AAAA 类型的解析记录,Ttl 的取值范围为 60 ~ 7200。\n- 对于 CNAME 类型的解析记录,Ttl 参数无效。"} />,
    children: [
    ]
  },
  {
    rowKey: '->Line',
    Name: 'Line',
    DataType: 'String',
    IsRequired: '是',
    Example: <RenderMd content={"中国_华北"} />,
    Description: <RenderMd content={"线路值。您可以通过 [ListLines API](../6758/1158216) 获取线路值。"} />,
    children: [
    ]
  },
  {
    rowKey: '->Target',
    Name: 'Target',
    DataType: 'Array of String',
    IsRequired: '是',
    Example: <RenderMd content={"```json\n[\n        \"www.toutiao.com\"\n]\n```"} />,
    Description: <RenderMd content={"记录值"} />,
    children: [
    ]
  },
  {
    rowKey: '->Enable',
    Name: 'Enable',
    DataType: 'Boolean',
    IsRequired: '是',
    Example: <RenderMd content={"false"} />,
    Description: <RenderMd content={"是否启用解析记录:\n- true:启用\n- false:禁用"} />,
    children: [
    ]
  },
  {
    rowKey: '->Weights',
    Name: 'Weights',
    DataType: 'Array of Object',
    IsRequired: '是',
    Example: <RenderMd content={"```json\n[\n        {\n            \"Key\": \"www.toutiao.com\",\n            \"Value\": 1\n        }\n]\n```"} />,
    Description: <RenderMd content={"记录值的权重"} />,
    children: [
        {
          rowKey: '->Weights->Key',
          Name: 'Key',
          DataType: 'String',
          IsRequired: '是',
          Example: <RenderMd content={""} />,
          Description: <RenderMd content={"记录值"} />,
          children: [
          ]
        },
        {
          rowKey: '->Weights->Value',
          Name: 'Value',
          DataType: 'String',
          IsRequired: '是',
          Example: <RenderMd content={""} />,
          Description: <RenderMd content={"记录值对应的权重"} />,
          children: [
          ]
        },
    ]
  },
  {
    rowKey: '->DryRun',
    Name: 'DryRun',
    DataType: 'Boolean',
    IsRequired: '否',
    Example: <RenderMd content={"false"} />,
    Description: <RenderMd content={"是否空运行。您可以通过该参数对请求进行预检\n"} />,
    children: [
    ]
  },
  {
    rowKey: '->ClientToken',
    Name: 'ClientToken',
    DataType: 'String',
    IsRequired: '否',
    Example: <RenderMd content={"d3e5f7a9-0b1d-2c3e-4f5a-6789b0c1d2e3"} />,
    Description: <RenderMd content={"用于保证请求幂等性。您需要从客户端生成一个参数值,确保不同请求间该参数值唯一。`ClientToken` 只支持 ASCII 字符,且长度不能超过 64 个字符"} />,
    children: [
    ]
  },

];

return (<Table
  rowKey="rowKey"
  className="openapi-doc-parameter-table"
  columns={columns}
  data={data}
  border={ { cell: true, wrapper: true } }
  scroll={ { x: "auto" } }
  pagination={false}
/>);

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

const columns = [
  {
    width: '25%',
    title: '参数',
    dataIndex: 'Name',
    className: 'openapi-doc-parameter-table-name',
  },
  {
    width: 130,
    title: '类型',
    dataIndex: 'DataType',
    className: 'openapi-doc-parameter-table-type'
  },
  {
    width: '25%',
    title: '示例值',
    dataIndex: 'Example',
    className: 'openapi-doc-parameter-table-example'
  },
  {
    title: '描述',
    dataIndex: 'Description',
    className: 'openapi-doc-parameter-table-description'
  },
];

const data = [
  {
    rowKey: "->Domain",
    Name: "Domain",
    DataType: "String",
    Example: <RenderMd content={"www.douyin.com"} />,
    Description: <RenderMd content={"解析记录的域名"} />,
    children: [
    ]
  },
  {
    rowKey: "->Type",
    Name: "Type",
    DataType: "String",
    Example: <RenderMd content={"A"} />,
    Description: <RenderMd content={"解析记录的类型"} />,
    children: [
    ]
  },
  {
    rowKey: "->Ttl",
    Name: "Ttl",
    DataType: "Integer",
    Example: <RenderMd content={"10"} />,
    Description: <RenderMd content={"解析记录的过期时间(秒)"} />,
    children: [
    ]
  },
  {
    rowKey: "->Line",
    Name: "Line",
    DataType: "String",
    Example: <RenderMd content={"中国_华北"} />,
    Description: <RenderMd content={"线路值"} />,
    children: [
    ]
  },
  {
    rowKey: "->Target",
    Name: "Target",
    DataType: "Array of String",
    Example: <RenderMd content={"```json\n[\n        \"www.toutiao.com\"\n]\n```"} />,
    Description: <RenderMd content={"解析记录的记录值"} />,
    children: [
    ]
  },
  {
    rowKey: "->Enable",
    Name: "Enable",
    DataType: "Boolean",
    Example: <RenderMd content={"true"} />,
    Description: <RenderMd content={"解析记录是否被启用\n- true:被启用\n- false:被禁用"} />,
    children: [
    ]
  },
  {
    rowKey: "->Weights",
    Name: "Weights",
    DataType: "Array of Object",
    Example: <RenderMd content={"```JSON\n[\n            {\n                \"Key\": \"www.toutiao.com\",\n                \"Value\": 1\n            }\n]\n```"} />,
    Description: <RenderMd content={"权重值"} />,
    children: [
        {
          rowKey: "->Weights->Key",
          Name: "Key",
          DataType: "String",
          Example: <RenderMd content={""} />,
          Description: <RenderMd content={"记录值"} />,
          children: [
          ]
        },
        {
          rowKey: "->Weights->Value",
          Name: "Value",
          DataType: "String",
          Example: <RenderMd content={""} />,
          Description: <RenderMd content={"记录值对应的权重"} />,
          children: [
          ]
        },
    ]
  },
];

return (<Table
  rowKey="rowKey"
  className="openapi-doc-parameter-table"
  columns={columns}
  data={data}
  border={ { cell: true, wrapper: true } }
  scroll={ { x: "auto" } }
  pagination={false}
/>);

请求示例

POST https://open.volcengineapi.com/?Action=AddDomainRecord&Version=2023-09-01
{
    "Domain": "www.douyin.com",
    "Type": "CNAME",
    "Ttl": 0,
    "Line": "中国_华北",
    "Target": [
        "www.toutiao.com"
    ],
    "Enable": false,
    "Weights": [
        {
            "Key": "www.toutiao.com",
            "Value": 1
        }
    ]
}

返回示例

{
    "ResponseMetadata": {
        "RequestId": "202310191805184725C6DC21CC061B7254",
        "Action": "AddDomainRecord",
        "Version": "2023-09-01",
        "Service": "httpdns",
        "Region": "cn-boe-1"
    },
    "Result": {
        "CreateTime": null,
        "Domain": "www.douyin.com",
        "Enable": false,
        "Id": 26940,
        "Line": "中国_华北",
        "Target": [
            "www.toutiao.com"
        ],
        "Ttl": 0,
        "Type": "CNAME",
        "UpdateTime": null,
        "Weights": [
            {
                "Key": "www.toutiao.com",
                "Value": 1
            }
        ]
    }
}

错误码

您可访问公共错误码,获取更多错误码信息。

最近更新时间:2025.05.26 15:43:41
这个页面对您有帮助吗?
有用
有用
无用
无用