更新时间:2024-07-25 GMT+08:00

修改独享模式域名配置

功能介绍

修改独享模式域名配置

URI

PUT /v1/{project_id}/premium-waf/host/{host_id}

表1 路径参数

参数

是否必选

参数类型

描述

project_id

是

String

用户操作的项目id

host_id

是

String

独享模式域名id

表2 Query参数

参数

是否必选

参数类型

描述

enterprise_project_id

否

String

您可以通过调用企业项目管理服务(EPS)的查询企业项目列表接口(ListEnterpriseProject)查询企业项目id

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

Content-Type

是

String

内容类型

缺省值:application/json;charset=utf8

X-Auth-Token

是

String

用户Token,通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

表4 请求Body参数

参数

是否必选

参数类型

描述

proxy

否

Boolean

是否开启了代理。

  • true:表示使用了代理;

  • false:表示没有使用代理

certificateid

否

String

https证书id,通过查询证书列表接口(ListCertificates)接口获取证书id

certificatename

否

String

https证书名称,通过查询证书列表接口(ListCertificates)接口获取证书id

locked

否

Integer

是否锁定

protect_status

否

Integer

域名防护状态:

  • -1:bypass,该域名的请求直接到达其后端服务器,不再经过WAF

  • 0:暂停防护,WAF只转发该域名的请求,不做攻击检测

  • 1:开启防护,WAF根据您配置的策略进行攻击检测

access_status

否

Integer

接入状态。

  • “0”:表示未接入

  • “1”:表示已接入

timestamp

否

Integer

时间戳

block_page

否

BlockPage object

告警页面

traffic_mark

否

TrafficMark object

流量标识

flag

否

Map<String,String>

特殊标识,用于前端使用

extend

否

Map<String,String>

可扩展字段

circuit_breaker

否

CircuitBreaker object

熔断配置

timeout_config

否

TimeoutConfig object

超时配置

表5 BlockPage

参数

是否必选

参数类型

描述

template

是

String

模板名称

custom_page

否

CustomPage object

自定义告警页面

redirect_url

否

String

重定向URL

表6 CustomPage

参数

是否必选

参数类型

描述

status_code

是

String

返回状态码

content_type

是

String

页面内容类型

content

是

String

页面内容

表7 TrafficMark

参数

是否必选

参数类型

描述

sip

否

Array of strings

惩罚ip

cookie

否

String

cookie

params

否

String

参数

表8 CircuitBreaker

参数

是否必选

参数类型

描述

switch

否

Boolean

熔断开关

dead_num

否

Integer

源站不可达数量阈值

dead_ratio

否

Number

源站不可达比例阈值

block_time

否

Integer

源站不可达熔断时间

superposition_num

否

Integer

熔断阈值叠加次数

suspend_num

否

Integer

连接数占用阈值

sus_block_time

否

Integer

连接数占用熔断时间

表9 TimeoutConfig

参数

是否必选

参数类型

描述

connect_timeout

否

Integer

WAF连接源站超时配置

send_timeout

否

Integer

WAF发送请求到源站超时配置

read_timeout

否

Integer

WAF接收源站响应超时配置

响应参数

状态码: 200

表10 响应Body参数

参数

参数类型

描述

id

String

域名id

policyid

String

防护域名初始绑定的策略ID,可以通过策略名称调用查询防护策略列表(ListPolicy)接口查询到对应的策略id

hostname

String

创建的独享模式防护域名

domainid

String

用户Domain ID

project_id

String

用户的project_id

access_code

String

cname前缀

protocol

String

http协议类型

server

Array of PremiumWafServer objects

源站信息

certificateid

String

证书id,通过查询证书列表接口(ListCertificates)接口获取证书id

  • 对外协议为HTTP时不需要填写

  • 对外协议HTTPS时为必填参数

certificatename

String

证书名

  • 对外协议为HTTP时不需要填写

  • 对外协议HTTPS时为必填参数

proxy

Boolean

是否开启了代理。

  • true:表示使用了代理;

  • false:表示没有使用代理

locked

Integer

锁定状态

缺省值:0

protect_status

Integer

域名防护状态:

  • -1:bypass,该域名的请求直接到达其后端服务器,不再经过WAF

  • 0:暂停防护,WAF只转发该域名的请求,不做攻击检测

  • 1:开启防护,WAF根据您配置的策略进行攻击检测

access_status

Integer

