You need to enable JavaScript to run this app.
导航

UpdateDomainRecord - 更新自定义解析记录

最近更新时间2023.10.30 15:09:03

首次发布时间2023.10.17 17:43:57

更新指定的域名下的自定义解析记录。

请求说明

您只能使用 POST 方法。

请求鉴权

您需要 对请求进行鉴权

请求参数

名称
类型
是否必填
示例值
描述
Action
String

UpdateDomainRecord

要执行的操作,取值:UpdateDomainRecord

Version
String

2023-09-01

API的版本,取值:2023-09-01

Domain
String

www.douyin.com

解析记录的域名

Type
String

CNAME

解析记录的类型:

  • A
  • AAAA
  • CNAME
Ttl
Integer

20

解析记录的过期时间(秒)。

  • 对于 A 或 AAAA 类型的解析记录,Ttl 的取值范围为 60 ~ 7200。
  • 对于 CNAME 类型的解析记录,Ttl 参数无效。
Line
String

中国_华北

线路值。您可以通过 ListLines API 获取线路值

Target
Array of String
[
     "www.toutiao.com"
]

记录值

Enable
Boolean

true

是否启用解析记录:

  • true:启用
  • false:禁用
Weights
Array of WeightElement
[
        {
            "Key": "www.toutiao.com",
            "Value": 1
        }
]

记录值的权重

Id
Integer

26272

解析记录的 ID

DryRun
Boolean

false

是否空运行。您可以通过该参数对请求进行预检

ClientToken
String

d3e5f7a9-0b1d-2c3e-4f5a-6789b0c1d2e3

用于保证请求幂等性。您需要从客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符,且长度不能超过 64 个字符

响应数据

名称
类型
示例值
描述
Domain
String

www.douyin.com

解析记录的域名

Type
String

A

解析记录的类型

Ttl
Integer

10

解析记录的过期时间(秒)

Line
String

中国_华北

线路值

Target
Array of String
[
        "www.toutiao.com"
]

解析记录的记录值

Enable
Boolean

true

解析记录是否被启用

  • true:被启用
  • false:被禁用
Weights
Array of WeightElement
[
            {
                "Key": "www.toutiao.com",
                "Value": 1
            }
]

权重值

示例

请求

POST https://open.volcengineapi.com?Action=UpdateDomainRecord&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
        }
    ],
    "Id":26272
}

响应

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

错误码

您可访问公共错误码,获取详细信息。