Updated on 2024-05-16 GMT+08:00

Querying HTTP Settings

Function

This API is used to query a certificate of an acceleration domain name.

URI

GET /v1.0/cdn/domains/{domain_id}/https-info

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

domain_id

Yes

String

Specifies the acceleration domain name ID. For details, see Querying Details About a Domain Name.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

Enterprise project that the resource belongs to. This parameter is valid only when the enterprise project function is enabled. The value all indicates all projects. This parameter is mandatory when you use an IAM user to call this API.

Obtain the enterprise project ID by calling the ListEnterpriseProject API of Enterprise Project Management Service (EPS).

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token.

The token can be obtained by calling the IAM API used to obtain a user token. The value of **X-Subject-Token** in the response header is the user token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

https

HttpInfoResponseBody object

Specifies the HTTPS settings.

Table 5 HttpInfoResponseBody

Parameter

Type

Description

https_status

Integer

Specifies whether to enable HTTPS. Possible values: 0: Disable HTTPS. The certificate and private key are not required. 1: Enable HTTPS and select Same as user for Origin Protocol on the CDN console. 2: Enable HTTPS and select HTTP for Origin Protocol on the CDN console. 3: Enable HTTPS and select HTTPS for Origin Protocol on the CDN console. The certificate and private key are required when HTTPS is enabled.

cert_name

String

Specifies the certificate name. The value contains 3 to 32 characters.

certificate

String

Specifies the certificate body.

private_key

String

Specifies the private key used by the HTTPS protocol. This parameter is not required if https_status is set to 0. The value is in PEM coding format.

certificate_type

Integer

Specifies the certificate type. Possible values: 1 (Huawei-managed certificate) and 0 (your own certificate).

force_redirect_https

Integer

Specifies whether forcible redirect is enabled. Possible values: 1 (yes) and 0 (no).

force_redirect_config

ForceRedirect object

Specifies the forcible redirect settings.

http2

Integer

Specifies whether to use HTTP/2. Possible values: 1 (yes) and 0 (no).

expiration_time

Long

Specifies the time when the certificate expires.

Table 6 ForceRedirect

Parameter

Type

Description

switch

Integer

Specifies whether to enable forcible redirect. Possible values: 1 (enabled) and 0 (disabled).

redirect_type

String

Specifies the protocol to which requests are forcibly redirected. Possible values: http and https.

Example Requests

GET https://cdn.myhuaweicloud.com/v1.0/cdn/domains/ff808***********************307d/https-info?enterprise_ptoject_id=0

Example Responses

Status code: 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
  }
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.