Adds one or more domain names to Alibaba Cloud CDN. You can add a maximum of 50 domain names at a time.
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.
- If the acceleration region is Chinese Mainland Only or Global, you must apply for an ICP filing for the domain name.
- You can specify multiple domain names and separate them with commas (,). You can specify at most 50 domain names in each call.
- For more information, see Add a domain name.
- You can call this operation up to 30 times per second per account.
Debugging
Authorization information
There is currently no authorization information disclosed in the API.
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
CdnType | string | Yes | The workload type of the domain name to accelerate. Valid values:
| web |
DomainName | string | Yes | The domain names that you want to add to Alibaba Cloud CDN. Separate domain names with commas (,). | example.com,aliyundoc.com |
ResourceGroupId | string | No | The ID of the resource group. If you do not specify a value for this parameter, the system uses the ID of the default resource group. | rg-acfmyuji4b6r4** |
Sources | string | Yes | The information about the addresses of origin servers. | [ { "content": "192.0.2.0", "type": "ipaddr", "priority": "20", "port": 80, "weight": "15" } ] |
CheckUrl | string | No | The URL that is used for health checks. | url |
Scope | string | No | The acceleration region. Default value: domestic. Valid values:
| domestic |
TopLevelDomain | string | No | The top-level domain. | example.com |
The following table describes the fields in the Sources parameter.
Field | Type | Required | Description |
---|---|---|---|
type | String | Yes | The type of the origin server.ipaddr: an origin IP addressdomain: an origin domain nameoss: the domain name of an Object Storage Service (OSS) bucketfc_domain: a Function Compute domain name |
content | String | Yes | The address of the origin server. You can specify an IP address or a domain name. |
port | Integer | No | You can specify port 443, port 80, or a custom port. Default value: 80. If you specify port 443, CDN communicates with the origin server over HTTPS. |
priority | String | No | The priority of the origin server if multiple origin servers are specified. Valid values: 20 and 30. Default value: 20. A value of 20 specifies that the origin is a primary origin. A value of 30 specifies that the origin is a secondary origin. |
weight | String | No | The weight of the origin server if multiple origin servers are specified. You must specify a value that is less than 100. Default value: 10. |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "15C66C7B-671A-4297-9187-2C4477247A74"
}
Error codes
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 | MissingParameter | The Source Content must be specified. | - |
400 | MissingParameter | The input parameter sourceType that is mandatory for processing this request is not supplied. | Parameter sourceType is required. |
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. |
For a list of error codes, visit the Service error codes.