Updated on 2024-06-11 GMT+08:00

Querying Domain Names

Function

This API is used to query domain names.

URI

GET /v1.0/cdn/domains

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

domain_name

No

String

Acceleration domain name, which is matched in a fuzzy manner. The value contains 1 to 255 characters.

business_type

No

String

Service type of the domain name. Possible values:

  • web: website acceleration.
  • download: file download acceleration.
  • video: on-demand service acceleration.

domain_status

No

String

Domain name status. Possible values:

  • online: CDN has been enabled for this domain name.
  • offline: CDN has been disabled for this domain name.
  • configuring: The domain name configuration is in progress.
  • configure_failed: The configuration fails.
  • checking: The domain is being reviewed.
  • check_failed: The domain name fails the review.
  • deleting: The domain name is being deleted.

service_area

No

String

Area of the acceleration service provided by CDN. Possible values:

  • europe: Europe.
  • outside_mainland_china: outside the Chinese mainland.

page_size

No

Integer

Number of domain names displayed per page. The value ranges from 1 to 10,000. The default value is 30.

page_number

No

Integer

Number of the page to be queried, that is, the page from which the query starts. The value ranges from 1 to 65,535. If this parameter is not set, the default value 1 is used.

exact_match

No

String

Exact match. on: enabled. off: disabled.

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 API for listing enterprise projects 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 corresponding IAM API (value of X-Subject-Token in the response header).

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

total

Integer

Total number of records.

domains

Array of Domains objects

Domain name details.

Table 4 Domains

Parameter

Type

Description

id

String

Domain name ID.

domain_name

String

Domain name.

business_type

String

Service type. Possible values: web (website acceleration), download (download acceleration), and video (on-demand service acceleration).

domain_status

String

Domain name status. Possible values:

  • online: CDN has been enabled for this domain name.
  • offline: CDN has been disabled for this domain name.
  • configuring: The domain name configuration is in progress.
  • configure_failed: The configuration fails.
  • checking: The domain is being reviewed.
  • check_failed: The domain name fails the review.
  • deleting: The domain name is being deleted.

cname

String

CNAME record of the domain name.

sources

Array of Sources objects

Origin server settings.

https_status

Integer

Whether HTTPS is enabled for acceleration.

create_time

Long

Time when the domain name was created. The value is the number of milliseconds since the UNIX epoch (Jan 1, 1970).

modify_time

Long

Time when the domain name was modified. The value is the number of milliseconds since the UNIX epoch (Jan 1, 1970).

disabled

Integer

Whether the domain name is banned. Possible values: 0 (not banned) and 1 (banned).

locked

Integer

Whether the domain name is locked. Possible values: 0 (not locked) and 1 (locked).

service_area

String

Area of the acceleration service provided by CDN, including europe (Europe) and outside_mainland_china (outside the Chinese mainland).

range_status

String

Whether range-based retrieval is enabled.

follow_status

String

Whether redirect retrieval is enabled.

origin_status

String

Origin pull status. off: disabled. on: enabled.

banned_reason

String

Reason for disabling the domain name.

locked_reason

String

Reason for locking the domain name.

enterprise_project_id

String

ID of the enterprise project to which the resource belongs. This parameter is valid only when the enterprise project function is enabled. If this parameter is not specified, the default project is queried. This parameter is mandatory when you use an IAM user to call this API.

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

Table 5 Sources

Parameter

Type

Description

origin_type

String

Origin server type. Possible values: ipaddr (IP address) and domain (domain name).

ip_or_domain

String

Non-intranet IP address or domain name of the origin server.

active_standby

Integer

Whether the origin server is primary or standby. Possible values: 1 (primary) and 0 (standby).

Example Requests

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

Example Responses

Status code: 200

Success response.

{
  "total" : 1,
  "domains" : [ {
    "sources" : [ {
      "origin_type" : "domain",
      "ip_or_domain" : "example.origin.com",
      "active_standby" : 1
    } ],
    "cname" : "www.example.com.c.test.com",
    "id" : "ab1234a*********************g56",
    "domain_name" : "www.example.com",
    "business_type" : "web",
    "service_area" : "europe",
    "domain_status" : "online",
    "https_status" : 0,
    "create_time" : 1516861994806,
    "modify_time" : 1532405346365,
    "disabled" : 0,
    "locked" : 0,
    "range_status" : "off",
    "follow_status" : "off",
    "origin_status" : "on"
  } ]
}

Status Codes

Status Code

Description

200

Success response.

400

Error response.