文档首页/ Web应用防火墙 WAF/ API参考/ API/ 租户订购管理/ 开通云模式按需计费接口
更新时间:2024-05-30 GMT+08:00

开通云模式按需计费接口

功能介绍

开通云模式按需计费接口

调用方法

请参见如何调用API

URI

POST /v1/{project_id}/waf/postpaid

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID,对应控制台用户名->我的凭证->项目列表->项目ID

表2 Query参数

参数

是否必选

参数类型

描述

enterprise_project_id

String

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

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

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

Content-Type

String

内容类型

region

String

区域id

表4 请求Body参数

参数

是否必选

参数类型

描述

console_area

String

租户所在的站点,hec-hk:国际站

响应参数

状态码: 200

表5 响应Body参数

参数

参数类型

描述

type

Integer

云模式版本

  • -2:已冻结

  • -1:未订购

  • 2:标准版

  • 3:专业版

  • 4:铂金版

  • 7: 入门版

  • 22:按需版本

resources

Array of ResourceResponse objects

资源列表

isNewUser

Boolean

是否为新用户

表6 ResourceResponse

参数

参数类型

描述

resourceId

String

资源id

cloudServiceType

String

云服务产品对应的云服务类型

resourceType

String

云服务产品的资源类型

  • hws.resource.type.waf:云模式包周期WAF

  • hws.resource.type.waf.domain:云模式包周期WAF域名扩展包

  • hws.resource.type.waf.bandwidth:云模式包周期WAF带宽扩展包

  • hws.resource.type.waf.rule:云模式包周期WAF规则扩展包

  • hws.resource.type.waf.payperuserequest:Web应用防火墙按需请求

  • hws.resource.type.waf.payperusedomain:Web应用防火墙按需域名

  • hws.resource.type.waf.payperuserule:Web应用防火墙按需规则

resourceSpecCode

String

云服务产品的资源规格

status

Integer

资源状态

  • 0:解冻/正常

  • 1:冻结

  • 2:删除

expireTime

String

资源到期时间

resourceSize

Integer

资源数量

状态码: 400

表7 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

状态码: 401

表8 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

状态码: 500

表9 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

请求示例

开通项目id为project_id的云模式按需计费接口,租户所在的站点“国际站”。

POST https://{Endpoint}/v1/{project_id}/waf/postpaid?enterprise_project_id=0

{
  "console_area" : "hec-hk"
}

响应示例

状态码: 200

OK

{
  "type" : 22,
  "resources" : [ {
    "resourceId" : "71f5de5f03414225b79be43ee3dc6bae",
    "cloudServiceType" : "hws.service.type.waf",
    "resourceType" : "hws.resource.type.waf.payperusedomain",
    "resourceSpecCode" : "waf.payperuse.domain",
    "resourceSize" : null,
    "expireTime" : null,
    "status" : 0
  }, {
    "resourceId" : "eb0760007a0b43fd9e445f5ce810f4c4",
    "cloudServiceType" : "hws.service.type.waf",
    "resourceType" : "hws.resource.type.waf.payperuserequest",
    "resourceSpecCode" : "waf.payperuse.request",
    "resourceSize" : null,
    "expireTime" : null,
    "status" : 0
  }, {
    "resourceId" : "6cae8a4d8074499d8c3bda687d63c4f9",
    "cloudServiceType" : "hws.service.type.waf",
    "resourceType" : "hws.resource.type.waf.payperuserule",
    "resourceSpecCode" : "waf.payperuse.rule",
    "resourceSize" : null,
    "expireTime" : null,
    "status" : 0
  } ],
  "isNewUser" : false
}

状态码

状态码

描述

200

OK

400

请求失败

401

token权限不足

500

服务器内部错误

错误码

请参见错误码