全部产品
Search
文档中心

边缘安全加速:CreateCustomHostname - 创建 SaaS 域名

更新时间:Jan 30, 2026

在站点下创建一个 SaaS 域名。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求参数

名称

类型

必填

描述

示例值

Hostname

string

SaaS 域名

custom.site.com

SiteId

integer

站点 ID,可通过调用 ListSites 接口获取。

1234567890123

RecordId

integer

待绑定记录的 ID,可以通过 ListRecords 获取。

1234567890123

SslFlag

string

SSL 开关。

  • on: 开启 SSL。

  • off: 关闭 SSL。

on

CertType

string

证书类型,SslFlag 为 on 时需要输入该参数。

  • free: 免费证书。

  • upload: 上传证书。

  • cas: 云盾证书。

free

Certificate

string

证书内容,CertType 为 upload 时需要输入该参数。

-----BEGIN CERTIFICATE-----

PrivateKey

string

证书私钥,CertType 为 upload 时需要输入该参数。

-----BEGIN PRIVATE KEY-----

CasId

integer

云盾证书 ID,CertType 为 cas 时需要输入该参数。

30000478

CasRegion

string

云盾证书地域,CertType 为 cas 时需要输入该参数。

  • 中国站账号传参数值:cn-hangzhou。

  • 国际站账号传参数值:ap-southeast-1。

cn-hangzhou

返回参数

名称

类型

描述

示例值

object

RequestId

string

请求 ID,阿里云为该请求生成的唯一标识符。

0AEDAF20-4DDF-4165-8750-47FF9C1929C9

HostnameId

integer

SaaS 域名的 ID。

1234567890123

Hostname

string

SaaS 域名。

custom.site.com

示例

正常返回示例

JSON格式

{
  "RequestId": "0AEDAF20-4DDF-4165-8750-47FF9C1929C9",
  "HostnameId": 1234567890123,
  "Hostname": "custom.site.com"
}

错误码

HTTP status code

错误码

错误信息

描述

400 InvalidParameter The specified parameter is invalid. 输入参数规范校验失败。
400 InternalException 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. 您的套餐实例因欠费当前处于非上线状态,请先完成续费操作以继续使用。
400 Site.ServiceBusy 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. 自定义主机名和已有资源冲突,例如站点、记录、负载均衡器、源地址池、自定义主机名和四层代理等
400 QuotaExceed.CustomHostname The number of custom hostnames exceeds the plan quota. Contact the sales team to increase your quota. 自定义主机名的数量超限,请联系销售增加额度。
400 CustomHostname.ApplyCertFailed 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. 自定义主机名的证书部署失败,请稍后重试。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情