Adds DNS records of different record types at a time..
Operation description
This operation allows you to create or update multiple DNS records at a time. It is suitable for managing a large number of DNS configurations. Supported record types include but are not limited to A/AAAA, CNAME, NS, MX, TXT, CAA, SRV, and URI. The operation allows you to configure the priority, flag, tag, and weight for DNS records. In addition, for specific types of records, such as CERT, SSHFP, SMIMEA, and TLSA, advanced settings such as certificate information and encryption algorithms are also supported.
Successful and failed records along with error messages are listed in the response.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
esa:BatchCreateRecords | create | *Site acs:esa:{#regionId}:{#accountId}:site/{#SiteId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
SiteId | long | Yes | The website ID, which can be obtained by calling the ListSites operation. | 1234567890123 |
RecordList | array<object> | Yes | The list of DNS records to be created. | |
object | Yes | A single record object that contains specific configuration information. | ||
BizName | string | No | The business scenario of the record for acceleration. Valid values:
| web |
Data | object | Yes | The DNS information of the record. Enter fields based on the record type. | |
Value | string | No | The record value or part of the record content. A/AAAA: the IP address being pointed to. CNAME: the target domain name being pointed to. MX: valid target mail server domain name. TXT: valid text string. CAA: valid certificate authority domain name. SRV: valid target host domain name. URI: valid URI string. | example.com |
Priority | integer | No | The priority of the record. Valid values: 0 to 65535. A smaller value indicates a higher priority. This parameter is required when you add MX, SRV, and URI records. | 2 |
Flag | integer | No | The Flag for a CAA record indicates its priority and how it is processed. Valid values: 0 to 255. | 128 |
Tag | string | No | The tag of a CAA record, which indicates its specific type and purpose, such as issue, issuewild, and iodef. | issue |
Weight | integer | No | The weight of the record. Valid values: 0 to 65,535. Applicable to SRV and URI records. | 0 |
Port | integer | No | The port of the record. Valid values: 0 to 65535. Exclusive to SRV records. | 0 |
Type | integer | No | The certificate type of the record (in CERT records), or the public key type (in SSHFP records). | 0 |
KeyTag | integer | No | The public key identification for the record. Valid values: 0 to 65535. Applicable to CERT records. | 0 |
Algorithm | integer | No | The encryption algorithm used for the record. Valid values: 0 to 255. Applicable to CERT and SSHFP records. | 0 |
Certificate | string | No | The public key of the certificate. Applicable to CERT, SMIMEA, and TLSA records. | dGVzdGFkYWxrcw== |
Usage | integer | No | The usage identifier of the record. Valid values: 0 to 255. Applicable to SMIMEA and TLSA records. | 0 |
Selector | integer | No | The type of certificate or public key. Valid values: 0 to 255. Applicable to SMIMEA and TLSA records. | 0 |
MatchingType | integer | No | The algorithm policy used to match or validate the certificate. Valid values: 0 to 255. Applicable to SMIMEA, and TLSA records. | 0 |
Fingerprint | string | No | The public key fingerprint of the record. Applicable to SSHFP records. | abcdef1234567890 |
Ttl | integer | Yes | The TTL of the record. Unit: seconds. If the value is 1, the TTL of the record is determined by the system. | 60 |
Type | string | Yes | The DNS type of the record. | A/AAAA |
Proxied | boolean | Yes | Specifies whether to proxy the record. Only CNAME and A/AAAA records can be proxied. Valid values:
| true |
RecordName | string | Yes | The record name. | www.example.com |
SourceType | string | No | The origin type for the CNAME record. This parameter is required when you add a CNAME record. Valid values:
If you do not pass this parameter or if you leave its value empty, Domain is used by default. | OSS |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "2430E05E-1340-5773-B5E1-B743929F46F2",
"RecordResultList": {
"Success": [
{
"RecordId": 1234567890123,
"RecordName": "www.example.com",
"RecordType": "A/AAAA",
"Description": "success",
"Data": {
"Value": "example.com",
"Priority": 10,
"Flag": 128,
"Tag": "issue",
"Weight": 0,
"Port": 0,
"Type": 0,
"KeyTag": 0,
"Algorithm": 0,
"Certificate": "dGVzdGFkYWxrcw==",
"Usage": 0,
"Selector": 0,
"MatchingType": 0,
"Fingerprint": "abcdef1234567890"
},
"SourceType": "OSS",
"Ttl": 60,
"BizName": "web",
"Proxied": true
}
],
"Failed": [
{
"RecordId": 1234567890123,
"RecordName": "a.example.com",
"RecordType": "A/AAAA",
"Description": "",
"Data": {
"Value": "example.com",
"Priority": 10,
"Flag": 128,
"Tag": "issue",
"Weight": 0,
"Port": 0,
"Type": 0,
"KeyTag": 0,
"Algorithm": 0,
"Certificate": "dGVzdGFkYWxrcw==",
"Usage": 0,
"Selector": 0,
"MatchingType": 0,
"Fingerprint": "abcdef1234567890"
},
"SourceType": "OSS",
"Ttl": 60,
"BizName": "web",
"Proxied": true
}
],
"TotalCount": 20
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InternalException | Failed to call the service. Try again later or contact technical support. | Failed to call the service. Try again later or contact technical support. |
400 | QuotaExceed.RecordCount | The maximum number of records has been reached. Delete some and try again or upgrade your plan. | The maximum number of records has been reached. Delete some and try again or upgrade your plan. |
400 | Site.ServiceBusy | This website is being configured. Try again later. | This website is being configured. Try again later. |
400 | Record.Conflict | The specified record content conflicts with existing records. Adjust your configurations based on the related product documentation. | The specified record content conflicts with existing records. Adjust your configurations based on the related product documentation. |
400 | SourceCircleExist | The host record of the resource to be operated on is already the source station of another resource, or the source station of the current resource has been added as a host record. To avoid loopback, modify the host record or source station and retry. | The host record of the resource to be operated on is already the source station of another resource, or the source station of the current resource has been added as a host record. To avoid loopback, modify the host record or source station and retry. |
400 | InvalidParameter.RecordsExceedLimit | The number of incoming records exceeds the maximum limit. | The number of incoming records exceeds the maximum limit. |
400 | QuotaExceed.WildcardRecordCount | The number of wildcard records added by your current site has reached the quota limit. Please delete useless wildcard records or upgrade to the plan and try again. | The number of wildcard records added by your current site has reached the quota limit. Please delete useless wildcard records or upgrade to the plan and try again. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2025-02-18 | The Error code has changed | View Change Details |
2024-11-12 | The Error code has changed | View Change Details |
2024-10-11 | The Error code has changed | View Change Details |
2024-09-24 | The Error code has changed | View Change Details |
2024-09-18 | The Error code has changed | View Change Details |