接入状态。

  • “0”:表示未接入

  • “1”:表示已接入

web_tag

String

网站名称

timestamp

Long

创建防护域名的时间

flag

Flag object

特殊标识,用于前端使用

block_page

BlockPage object

告警页面

extend

Map<String,String>

可扩展属性

traffic_mark

TrafficMark object

流量标识

timeout_config

TimeoutConfig object

超时配置

access_progress

Array of Access_progress objects

冗余参数,仅用于前端使用

表11 PremiumWafServer

参数

参数类型

描述

front_protocol

String

客户端请求访问源站服务器的协议

枚举值:

  • HTTP

  • HTTPS

back_protocol

String

WAF转发客户端请求到源站服务器的协议

枚举值:

  • HTTP

  • HTTPS

address

String

客户端访问的源站服务器的公网IP地址或者域名

port

Integer

客户端访问的网站服务器的端口号,取值为(0, 65535),例如:8080

type

String

源站地址为ipv4或ipv6

枚举值:

  • ipv4

  • ipv6

vpc_id

String

虚拟私有云id,通过以下步骤获取VPC id:

  • 1.找到独享引擎所在的虚拟私有云名称,VPC\子网这一列就是VPC的名称:登录WAF的控制台->单击系统管理->独享引擎->VPC\子网

  • 2.登录虚拟私有云 VPC控制台->虚拟私有云->单击虚拟私有云的名称->基本信息的ID

表12 Flag

参数

参数类型

描述

pci_3ds

String

是否通过pci_3ds标准认证。

  • true:通过pci_3ds标准认证

  • false:未通过pci_3ds标准认证

枚举值:

  • true

  • false

pci_dss

String

是否通过pci_dss标准认证。

  • true:通过pci_dss标准认证

  • false:未通过pci_dss标准认证

枚举值:

  • true

  • false

cname

String

域名使用老的cname还是新的cname

  • old:代表域名使用老的cname

  • new:代表域名使用新的cname

枚举值:

  • old

  • new

is_dual_az

String

WAF是否支持多可用区容灾

  • true:WAF支持多可用区容灾

  • false:WAF不支持多可用区容灾

枚举值:

  • true

  • false

表13 BlockPage

参数

参数类型

描述

template

String

模板名称

custom_page

CustomPage object

自定义告警页面

redirect_url

String

重定向URL

表14 CustomPage

参数

参数类型

描述

status_code

String

返回状态码

content_type

String

页面内容类型

content

String

页面内容

表15 TrafficMark

参数

参数类型

描述

sip

Array of strings

惩罚ip

cookie

String

cookie

params

String

参数

表16 TimeoutConfig

参数

参数类型

描述

connect_timeout

Integer

WAF连接源站超时配置

send_timeout

Integer

WAF发送请求到源站超时配置

read_timeout

Integer

WAF接收源站响应超时配置

表17 Access_progress

参数

参数类型

描述

step

Integer

步骤

status

Integer

状态

状态码: 400

表18 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

状态码: 401

表19 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

状态码: 500

表20 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

请求示例

PUT https://{Endpoint}/v1/{project_id}/premium-waf/host/{host_id}?enterprise_project_id=0

{
  "proxy" : false
}

响应示例

状态码: 200

ok

{
  "id" : "27995fb98a2d4928a1e453e65ee8117a",
  "hostname" : "www.demo.com",
  "protocol" : "HTTP",
  "server" : [ {
    "address" : "192.168.0.209",
    "port" : 80,
    "type" : "ipv4",
    "weight" : 1,
    "front_protocol" : "HTTP",
    "back_protocol" : "HTTP",
    "vpc_id" : "cf6dbace-b36a-4d51-ae04-52a8459ae247"
  } ],
  "proxy" : false,
  "locked" : 0,
  "timestamp" : 1650590814885,
  "flag" : {
    "pci_3ds" : "false",
    "pci_dss" : "false"
  },
  "description" : "",
  "policyid" : "9555cda636ef4ca294dfe4b14bc94c47",
  "domainid" : "d4ecb00b031941ce9171b7bc3386883f",
  "projectid" : "05e33ecd328025dd2f7fc00696201fb4",
  "enterprise_project_id" : "0",
  "protect_status" : 1,
  "access_status" : 0,
  "web_tag" : ""
}

状态码

状态码

描述

200

ok

400

非法请求

401

Token无权限

500

服务器内部错误

错误码

请参见错误码。