全部产品
Search
文档中心

CDN:BatchAddCdnDomain

更新时间:Dec 14, 2025

Menambahkan satu atau beberapa nama domain ke Alibaba Cloud CDN. Anda dapat menambahkan hingga 50 nama domain dalam satu kali panggilan.

Deskripsi operasi

  • Anda harus mengaktifkan Alibaba Cloud CDN sebelum menambahkan nama domain. Untuk informasi selengkapnya, lihat Aktifkan Alibaba Cloud CDN.

  • Jika wilayah akselerasi mencakup Tiongkok daratan saja atau bersifat global, Anda wajib mengajukan Pendaftaran ICP untuk nama domain tersebut.

  • Anda dapat menentukan beberapa nama domain yang dipisahkan dengan koma (,). Setiap panggilan API mendukung maksimal 50 nama domain.

  • Untuk informasi selengkapnya, lihat Tambahkan nama domain.

  • Operasi ini dapat dipanggil hingga 30 kali per detik per akun.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

cdn:BatchAddCdnDomain

create

*Domain

acs:cdn:*:{#accountId}:domain/*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

CdnType

string

Yes

Tipe workload dari nama domain yang akan diakselerasi. Nilai yang valid:

  • web: citra dan file kecil

  • download: file besar

  • video: streaming video dan audio on-demand

web

DomainName

string

Yes

Nama domain yang ingin Anda tambahkan ke Alibaba Cloud CDN. Pisahkan nama domain dengan koma (,).

example.com,aliyundoc.com

ResourceGroupId

string

No

ID kelompok sumber daya. Jika Anda tidak menentukan nilai untuk parameter ini, sistem akan menggunakan ID kelompok sumber daya default.

rg-acfmyuji4b6r4**

Sources

string

Yes

Informasi tentang alamat server origin.

[ { "content": "192.0.2.0", "type": "ipaddr", "priority": "20", "port": 80, "weight": "15" } ]

CheckUrl

string

No

URL yang digunakan untuk pemeriksaan kesehatan.

url

Scope

string

No

Wilayah akselerasi. Nilai default: domestic. Nilai yang valid:

  • domestic: Tiongkok daratan

  • overseas: global (tidak termasuk Tiongkok daratan)

  • global: global

domestic

TopLevelDomain

string

No

Domain tingkat atas.

example.com

Tabel berikut menjelaskan bidang-bidang dalam parameter Sources.

FieldTypeRequiredDescription
typeStringYesTipe server origin.ipaddr: alamat IP asal.domain: nama domain asal.oss: nama domain bucket Object Storage Service (OSS).fc_domain: nama domain Function Compute.
contentStringYesAlamat server origin. Anda dapat menentukan alamat IP atau nama domain.
portIntegerNoAnda dapat menentukan port 443, port 80, atau port kustom. Nilai default: 80. Jika Anda menentukan port 443, CDN berkomunikasi dengan server origin melalui HTTPS.
priorityStringNoPrioritas server origin jika terdapat beberapa server origin. Nilai yang valid: 20 dan 30. Nilai default: 20. Nilai 20 menunjukkan bahwa origin tersebut adalah origin primary. Nilai 30 menunjukkan bahwa origin tersebut adalah origin secondary.
weightStringNoBobot server origin jika terdapat beberapa server origin. Anda harus menentukan nilai kurang dari 100. Nilai default: 10.

Elemen respons

Element

Type

Description

Example

object

RequestId

string

ID permintaan.

15C66C7B-671A-4297-9187-2C4477247A74

Contoh

Respons sukses

JSONformat

{
  "RequestId": "15C66C7B-671A-4297-9187-2C4477247A74"
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 InvalidDomainName.Malformed Specified DomainName is malformed. The specified DomainName parameter is invalid or wildcard domain names cannot be batch added.
400 MissingParameter The input parameter cdnType that is mandatory for processing this request is not supplied. You must specify the cdnType parameter.
400 InvalidCdnType.Malformed Specified CdnType is malformed. The CdnType parameter is set to an invalid value. Valid values: web: distributes images and small files. download: accelerates large file downloads. video: accelerates distribution of on-demand audio and video content.
400 InvalidSources.Malformed Specified Sources is malformed. The specified origin address is invalid.
400 InvalidSourceType.Malformed Specified CdnType is malformed. The specified CdnType parameter is invalid.
400 InvalidSource.Priority.Malformed The specified Source Priority is invalid.
400 InvalidTypeAndContent.MissMatch InvalidTypeAndContent.MissMatch
400 InvalidScope.Malformed Specified Scope is malformed. The specified Scope parameter is invalid.
400 SourceIp.Exceed The Certificate you provided is malformed The specified certificate format is invalid.
400 InvalidCertificate The Certificate you provided is malformed The specified certificate format is invalid.
400 InvalidCertificate.TooLong The Certificate you provided is over the max length Certificate and private key length exceeds the limit
400 InnerAddDomainDenied Your account has not bind aoneId, can not add domain. You are not allowed to add domain names because your account is not bound to aoneId.
400 CheckSourceHealthFailed sources ip or source domain check health failed,please input right source. The origin IP address or domain name is invalid. Specify a valid value and try again.
400 ExtensiveAndAllBothExist Extensive domain and the domain begins with all. can not exist at the same time. Wildcard domain names and domain names that start with "all." cannot both exist.
400 CdnTypeNotSupportExtensiveDomain Extensive domain not supported for this cdn type. The specified CdnType parameter is not supported for wildcard domain names. Valid values: web: distributes images and small files. download: accelerates large file downloads. video: accelerates distribution of on-demand audio and video content.
400 ExtensiveAndSpecificDomainConflict The number of wildcard domain names exceeds the limit.
400 InvalidResourceGroupId.Malformed Specified ResourceGroupId is malformed. Format of parameter ResourceGroupId is incorrect.
400 DomainReserved The root domain of your domain is reserved by another account. Submit a ticket to contact customer support.
400 InvalidDomainNameLevel Domain name suffixed with alicdn.com only support third level. alicdn.com supports up to three domain levels for wildcard domain names.
400 InvalidTopLevelDomain.Malformed Specified TopLevelDomain is malformed. The specified TopLevelDomain parameter is invalid.
400 TopLevelDomain.NotFound TopLevelDomain is not exist. The specified TopLevelDomain parameter does not exist.
400 EntityNotExists.ResourceGroup The resource group does not exist. The specified ResourceGroup parameter does not exist.
400 EntityNotExist.ResourceGroup The resource group does not exist. The specified resource group does not exist.
400 InvalidStatus.ResourceGroup It is not allowed to do this operation because of the current status of resource-group. This operation is not supported while the resource group is in the current state.
400 NotInternationRealIdentity You need to do real name authentication when you use Chinese mainland resources. You have not passed real-name verification. According to the regulations issued by MIIT, you must pass real-name verification if you want to purchase IT services in the Chinese mainland.
400 RecordCheckNotAvailable The ICP filing interface is unavailable. Please try again later.
400 IcpBlack The domain is on the ICP blacklist.
400 IspBlack The domain is on the ISP blacklist.
400 DomainOwnerVerifyFail Owner verification of the root domain failed. The first time a domain name is added to Alibaba Cloud CDN, you must prove the ownership of the domain name. You must add a DNS record or a verification file for the domain name before it can be added to Alibaba Cloud CDN.
400 TopLevelDomain.Mismatch The specified TopLevelDomain does not match webSiteType. The top-level domain name does not match the domain name type.
400 DomainOverLimit The maximum number of domains is exceeded. The number of domain names exceeds the limit.
400 DomainInRiskList The domain you added may be at risk. If you have any questions, please submit a ticket. The domain name you added may be at risk. If you have any questions, please submit a work order.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.