Updated on 2022-08-09 GMT+08:00

Connecting a Domain Name to a Dedicated WAF Instance

Function

This API is used to connect a domain name to a dedicated WAF instance.

URI

POST /v1/{project_id}/premium-waf/host

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

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 (value of X-Subject-Token in the response header).

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

certificateid

No

String

Certificate ID

certificatename

No

String

Certificate name

hostname

Yes

String

Domain name or IP address (or IP address with port)

proxy

No

Boolean

Whether a proxy is used

policyid

No

String

ID of the policy initially applied to the protected domain name

server

No

Array of PremiumWafServer objects

Configuration of retrieval server in dedicated mode

Table 4 PremiumWafServer

Parameter

Mandatory

Type

Description

front_protocol

Yes

String

Client protocol

back_protocol

Yes

String

Server protocol

address

Yes

String

Server address

port

Yes

Integer

Server port

type

No

String

Origin server IP address format.

Default: ipv4

vpc_id

No

String

ID of the VPC where the dedicated WAF engine resides. The origin server and the dedicated WAF engine must be in the same subnet.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

id

String

Domain name ID

policyid

String

Policy ID

hostname

String

Policy ID

domainid

String

Tenant ID

projectid

String

Project ID

protocol

String

HTTP protocol

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error code message

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error code message

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error code message

Example Requests

{
  "hostname" : "www.test.com",
  "server" : [ {
    "front_protocol" : "HTTP",
    "back_protocol" : "HTTP",
    "vpc_id" : "34e414f6-2407-456b-b61d-93d64e9e56f0",
    "type" : "ipv4",
    "address" : "1.1.1.1",
    "port" : 80
  } ],
  "proxy" : true
}

Example Responses

None

Status Codes

Status Code

Description

200

OK

400

Invalid request

401

Unauthorized token

500

Internal server error

Error Codes

See Error Codes.