Creates a SaaS domain name under a site.
Operation description
If the acceleration area is set to the Chinese mainland only or global, the site domain name must have a valid Internet Content Provider (ICP) filing.
Each user can invoke this operation up to 100 times per hour.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
esa:CreateCustomHostname |
create |
*Site
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Hostname |
string |
Yes |
The SaaS domain name. |
custom.site.com |
| SiteId |
integer |
Yes |
The site ID, which can be obtained by calling the ListSites operation. |
1234567890123 |
| RecordId |
integer |
Yes |
The ID of the record to bind. You can obtain this value by calling the ListRecords operation. |
1234567890123 |
| SslFlag |
string |
Yes |
Specifies whether to enable SSL. Valid values:
Valid values:
|
on |
| CertType |
string |
No |
The certificate type. This parameter is required when SslFlag is set to on. Valid values:
Valid values:
|
free |
| Certificate |
string |
No |
The certificate content. This parameter is required when CertType is set to upload. |
-----BEGIN CERTIFICATE----- |
| PrivateKey |
string |
No |
The private key of the certificate. This parameter is required when CertType is set to upload. |
-----BEGIN PRIVATE KEY----- |
| CasId |
integer |
No |
The SSL Certificates Service certificate ID. This parameter is required when CertType is set to cas. |
30000478 |
| CasRegion |
string |
No |
The region of the SSL Certificates Service certificate. This parameter is required when CertType is set to cas.
|
cn-hangzhou |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Hostname |
string |
The SaaS domain name. |
custom.site.com |
| HostnameId |
integer |
The ID of the SaaS domain name. |
1234567890123 |
| RequestId |
string |
The request ID, which is a unique identifier generated by Alibaba Cloud for this request. |
0AEDAF20-4DDF-4165-8750-47FF9C1929C9 |
Examples
Success response
JSON format
{
"Hostname": "custom.site.com",
"HostnameId": 1234567890123,
"RequestId": "0AEDAF20-4DDF-4165-8750-47FF9C1929C9"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The specified parameter is invalid. | The specified parameter is invalid. |
| 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 | Instance.NotOnline | Your plan is unavailable due to an overdue payment. Complete the payment first. | Your plan is unavailable due to an overdue payment. Complete the payment first. |
| 400 | Site.ServiceBusy | This website is being configured. Try again later. | This website is being configured. Try again later. |
| 400 | CustomHostname.ConflictWithExistingResource | The custom hostname conflicts with existing resources, such as sites, records, load balancers, source address pools, custom hostnames and Layer 4 proxy records. | The custom hostname conflicts with existing resources, such as sites, records, load balancers, source address pools, custom hostnames and Layer 4 proxy records. |
| 400 | CustomHostname.ApplyCertFailed | Fail to apply a free cert for custom hostname. Please try again later. | Fail to apply a free cert for custom hostname. Please try again later. |
| 400 | CustomHostname.SetCertFailed | Fail to deploy a cert for custom hostname. Please try again later. | Fail to deploy a cert for custom hostname. Please try again later. |
| 400 | CustomHostname.CheckQuotaFailed | Fail to check quota for custom hostname. Please try again later. | Failed to check the custom hostname quota for the site. Try again later. |
| 400 | CustomHostname.OfflineForMultiReason | Unable to activate the custom hostname because it is offline due to multiple reasons. | The custom hostname has been taken offline for multiple reasons and cannot be activated. |
| 400 | CustomHostname.WildcardDomainRequireEnterprisePlan | Wildcard custom hostnames require an Enterprise plan. | Only Enterprise Edition plans support adding wildcard SaaS domain names. Upgrade your plan and try again. |
| 400 | CustomHostname.QueryCasCertFailed | Fail to query CAS certificate details. Please try again later. | Failed to query the China Shield certificate details. Try again later. |
| 400 | QuotaExceed.CustomHostname | The number of custom hostnames exceeds the plan quota. Contact the sales team to increase your quota. | The number of custom hostnames exceeds the plan quota. Contact the sales team to increase your quota. |
| 400 | ICPCheckFailed | The ICP filing verification service is temporarily unavailable. Please try again later. | The filing query service is abnormal. Please try again later. |
| 400 | CustomHostname.InvalidICP | The specified website does not have an ICP filing or the filing information is invalid. Make sure your website is filed and try again. | The specified website does not have an ICP filing or the filing information is invalid. Make sure your website is filed and try again. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.