All Products
Search
Document Center

CDN:AddCdnDomain

Last Updated:Aug 06, 2024

Adds a domain name to accelerate.

Operation description

  • You must activate Alibaba Cloud CDN before you can add a domain name to it. For more information, see Activate Alibaba Cloud CDN.
  • The domain name that you want to add has a valid Internet Content Provider (ICP) number.
  • You can add only one domain name to Alibaba Cloud CDN in each call. Each Alibaba Cloud account can add a maximum of 50 domain names to Alibaba Cloud CDN.
  • If the content of the origin server is not stored on Alibaba Cloud, the content must be reviewed. The review will be completed by the end of the next business day after you submit the application.
  • You can call this operation up to 30 times per second per account.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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:
    • The required resource types are displayed in bold characters.
    • 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
cdn:AddCdnDomain
  • Domain
    acs:cdn:*:{#accountId}:domain/{#DomainName}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
CdnTypestringYes

The workload type of the accelerated domain name. Valid values:

  • web: images and small files
  • download: large files
  • video: on-demand video and audio streaming
Enumeration Value:
  • unitcell
  • web
  • download
  • liveStream
  • video
  • app
web
DomainNamestringYes

The domain name that you want to add to Alibaba Cloud CDN.

A wildcard domain that starts with a period (.) is supported, such as .example.com.

.example.com
ResourceGroupIdstringNo

The ID of the resource group.

If you do not set this parameter, the system uses the ID of the default resource group.

rg-acfmyuji4b6r4**
SourcesstringYes

The information about the addresses of origin servers.

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

The URL that is used to check the accessibility of the origin server.

www.example.com/test.html
ScopestringNo

The acceleration region. Default value: domestic. Valid values:

  • domestic: Chinese mainland
  • overseas: global (excluding the Chinese mainland)
  • global: global
domestic
TopLevelDomainstringNo

The top-level domain.

example.com
Tagarray<object>No

Details about the tags. You can specify up to 20 tags.

objectNo
KeystringNo

The key of the tag. Valid values of N: 1 to 20.

env
ValuestringNo

The value of the tag. Valid values of N: 1 to 20.

value

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

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

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400InvalidDomainName.MalformedSpecified DomainName is malformed.The specified DomainName parameter is invalid or wildcard domain names cannot be batch added.
400MissingParameterThe input parameter cdnType that is mandatory for processing this request is not supplied.You must specify the cdnType parameter.
400InvalidCdnType.MalformedSpecified 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.
400InvalidSources.MalformedSpecified Sources is malformed.The specified origin address is invalid.
400MissingParameterOrigin server information is not complete, please fill in again.-
400MissingParameterThe input parameter sourceType that is mandatory for processing this request is not supplied.Parameter sourceType is required.
400InvalidSourceType.MalformedSpecified CdnType is malformed.The specified CdnType parameter is invalid.
400InvalidSource.Priority.MalformedThe specified Source Priority is invalid.-
400InvalidTypeAndContent.MissMatchThe specified source type does not match the specified source content.-
400InvalidScope.MalformedSpecified Scope is malformed.The specified Scope parameter is invalid.
400SourceIp.ExceedThe Certificate you provided is malformedThe specified certificate format is invalid.
400InvalidCertificateThe Certificate you provided is malformedThe specified certificate format is invalid.
400InvalidCertificate.TooLongThe Certificate you provided is over the max lengthCertificate and private key length exceeds the limit
400InnerAddDomainDeniedYour 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.
400CheckSourceHealthFailedsources 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.
400ExtensiveAndAllBothExistExtensive 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.
400CdnTypeNotSupportExtensiveDomainExtensive 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.
400ExtensiveAndSpecificDomainConflictThe number of wildcard domain names exceeds the limit.-
400InvalidResourceGroupId.MalformedSpecified ResourceGroupId is malformed.Format of parameter ResourceGroupId is incorrect.
400DomainReservedThe root domain of your domain is reserved by another account. Submit a ticket to contact customer support.-
400InvalidDomainNameLevelDomain name suffixed with alicdn.com only support third level.alicdn.com supports up to three domain levels for wildcard domain names.
400InvalidTopLevelDomain.MalformedSpecified TopLevelDomain is malformed.The specified TopLevelDomain parameter is invalid.
400TopLevelDomain.NotFoundTopLevelDomain is not exist.The specified TopLevelDomain parameter does not exist.
400EntityNotExists.ResourceGroupThe resource group does not exist.The specified ResourceGroup parameter does not exist.
400EntityNotExist.ResourceGroupThe resource group does not exist.The specified resource group does not exist.
400InvalidStatus.ResourceGroupIt 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.
400NotInternationRealIdentityYou 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.
400Abs.CheckUrl.MalformedThe CheckUrl you provided is malformed.-
400RecordCheckNotAvailableThe ICP filing interface is unavailable. Please try again later.-
400IcpBlackThe domain is on the ICP blacklist.-
400IspBlackThe domain is on the ISP blacklist.-
400DomainOwnerVerifyFailOwner 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.
400TopLevelDomain.MismatchThe specified TopLevelDomain does not match webSiteType.The top-level domain name does not match the domain name type.
400DomainInBlacklistThe domain is in the blacklist.The domain name is in the blacklist.
400InvalidTagKeyThe specified TagKey is invalid.-
400InvalidTagValueThe specified TagValue is invalid.-
400InvalidTagKey.RepeatedThe specified TagKey is duplicated.-
400InvalidTagThe specified Tag is Invalid.-
400InvalidTagKey.OverLimitThe number of Tag can not over limit 20.-
400SourceInBlacklistSource is in the blacklist.The origin server is in the blacklist.
400DomainOverLimitThe maximum number of domains is exceeded.The number of domain names exceeds the limit.
403AccountExceptionAccount exception. Please open ticket to make an appeal.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-12-12The Error code has changedView Change Details
2023-08-08The Error code has changed. The request parameters of the API has changedView Change Details
2023-06-27The Error code has changed. The request parameters of the API has changedView Change Details