Updated on 2022-02-22 GMT+08:00

Querying the List of Domain Names

Function Description

This API is used to query the list of domain names.

URI

  • URI format

    GET /v1/{project_id}/waf/instance?offset={offset}&limit={limit}&hostname={hostname}&policyname={policyname}

  • Parameter description
    Table 1 Path parameters

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Specifies the project ID.

    offset

    No

    Long

    Specifies the number of returned pages. Its value ranges from 0 to 65535. The default value is 0.

    limit

    No

    Long

    Specifies the maximum number of records displayed on each page. Its value ranges from 0 to 50. The default value is 10. If limit is -1, one page with 65535 records is displayed.

    hostname

    No

    String

    Specifies the domain name.

    policyname

    No

    String

    Specifies the policy name.

Request

Request parameters

None

Response

Response parameters
Table 2 Parameter description

Parameter

Type

Description

total

Integer

Specifies the total number of domain names.

items

Table 3

Specifies the domain objects.

Table 3 items

Parameter

Type

Description

id

String

Specifies the domain ID.

hostname

String

Specifies the returned domain name.

cname

String

Specifies the CNAME value.

For example, efec1196267b41c399f2980ea4048517.waf.cloud.com.

txt_code

String

Specifies the TXT record. This parameter is returned only when proxy is set to true.

sub_domain

String

Specifies the subdomain name. This parameter is returned only when proxy is set to true.

policy_id

String

Specifies the policy ID.

protect_status

Integer

Specifies the WAF mode.

  • -1: bypassed.
  • 0: disabled.
  • 1: enabled.

access_status

Integer

Specifies whether a domain name is connected to WAF.

  • 0: The domain name is not connected to WAF.
  • 1: The domain name is connected to WAF.

proxy

Boolean

Specifies whether a proxy is configured.

  • true: A proxy is configured.
  • false: No proxy is configured.

timestamp

Long

Specifies the time when a domain name is created.

Example

total with a value of 2 is used as an example.

Response example
{
    "total": 2,
    "items": [
        {
          "id": "388a7789d55b41d1918b3088a8f1e7f3",
          "hostname": "www.a.com",
          "cname": "3249d21e5eb34d21be12fdc817fcb67d.waf.cloud.com",
          "txt_code": "3249d21e5eb34d21be12fdc817fcb67d",
          "sub_domain": "3249d21e5eb34d21be12fdc817fcb67d.www.a.com",
          "policy_id": "xxxxxxxxxxxxxx",
          "protect_status": 0,
          "access_status": 0,
          "proxy": true,
          "timestamp": 1499817600
        }, 
       {
          "id": "296a7710d55b41d1918b3036a8f1e7e5",
          "hostname": "www.b.com",
          "cname": "efec1196267b41c399f2980ea4048517.waf.cloud.com",
          "policy_id": "xxxxxxxxxxxxxx",
          "protect_status": 1,
          "access_status": 1,
          "proxy": false,
          "timestamp": 1499817612
        }
     ]
}

Status Code

Table 4 describes the normal status code returned by the API.
Table 4 Status code

Status Code

Description

Meaning

200

OK

The request has succeeded.

For details about error status codes, see Status Codes.