Help Center> Content Delivery Network> API Reference> API> Domain Name Configuration> Querying All Domain Names Associated with HTTPS Certificates
Updated on 2024-03-21 GMT+08:00

Querying All Domain Names Associated with HTTPS Certificates

Function

This API is used to query all domain names associated with HTTPS certificates.

URI

GET /v1.0/cdn/domains/https-certificate-info

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

page_size

No

Integer

Number of records on each page. The value ranges from 1 to 10,000. The default value is 30.

page_number

No

Integer

Page number. The value ranges from 1 to 65,535. The default value is 1.

domain_name

No

String

Domain name.

user_domain_id

No

String

Domain ID of the domain name's owner.

enterprise_project_id

No

String

ID of the enterprise project to which the resource belongs. 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 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It 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 3 Response body parameters

Parameter

Type

Description

total

Integer

Total number of queried records.

https

Array of HttpsDetail objects

HTTPS settings.

Table 4 HttpsDetail

Parameter

Type

Description

domain_id

String

Domain name ID.

domain_name

String

Domain name associated with the certificate.

cert_name

String

Certificate name.

certificate

String

Certificate content.

private_key

String

Private key.

certificate_type

Integer

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

expiration_time

Long

Certificate expiration time.

https_status

Integer

Whether HTTPS is enabled. 0: HTTPS is disabled. 1: HTTPS is enabled and the origin protocol is the same as that of user requests. 2: HTTPS is enabled and the origin protocol is HTTP.

force_redirect_https

Integer

Whether force redirect is enabled. Possible values: 0 (no), 1 (yes), and 2 (force HTTP.)

force_redirect_config

ForceRedirect object

Force redirect.

http2

Integer

Whether HTTP/2 is used. Possible values: 1 (yes) and 0 (no).

Table 5 ForceRedirect

Parameter

Type

Description

switch

Integer

Force redirect status. 1 enabled. 0: disabled.

redirect_type

String

Protocol to which requests are forcibly redirected. Possible values: http and https.

Example Requests

GET https://cdn.myhuaweicloud.com/v1.0/cdn/domains/https-certificate-info?domain_name=www.example.com&page_size=10&page_number=1

Example Responses

Status code: 200

OK

{
  "total" : 1,
  "https" : [ {
    "https_status" : 1,
    "force_redirect_https" : 2,
    "force_redirect_config" : {
      "redirect_type" : "http",
      "switch" : 1
    },
    "http2" : 0,
    "cert_name" : "cdn_test",
    "certificate" : "-----BEGIN CERTIFICATE-----XX-----END CERTIFICATE-----",
    "private_key" : null,
    "certificate_type" : 0,
    "expiration_time" : 1606187416000,
    "domain_id" : "3e****************************63",
    "domain_name" : "www.example.com"
  } ]
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.