一个证书批量设置多个域名
功能介绍
一个证书配置多个域名,设置域名强制https回源参数。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
PUT /v1.0/cdn/domains/config-https-info
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
enterprise_project_id |
否 |
String |
当用户开启企业项目功能时,该参数生效,表示修改当前企业项目下加速域名的配置,"all"代表所有项目。注意:当使用子帐号调用接口时,该参数必传。 您可以通过调用企业项目管理服务(EPS)的查询企业项目列表接口(ListEnterpriseProject)查询企业项目id。 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
https |
否 |
https配置。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
domain_name |
是 |
String |
域名列表,逗号分割,上限50个域名 |
https_switch |
是 |
Integer |
https开关(0:"关闭";1:"设置证书" https_switch为1时,证书参数不能为空) |
access_origin_way |
否 |
Integer |
回源方式:1:"回源跟随";2:"http"(默认),3:"https" 为空值时默认设置为http |
force_redirect_https |
否 |
Integer |
强制跳转HTTPS(0:不强制;1:强制) 为空值时默认设置为关闭。(此参数即将下线,建议使用force_redirect_config修改配置) |
force_redirect_config |
否 |
ForceRedirect object |
强制跳转。 |
http2 |
否 |
Integer |
http2.0(0:关闭;1:开启) 为空值时默认设置为关闭 |
cert_name |
否 |
String |
证书名称(设置证书必填)(长度限制为3-64字符)。 |
certificate |
否 |
String |
HTTPS协议使用的SSL证书内容,仅支持PEM编码格式。不启用证书则无需输入。初次配置证书时必传。 |
private_key |
否 |
String |
HTTPS协议使用的SSL证书私钥内容,仅支持PEM编码格式。不启用证书则无需输入。初次配置证书时必传。 |
certificate_type |
否 |
Integer |
证书类型(0为自有证书 ;1为托管证书,此时不必不传入证书内容和私钥,自动根据证书名称匹配;不传默认为自有证书) |
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
https |
https配置。 |
参数 |
参数类型 |
描述 |
---|---|---|
domain_name |
String |
域名列表。 |
https_switch |
Integer |
https开关(0:"关闭";1:"设置证书")。 |
access_origin_way |
Integer |
回源方式:1:"回源跟随";2:"HTTP"(默认),3:https(自建)。 |
force_redirect_https |
Integer |
强制跳转HTTPS(0:不强制;1:强制) 。 |
force_redirect_config |
ForceRedirect object |
强制跳转。 |
http2 |
Integer |
http2.0(0:关闭;1:开启) |
cert_name |
String |
证书名称。 |
certificate |
String |
证书内容。 |
certificate_type |
Integer |
证书类型(0为自有证书 , 1为托管证书)。 |
expiration_time |
Long |
证书过期时间。 |
请求示例
{ "https" : { "domain_name" : "example1.com", "access_origin_way" : 2, "http2" : 0, "certificate_type" : 0, "force_redirect_config" : { "redirect_type" : "https", "switch" : 1 }, "https_switch" : 1, "cert_name" : "cdn_test_cert", "certificate" : "-----BEGIN CERTIFICATE----------END CERTIFICATE-----", "private_key" : "-----BEGIN RSA PRIVATE KEY---------END RSA PRIVATE KEY-----" } }
响应示例
状态码: 200
OK
{ "https" : { "domain_name" : "example1.com", "https_switch" : 1, "access_origin_way" : 2, "force_redirect_https" : 1, "force_redirect_config" : { "redirect_type" : "https", "switch" : 1 }, "http2" : 0, "expiration_time" : 1925791912000, "cert_name" : "cdn_test_cert", "certificate" : "-----BEGIN CERTIFICATE----------END CERTIFICATE-----", "certificate_type" : 0 } }
状态码
状态码 |
描述 |
---|---|
200 |
OK |
错误码
请参见错误码。