添加一个域名。添加的域名不能是泛域名。在添加域名前,建议您调用 CheckZone API 检查您要添加的域名是否符合要求。
请求频率:每秒最多调用 5 次。
除了以下参数,您还需要 对请求进行鉴权。
参数 | 类型 | 是否必填 | 示例值 | 描述 |
|---|---|---|---|---|
Action | String | 是 | CreateZone | 要执行的操作,取值:CreateZone。 |
Version | String | 是 | 2018-08-01 | API的版本,取值:2018-08-01。 |
Tags | Array of Object | 否 | [{"Key": "key1","Value": "value1",}] | 该域名的标签。默认为空。 |
ZoneName | String | 是 | example.com | 添加的域名。域名必须是二级域名,并且不能是泛域名。 |
Remark | String | 否 | Remark | 该域名的备注。默认为空字符串。 |
ProjectName | String | 否 | default | 该域名所属的项目。默认为 |
下表仅列出本接口特有的返回参数。更多信息请参见返回结构。
参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
CreatedAt | String | 2022-11-03T14:02:22+08:00 | 域名的创建时间。 |
UpdatedAt | String | 2022-11-03T14:02:22+08:00 | 域名的更新时间。 |
CacheStage | Integer | 1 | 域名所有权的状态。该参数有以下取值:
|
ConfigurationCode | String | null | 该参数已弃用。 |
DnsSecurity | String | dns_security_standard_inner | DNS DDoS 防护服务的版本。
|
ExpiredTime | Long | 0 | 域名的过期时间。当前该参数值为 0,表示域名不会过期。 |
InstanceID | String | null | 实例的 ID。对于云解析 DNS 免费版,该字段的值为 null。 |
IsSubDomain | Boolean | false | 是否是子域名。
|
LastOperator | String | 21xxxxx72 | 创建该域名的用户的火山引擎账号的 ID。 |
RecordCount | Integer | 0 | 域名下的解析记录的总数。由于新添加的域名还未包含任何解析记录,所以该参数的值为 0。 |
Remark | String | create a domain | 域名的备注。 |
TradeCode | String | free_inner | 表示域名的功能版本。该参数有以下取值:
|
ZID | Long | 2652 | 域名的 ID。 |
ZoneName | String | test.com | 域名。 |
POST /?Action=CreateZone&Version=2018-08-01 HTTP/1.1 Host: dns.volcengineapi.com Content-Type: application/json; charset=UTF-8 X-Date: 20240822T085927Z X-Content-Sha256: 287e874e******d653b44d21e Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20240822/cn-beijing/dns/request, SignedHeaders=host;x-content-sha256;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f { "ZoneName": "example.com" }
{ "ResponseMetadata": { "RequestId": "2022110314022201020402601715A9DEBB", "Action": "CreateZone", "Version": "2018-08-01", "Service": "dns", "Region": "cn-north-1" }, "Result": { "CreatedAt": "2022-11-03T14:02:22+08:00", "UpdatedAt": "2022-11-03T14:02:22+08:00", "ZID": 2652, "ZoneName": "test.com", "InstanceID": null, "Remark": "create a domain", "ConfigurationCode": null, "RecordCount": 0, "ExpiredTime": 0, "LastOperator": "21xxxxx72", "CacheStage": 1, "TradeCode": "free_inner", "DnsSecurity": "", "IsSubDomain": false } }
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。
状态码 | 错误码 | 说明 |
|---|---|---|
400 | ErrParsingParams | 解析请求失败。 |