查询HTTPS配置
功能介绍
获取加速域名证书。
URI
GET /v1.0/cdn/domains/{domain_id}/https-info
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
domain_id | 是 | String | 加速域名id。 您可以通过查询加速域名接口查询加速域名id。 |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
enterprise_project_id | 否 | String | 当用户开启企业项目功能时,该参数生效,表示查询资源所属项目,"all"表示所有项目。注意:当使用子账号调用接口时,该参数必传。 您可以通过调用企业项目管理服务(EPS)的查询企业项目列表接口(ListEnterpriseProject)查询企业项目id。 |
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
X-Auth-Token | 是 | String | 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
响应参数
状态码:200
参数 | 参数类型 | 描述 |
|---|---|---|
https | HttpInfoResponseBody object | https配置。 |
参数 | 参数类型 | 描述 |
|---|---|---|
https_status | Integer | HTTPS证书是否启用。0:不启用,此时无需填写证书及私钥参数;1:启用HTTPS加速并协议跟随回源;2:启用HTTPS加速并HTTP回源;3:启用HTTPS加速并HTTPS回源,开启时需要传递证书及私钥 |
cert_name | String | 证书名称。(长度限制为3-32字符)。 |
certificate | String | 证书内容。 |
private_key | String | 功能说明: HTTPS协议使用的私钥,不启用证书则无需输入。(为了客户信息安全,接口返回私钥为空) |
certificate_type | Integer | 证书类型。1:代表华为云托管证书;0:表示自有证书。 |
force_redirect_https | Integer | 客户端请求是否强制重定向。1是,0否。(如果为2,表示强制跳转HTTP) |
force_redirect_config | ForceRedirect object | 强制跳转 |
http2 | Integer | 是否使用HTTP2.0。(1是,0否。) |
expiration_time | Long | 证书过期时间 |
请求示例
GET https://cdn.myhuaweicloud.com/v1.0/cdn/domains/ff808***********************307d/https-info?enterprise_project_id=0
响应示例
状态码:200
OK
{
"https" : {
"https_status" : 2,
"force_redirect_https" : 1,
"http2" : 0,
"cert_name" : "cdn_test_cert",
"certificate" : "-----BEGIN CERTIFICATE----------END CERTIFICATE-----",
"private_key" : "",
"certificate_type" : 0,
"expiration_time" : 1636183290000
}
} 状态码
状态码 | 描述 |
|---|---|
200 | OK |
错误码
请参见错误码。

