# 批量线路创建记录集 - CreateRecordSetWithBatchLines
#### 功能介绍
批量线路创建记录集。属于原子性操作，如果存在一个参数校验不通过，则创建失败。仅公网域名支持。
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-dns/zh-cn_topic_0037134405.html)。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-dns/dns_api_70000.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项                  | 访问级别  | 资源类型（\*为必须） | 条件键                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | 别名 | 依赖的授权项                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
  |:---|:---|:---|:---|:---|:---|
  | dns:recordset:create | Write | zone \*     | - g:ResourceTag/\<tag-key\>   - g:EnterpriseProjectId    | -  | - dns:recordset:associatehealthcheck  - ces:siteMonitorRule:showHealthCheck  - ces:siteMonitorRule:put  - ces:siteMonitorRule:delete  - ces:siteMonitorRule:list  - dns:quota:list   |
  | dns:recordset:create | Write | -           | - dns:RecordSetNames   - dns:RecordSetTypes              | -  | - dns:recordset:associatehealthcheck  - ces:siteMonitorRule:showHealthCheck  - ces:siteMonitorRule:put  - ces:siteMonitorRule:delete  - ces:siteMonitorRule:list  - dns:quota:list   |
     
  
 
#### URI
POST /v2.1/zones/{zone_id}/recordsets/batch/lines
表1路径参数 
| 参数      | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|:---|:---|:---|:---|
| zone_id | 是    | String | **参数解释：** 域名ID。 获取方式：通过查询公网域名列表（ListPublicZones）或内网域名列表（ListPrivateZones）接口获取。 **约束限制：** 不涉及。 **取值范围：** 不涉及。 **默认取值：** 不涉及。 |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | **参数解释：** 用户Token，用于用户身份认证，调用接口时需在请求头中携带该Token以验证用户身份。 通过调用IAM服务获取用户Token接口获取（响应消息头中X-Subject-Token的值）。 获取用户Token请参见[获取用户Token](https://support.huaweicloud.com/api-dns/dns_api_30003.html)。 **约束限制：** 不涉及。 **取值范围：** 不涉及。 **默认取值：** 不涉及。 |
   
表3请求Body参数 
| 参数          | 是否必选 | 参数类型                                                                                                                                               | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|:---|:---|:---|:---|
| name        | 是    | String                                                                                                                                             | **参数解释：** 域名，后缀需以zone name结束且为FQDN（Fully Qualified Domain Name，全称域名），即以"."结束的完整主机名。 如"www.example.com."。 **约束限制：** 不涉及。 **取值范围：** 不涉及。 **默认取值：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| description | 否    | String                                                                                                                                             | **参数解释：** 记录集的描述信息。 **约束限制：** 不涉及。 **取值范围：** 长度不超过255个字符。 **默认取值：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| type        | 是    | String                                                                                                                                             | **参数解释：** 记录集的类型。 **约束限制：** 不涉及。 **取值范围：** - A：将域名解析到指定的IPv4地址。   - AAAA：将域名解析到指定的IPv6地址。   - MX：指定域名对应的邮件服务器。   - CNAME：将域名解析到另一域名，或者多个域名映射到同一域名上。   - TXT：用于对域名进行标识和说明。   - SRV：用于记录某台服务器对外提供了哪些服务。   - NS：指定域名的权威DNS服务器。   - SOA：提供域名的基本信息和权威服务器的详细信息。   - CAA：指定为域名颁发HTTPS证书的授权CA机构，仅支持公网域名解析。    **默认取值：** 不涉及。 |
| lines       | 是    | Array of [batchCreateRecordSetWithLine] objects | **参数解释：** 解析线路域名参数。 该字段为数组，每个元素包含解析线路、TTL、权重及解析记录值。 **约束限制：** 最多支持50个。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
   
 表4batchCreateRecordSetWithLine 
| 参数      | 是否必选 | 参数类型             | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
|:---|:---|:---|:---|
| line    | 是    | String           | **参数解释：** 解析线路ID。 获取线路ID请参见[获取线路ID](https://support.huaweicloud.com/api-dns/zh-cn_topic_0085546214.html)。也可通过查询自定义线路（ListCustomLine）或查询线路分组列表（ListLineGroups）接口获取。 **约束限制：** 不涉及。 **取值范围：** 不涉及。 **默认取值：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ttl     | 否    | Integer          | **参数解释：** 记录集的有效缓存时间，以秒为单位。 **约束限制：** 不涉及。 **取值范围：** 1\~2147483647。 **默认取值：** 300                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| weight  | 否    | Integer          | **参数解释：** 解析记录的权重。 **约束限制：** 在相同域名、类型、线路下的解析记录，规则如下： - 全部设置权重，或全部不设置权重。   - 当不设置权重时，只能创建一个解析记录。   - 当设置权重时，最多能创建20个解析记录。    **取值范围：** 0\~1000。 - 当weight=null时，表示该解析记录不设置权重。   - 当weight=0，表示备用域名解析记录。   - 当weight\>0，表示主用域名解析记录。    **默认取值：** 1。 |
| records | 是    | Array of strings | **参数解释：** 解析记录的值。不同类型解析记录对应的值的规则不同。 该字段为字符串数组，每个元素为一条解析记录值。 **约束限制：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
   
#### 响应参数
**状态码：202**
表5响应Body参数 
| 参数         | 参数类型                                                                                                                                            | 描述                                                                                                                                        |
|:---|:---|:---|
| links      | [pageLink] object                                               | **参数解释：** 指向当前页和下一页的链接。分页查询需要分页时，需要使用一个next字段指向下一页。         |
| recordsets | Array of [QueryRecordSetWithLineResp] objects | **参数解释：** 记录集列表信息。 该字段为数组，每个元素包含记录集ID、名称、类型、TTL及解析记录值列表等字段。 |
| metadata   | [metadata] object                                               | **参数解释：** 分页查询的元数据信息，包含满足查询条件的资源总数（total_count）等。           |
   
 表6QueryRecordSetWithLineResp 
| 参数              | 参数类型                                                                                                      | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
|:---|:---|:---|
| id              | String                                                                                                    | **参数解释：** 记录集的ID。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| name            | String                                                                                                    | **参数解释：** 记录集的名称。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| description     | String                                                                                                    | **参数解释：** 记录集的描述信息。 **取值范围：** 长度不超过255个字符。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| zone_id         | String                                                                                                    | **参数解释：** 托管该记录的域名ID。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| zone_name       | String                                                                                                    | **参数解释：** 托管该记录的域名。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| type            | String                                                                                                    | **参数解释：** 记录类型。 **取值范围：** - A：将域名解析到指定的IPv4地址。   - AAAA：将域名解析到指定的IPv6地址。   - MX：指定域名对应的邮件服务器。   - CNAME：将域名解析到另一域名，或者多个域名映射到同一域名上。   - TXT：用于对域名进行标识和说明。   - SRV：用于记录某台服务器对外提供了哪些服务。   - NS：指定域名的权威DNS服务器。   - SOA：提供域名的基本信息和权威服务器的详细信息。   - CAA：指定为域名颁发HTTPS证书的授权CA机构，仅支持公网域名解析。   - PTR：指定IP地址反向解析记录，仅支持内网域名解析。                                                                                                                                                                                                                                                                                               |
| ttl             | Integer                                                                                                   | **参数解释：** 解析记录在本地DNS服务器的缓存时间，缓存时间越长更新生效越慢，以秒为单位。 **取值范围：** 1\~2147483647。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| records         | Array of strings                                                                                          | **参数解释：** 域名解析后的值。 该字段为字符串数组，每个元素为一条解析记录值。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| created_at      | String                                                                                                    | **参数解释：** 记录集的创建时间。 使用UTC+0时间格式，格式为yyyy-MM-dd'T'HH:mm:ss.SSS，例如：2023-01-01T12:00:00.000。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| updated_at      | String                                                                                                    | **参数解释：** 记录集的最近一次修改时间。 使用UTC+0时间格式，格式为yyyy-MM-dd'T'HH:mm:ss.SSS，例如：2023-01-01T12:00:00.000。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| status          | String                                                                                                    | **参数解释：** 记录集状态。 **取值范围：** - ACTIVE：正常   - PENDING_CREATE：创建中   - PENDING_UPDATE：更新中   - PENDING_DELETE：删除中   - PENDING_FREEZE：冻结中   - FREEZE：冻结   - ILLEGAL：违规冻结   - POLICE：公安冻结   - PENDING_DISABLE：暂停中   - DISABLE：暂停   - ERROR：失败    |
| default         | Boolean                                                                                                   | **参数解释：** 标识是否由系统默认生成，系统默认生成的记录集不能删除。 **取值范围：** - true：由系统默认生成，不能删除。   - false：非系统默认生成，可以删除。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| project_id      | String                                                                                                    | **参数解释：** 该记录集所属的项目ID。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| links           | [pageLink] object         | **参数解释：** 指向当前页和下一页的链接。分页查询需要分页时，需要使用一个next字段指向下一页。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| line            | String                                                                                                    | **参数解释：** 解析线路ID。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| weight          | Integer                                                                                                   | **参数解释：** 解析记录的权重。 **取值范围：** 0\~1000。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| health_check_id | String                                                                                                    | **参数解释：** 健康检查ID。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| alias_target    | [alias_target] object | **参数解释：** 别名记录。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| bundle          | String                                                                                                    | **参数解释：** 规格，默认规格，保留字段。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
   
 表7pageLink 
| 参数   | 参数类型   | 描述                                                                                                                                                                                                                                                                          |
|:---|:---|:---|
| self | String | **参数解释：** 当前页面的链接。 **取值范围：** 不涉及。 |
| next | String | **参数解释：** 下一页的链接。 **取值范围：** 不涉及。  |
   
 表8alias_target 
| 参数                   | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|:---|:---|:---|
| resource_type        | String | **参数解释：** 资源服务类型，支持别名记录的服务。 **取值范围：** - cloudsite：企业门户   - waf：Web应用防火墙    |
| resource_domain_name | String | **参数解释：** 对应服务下的域名，由各服务提供。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
   
 表9metadata 
| 参数          | 参数类型    | 描述                                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|
| total_count | Integer | **参数解释：** 满足查询条件的资源总数，不受分页（即limit、offset参数）影响。 **取值范围：** 不涉及。 |
   
#### 请求示例
批量线路创建A类型记录集，设置线路类型为"default_view"，解析记录值为"192.168.10.1"、"192.168.10.2"，TTL为300秒，权重为1。
```
POST https://{Endpoint}/v2.1/zones/{zone_id}/recordsets/batch/lines
{
  "name" : "www.example.com.",
  "description" : "This is an example record set.",
  "type" : "A",
  "lines" : [ {
    "line" : "default_view",
    "records" : [ "192.168.10.1", "192.168.10.2" ],
    "ttl" : 300,
    "weight" : 1
  } ]
}
```
#### 响应示例
**状态码：202**
```
{
  "links" : {
    "self" : "https://{Endpoint}/v2.1/zones/2c9eb155587194ec01587224c9f90149/recordsets/batch/lines"
  },
  "recordsets" : [ {
    "id" : "2c9eb155587228570158722b6ac30007",
    "name" : "www.example.com.",
    "description" : "This is an example record set.",
    "type" : "A",
    "ttl" : 300,
    "records" : [ "192.168.10.1", "192.168.10.2" ],
    "status" : "PENDING_CREATE",
    "links" : {
      "self" : "https://{Endpoint}/v2.1/zones/2c9eb155587194ec01587224c9f90149/recordsets/2c9eb155587228570158722b6ac30007"
    },
    "zone_id" : "2c9eb155587194ec01587224c9f90149",
    "zone_name" : "example.com.",
    "created_at" : "2016-11-17T12:03:17.827",
    "updated_at" : null,
    "health_check_id" : null,
    "default" : false,
    "project_id" : "e55c6f3dc4e34c9f86353b664ae0e70c",
    "line" : "default_view",
    "weight" : 1,
    "alias_target" : null
  } ],
  "metadata" : {
    "total_count" : 1
  }
}
```
#### SDK代码示例
SDK代码示例如下。
- [Java]
  批量线路创建A类型记录集，设置线路类型为"default_view"，解析记录值为"192.168.10.1"、"192.168.10.2"，TTL为300秒，权重为1。
  ```
  package com.huaweicloud.sdk.test;
  import com.huaweicloud.sdk.core.auth.ICredential;
  import com.huaweicloud.sdk.core.auth.BasicCredentials;
  import com.huaweicloud.sdk.core.exception.ConnectionException;
  import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
  import com.huaweicloud.sdk.core.exception.ServiceResponseException;
  import com.huaweicloud.sdk.dns.v2.region.DnsRegion;
  import com.huaweicloud.sdk.dns.v2.*;
  import com.huaweicloud.sdk.dns.v2.model.*;
  import java.util.List;
  import java.util.ArrayList;
  public class CreateRecordSetWithBatchLinesSolution {
      public static void main(String[] args) {
          // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
          // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
          String ak = System.getenv("CLOUD_SDK_AK");
          String sk = System.getenv("CLOUD_SDK_SK");
          ICredential auth = new BasicCredentials()
                  .withAk(ak)
                  .withSk(sk);
          DnsClient client = DnsClient.newBuilder()
                  .withCredential(auth)
                  .withRegion(DnsRegion.valueOf("<YOUR REGION>"))
                  .build();
          CreateRecordSetWithBatchLinesRequest request = new CreateRecordSetWithBatchLinesRequest();
          request.withZoneId("{zone_id}");
          CreateRSetBatchLinesReq body = new CreateRSetBatchLinesReq();
          List<String> listLinesRecords = new ArrayList<>();
          listLinesRecords.add("192.168.10.1");
          listLinesRecords.add("192.168.10.2");
          List<BatchCreateRecordSetWithLine> listbodyLines = new ArrayList<>();
          listbodyLines.add(
              new BatchCreateRecordSetWithLine()
                  .withLine("default_view")
                  .withTtl(300)
                  .withWeight(1)
                  .withRecords(listLinesRecords)
          );
          body.withLines(listbodyLines);
          body.withType("A");
          body.withDescription("This is an example record set.");
          body.withName("www.example.com.");
          request.withBody(body);
          try {
              CreateRecordSetWithBatchLinesResponse response = client.createRecordSetWithBatchLines(request);
              System.out.println(response.toString());
          } catch (ConnectionException e) {
              e.printStackTrace();
          } catch (RequestTimeoutException e) {
              e.printStackTrace();
          } catch (ServiceResponseException e) {
              e.printStackTrace();
              System.out.println(e.getHttpStatusCode());
              System.out.println(e.getRequestId());
              System.out.println(e.getErrorCode());
              System.out.println(e.getErrorMsg());
          }
      }
  }
  ```
- [Python]
  批量线路创建A类型记录集，设置线路类型为"default_view"，解析记录值为"192.168.10.1"、"192.168.10.2"，TTL为300秒，权重为1。
  ```
  # coding: utf-8
  import os
  from huaweicloudsdkcore.auth.credentials import BasicCredentials
  from huaweicloudsdkdns.v2.region.dns_region import DnsRegion
  from huaweicloudsdkcore.exceptions import exceptions
  from huaweicloudsdkdns.v2 import *
  if __name__ == "__main__":
      # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak = os.environ["CLOUD_SDK_AK"]
      sk = os.environ["CLOUD_SDK_SK"]
      credentials = BasicCredentials(ak, sk)
      client = DnsClient.new_builder() \
          .with_credentials(credentials) \
          .with_region(DnsRegion.value_of("<YOUR REGION>")) \
          .build()
      try:
          request = CreateRecordSetWithBatchLinesRequest()
          request.zone_id = "{zone_id}"
          listRecordsLines = [
              "192.168.10.1",
              "192.168.10.2"
          ]
          listLinesbody = [
              BatchCreateRecordSetWithLine(
                  line="default_view",
                  ttl=300,
                  weight=1,
                  records=listRecordsLines
              )
          ]
          request.body = CreateRSetBatchLinesReq(
              lines=listLinesbody,
              type="A",
              description="This is an example record set.",
              name="www.example.com."
          )
          response = client.create_record_set_with_batch_lines(request)
          print(response)
      except exceptions.ClientRequestException as e:
          print(e.status_code)
          print(e.request_id)
          print(e.error_code)
          print(e.error_msg)
  ```
- [Go]
  批量线路创建A类型记录集，设置线路类型为"default_view"，解析记录值为"192.168.10.1"、"192.168.10.2"，TTL为300秒，权重为1。
  ```
  package main
  import (
  "fmt"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
      dns "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dns/v2"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dns/v2/model"
      region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dns/v2/region"
  )
  func main() {
      // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak := os.Getenv("CLOUD_SDK_AK")
      sk := os.Getenv("CLOUD_SDK_SK")
      auth, err := basic.NewCredentialsBuilder().
          WithAk(ak).
          WithSk(sk).
          SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      hcClient, err := dns.DnsClientBuilder().
           WithRegion(region.ValueOf("<YOUR REGION>")).
           WithCredential(auth).
           SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      client := dns.NewDnsClient(hcClient)
      request := &model.CreateRecordSetWithBatchLinesRequest{}
  request.ZoneId = "{zone_id}"
  var listRecordsLines = []string{
          "192.168.10.1",
      "192.168.10.2",
      }
  ttlLines:= int32(300)
  weightLines:= int32(1)
  var listLinesbody = []model.BatchCreateRecordSetWithLine{
          {
              Line: "default_view",
              Ttl: &ttlLines,
              Weight: &weightLines,
              Records: listRecordsLines,
          },
      }
  descriptionCreateRSetBatchLinesReq:= "This is an example record set."
  request.Body = &model.CreateRSetBatchLinesReq{
  Lines: listLinesbody,
  Type: "A",
  Description: &descriptionCreateRSetBatchLinesReq,
  Name: "www.example.com.",
  }
  response, err := client.CreateRecordSetWithBatchLines(request)
  if err == nil {
          fmt.Printf("%+v\n", response)
      } else {
          fmt.Println(err)
      }
  }
  ```
- [更多]
  更多编程语言的SDK代码示例，请参见[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/DNS/sdk?api=CreateRecordSetWithBatchLines)的代码示例页签，可生成自动对应的SDK代码示例。
#### 状态码
| 状态码 | 描述           |
|:---|:---|
| 202 | 批量线路创建记录集响应。 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-dns/ErrorCode.html)。
