All Products
Search
Document Center

Edge Security Acceleration:BatchCreateRecords

Last Updated:Apr 16, 2025

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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
esa:BatchCreateRecordscreate
*Site
acs:esa:{#regionId}:{#accountId}:site/{#SiteId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
SiteIdlongYes

The website ID, which can be obtained by calling the ListSites operation.

1234567890123
RecordListarray<object>Yes

The list of DNS records to be created.

objectYes

A single record object that contains specific configuration information.

BizNamestringNo

The business scenario of the record for acceleration. Valid values:

  • image_video
  • api
  • web
web
DataobjectYes

The DNS information of the record. Enter fields based on the record type.

ValuestringNo

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
PriorityintegerNo

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
FlagintegerNo

The Flag for a CAA record indicates its priority and how it is processed. Valid values: 0 to 255.

128
TagstringNo

The tag of a CAA record, which indicates its specific type and purpose, such as issue, issuewild, and iodef.

issue
WeightintegerNo

The weight of the record. Valid values: 0 to 65,535. Applicable to SRV and URI records.

0
PortintegerNo

The port of the record. Valid values: 0 to 65535. Exclusive to SRV records.

0
TypeintegerNo

The certificate type of the record (in CERT records), or the public key type (in SSHFP records).

0
KeyTagintegerNo

The public key identification for the record. Valid values: 0 to 65535. Applicable to CERT records.

0
AlgorithmintegerNo

The encryption algorithm used for the record. Valid values: 0 to 255. Applicable to CERT and SSHFP records.

0
CertificatestringNo

The public key of the certificate. Applicable to CERT, SMIMEA, and TLSA records.

dGVzdGFkYWxrcw==
UsageintegerNo

The usage identifier of the record. Valid values: 0 to 255. Applicable to SMIMEA and TLSA records.

0
SelectorintegerNo

The type of certificate or public key. Valid values: 0 to 255. Applicable to SMIMEA and TLSA records.

0
MatchingTypeintegerNo

The algorithm policy used to match or validate the certificate. Valid values: 0 to 255. Applicable to SMIMEA, and TLSA records.

0
FingerprintstringNo

The public key fingerprint of the record. Applicable to SSHFP records.

abcdef1234567890
TtlintegerYes

The TTL of the record. Unit: seconds. If the value is 1, the TTL of the record is determined by the system.

60
TypestringYes

The DNS type of the record.

A/AAAA
ProxiedbooleanYes

Specifies whether to proxy the record. Only CNAME and A/AAAA records can be proxied. Valid values:

  • true
  • false
true
RecordNamestringYes

The record name.

www.example.com
SourceTypestringNo

The origin type for the CNAME record. This parameter is required when you add a CNAME record. Valid values:

  • OSS: OSS bucket.
  • S3: S3 bucket.
  • LB: load balancer.
  • OP: origin pool.
  • Domain: domain name.

If you do not pass this parameter or if you leave its value empty, Domain is used by default.

OSS

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

2430E05E-1340-5773-B5E1-B743929F46F2
RecordResultListobject

The records that have been created and failed to be created.

Successarray<object>

The records that have been created.

SuccessListobject
RecordIdlong

The record ID.

1234567890123
RecordNamestring

The record name.

www.example.com
RecordTypestring

The DNS type of the record, such as A/AAAA, CNAME, and TXT.

A/AAAA
Descriptionstring

The result description.

success
Dataobject

The DNS record information.

Valuestring

The record value or part of the record content. This value is returned when the record is A/AAAA, CNAME, NS, MX, TXT, CAA, SRV, or URI. It has different meanings based on types of records:

  • A/AAAA: the IP addresses. Multiple IPs are separated by commas (,). There is at least one IPv4 address.
  • CNAME: the mapped domain name.
  • NS: the nameservers for the domain name.
  • MX: a valid domain name of the target mail server.
  • TXT: a valid text string.
  • CAA: a valid domain name of the certificate authority.
  • SRV: a valid domain name of the target host.
  • URI: a valid URI string.
example.com
Priorityinteger

The priority of the record. Valid values: 0 to 65535. A smaller value indicates a higher priority. Applicable to MX, SRV, and URI records.

10
Flaginteger

The flag bit of the record. Indicates its priority and handling method, used in CAA records.

128
Tagstring

The label of a CAA record, which indicates its specific type and purpose, such as issue, issuewild, and iodef.

issue
Weightinteger

The weight of the record. Valid values: 0 to 65535. Applicable to SRV and URI records.

0
Portinteger

The port of the record. Valid values: 0 to 65535. Exclusive to SRV records.

0
Typeinteger

The certificate type of the record (in CERT records), or the public key type (in SSHFP records).

0
KeyTaginteger

The public key identification for the record. Valid values: 0 to 65535. Applicable to CERT records.

0
Algorithminteger

The encryption algorithm used for the record. Valid values: 0 to 255. Applicable to CERT and SSHFP records.

0
Certificatestring

The public key of the certificate. Applicable to CERT, SMIMEA, and TLSA records.

dGVzdGFkYWxrcw==
Usageinteger

The usage identifier of the record. Valid values: 0 to 255. Applicable to SMIMEA and TLSA records.

0
Selectorinteger

The type of certificate or public key. Valid values: 0 to 255. Applicable to SMIMEA and TLSA records.

0
MatchingTypeinteger

The algorithm policy used to match or validate the certificate. Valid values: 0 to 255. Applicable to SMIMEA and TLSA records.

0
Fingerprintstring

The public key fingerprint of the record. Applicable to SSHFP records.

abcdef1234567890
SourceTypestring

The origin type of the CNAME record. This field is left empty for other types of records. The type of the origin server. Valid values:

  • OSS: OSS bucket.
  • S3: S3 bucket.
  • LB: load balancer.
  • OP: origin pool.
  • Domain: domain name.
OSS
Ttlinteger

The TTL of the record. Unit: seconds. If the value is 1, the TTL of the record is determined by the system.

60
BizNamestring

The business scenario of the record for acceleration. Valid values:

  • image_video
  • api
  • web
web
Proxiedboolean

Indicates whether the record is proxied. Only CNAME and A/AAAA records can be proxied. Valid values:

  • true
  • false
true
Failedarray<object>

The records that failed to be created.

SuccessListobject
RecordIdlong

The record ID.

1234567890123
RecordNamestring

The record name.

a.example.com
RecordTypestring

The DNS type of the record, such as A/AAAA, CNAME, and TXT.

A/AAAA
Descriptionstring

The result description.

Dataobject

The DNS information about the record, which contains various types of record values and their related attributes.

Valuestring

The record value or part of the record content. This value is returned when the record is A/AAAA, CNAME, NS, MX, TXT, CAA, SRV, or URI. It has different meanings based on types of records:

  • A/AAAA: the IP addresses. IP addresses are separated by commas (,). There is at least one IPv4 address.
  • CNAME: the mapped domain name.
  • NS: the nameservers for the domain name.
  • MX: a valid domain name of the target mail server.
  • TXT: a valid text string.
  • CAA: a valid domain name of the certificate authority.
  • SRV: a valid domain name of the target host.
  • URI: a valid URI string.
example.com
Priorityinteger

The priority of the record. Valid values: 0 to 65535. A smaller value indicates a higher priority. Applicable to MX, SRV, and URI records.

10
Flaginteger

The flag bit of the record. Indicates its priority and handling method, used in CAA records.

128
Tagstring

Indicates its priority and handling method, used in CAA records.

issue
Weightinteger

The weight of the record. Applicable to SRV and URI records.

0
Portinteger

The port number of the record, associated with the SRV record. Exclusive to SRV records.

0
Typeinteger

The certificate type of the record (in CERT records), or the public key type (in SSHFP records).

0
KeyTaginteger

The public key identification for the record. Valid values: 0 to 65535. Applicable to CERT records.

0
Algorithminteger

The encryption algorithm used for the record. Valid values: 0 to 255. Applicable to CERT and SSHFP records.

0
Certificatestring

The public key of the certificate. Applicable to CERT, SMIMEA, and TLSA records.

dGVzdGFkYWxrcw==
Usageinteger

The usage identifier of the record. Valid values: 0 to 255. Applicable to SMIMEA and TLSA records.

0
Selectorinteger

The type of certificate or public key. Valid values: 0 to 255. Applicable to SMIMEA and TLSA records.

0
MatchingTypeinteger

The algorithm policy used to match or validate the certificate. Valid values: 0 to 255. Applicable to SMIMEA and TLSA records.

RSA
Fingerprintstring

The public key fingerprint of the record. Applicable to SSHFP records.

abcdef1234567890
SourceTypestring

The origin type of the CNAME record. This field is left empty for other types of records. The type of the origin server. Valid values:

  • OSS: OSS bucket.
  • S3: S3 bucket.
  • LB: load balancer.
  • OP: origin pool.
  • Domain: domain name.
OSS
Ttlinteger

The TTL of the record. Unit: seconds. If the value is 1, the TTL of the record is determined by the system.

60
BizNamestring

The business scenario of the record for acceleration. Valid values:

  • image_video
  • api
  • web
web
Proxiedboolean

Indicates whether the record is proxied. Only CNAME and A/AAAA records can be proxied. Valid values:

  • true
  • false
true
TotalCountinteger

The total number of returned records.

20

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError messageDescription
400InternalExceptionFailed to call the service. Try again later or contact technical support.Failed to call the service. Try again later or contact technical support.
400QuotaExceed.RecordCountThe 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.
400Site.ServiceBusyThis website is being configured. Try again later.This website is being configured. Try again later.
400Record.ConflictThe 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.
400SourceCircleExistThe 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.
400InvalidParameter.RecordsExceedLimitThe number of incoming records exceeds the maximum limit.The number of incoming records exceeds the maximum limit.
400QuotaExceed.WildcardRecordCountThe 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 timeSummary of changesOperation
2025-02-18The Error code has changedView Change Details
2024-11-12The Error code has changedView Change Details
2024-10-11The Error code has changedView Change Details
2024-09-24The Error code has changedView Change Details
2024-09-18The Error code has changedView Change Details