华为云用户手册

  • 响应示例 状态码: 200 高防实例列表 { "count" : 2, "items" : [ { "ips" : [ { "ip" : "103.239.246.6", "ip_id" : "4f1XXXX-XXXX-XXXX-XXXX-XXXXd4b1", "basic_bandwidth" : 10, "elastic_bandwidth" : 20, "ip_status" : 0 } ], "instance_id" : "74acXXXX-XXXX-XXXX-XXXX-XXXXd012", "instance_name" : "example 1", "expire_time" : 1675926787000, "service_bandwidth" : 0, "instance_status" : 0, "enterprise_project_id" : "0" }, { "ips" : [ { "ip" : "103.239.246.156", "ip_id" : "d6f9XXXX-XXXX-XXXX-XXXX-XXXXd4b1", "basic_bandwidth" : 20, "elastic_bandwidth" : 30, "ip_status" : 0 } ], "instance_id" : "6a7fXXXX-XXXX-XXXX-XXXX-XXXXd4a6", "instance_name" : "example 2", "expire_time" : 1674909266000, "service_bandwidth" : 0, "instance_status" : 0, "enterprise_project_id" : "0" } ] }
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 count Integer 实例总数 items Array of InstanceInfo objects 实例 表3 InstanceInfo 参数 参数类型 描述 instance_id String 实例ID instance_name String 实例名 ips Array of InstanceIpInfo objects 实例IP expire_time Long 实例过期时间 service_bandwidth Integer 业务带宽 instance_status Integer 实例状态 enterprise_project_id String 企业项目ID overseas_type Integer 实例类型,0-大陆,1-海外 表4 InstanceIpInfo 参数 参数类型 描述 ip_id String IP ID ip String IP basic_bandwidth Integer 保底带宽 elastic_bandwidth Integer 弹性带宽 ip_status Integer IP状态
  • 响应示例 状态码: 200 请求已成功 { "total" : 1, "ddosStatus" : [ { "floating_ip_id" : "18e6ace5-eb36-4196-a15e-1e000c24e026", "floating_ip_address" : "139.9.116.167", "network_type" : "EIP", "status" : "normal", "blackhole_endtime" : 0, "protect_type" : "default", "traffic_threshold" : 99, "http_threshold" : 0 } ] }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 total Integer 弹性IP总数 最小值:0 最大值:2147483647 ddosStatus Array of DDosStatus objects 防护状态列表 表5 DDosStatus 参数 参数类型 描述 floating_ip_id String EIP的ID floating_ip_address String 浮动IP地址 network_type String EIP所属类型,可选范围: EIP:未绑定到E CS 的EIP或绑定到ECS的EIP ELB:绑定到ELB的EIP status String 防护状态,可选范围: normal:表示正常 configging:表示设置中 notConfig:表示未设置 packetcleaning:表示清洗 packetdropping:表示黑洞 blackhole_endtime Long 黑洞结束时间 protect_type String 防护类型 traffic_threshold Long 流量阈值 http_threshold Long http流量阈值
  • URI GET /v1/{project_id}/antiddos 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目id 最小长度:32 最大长度:64 表2 Query参数 参数 是否必选 参数类型 描述 status 否 String 可选范围: normal:表示正常 configging:表示设置中 notConfig:表示未设置 packetcleaning:表示清洗 packetdropping:表示黑洞 不带此参数默认所有列表,以neutron查询到的顺序为准。 limit 否 String 返回结果个数限制,取值范围:1~100 最小长度:1 最大长度:3 offset 否 String 偏移量,取值范围:0~2147483647 最小长度:1 最大长度:10 ip 否 String IP地址,支持IPv4格式和IPv6格式输入,支持部分查询。例如“?ip=192.168”,会返回192.168.111.1和10.192.168.8所对应的EIP防护状态。
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用 IAM 服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度:32 最大长度:2097152 Content-Type 是 String Content-Type请求头 缺省值:application/json;charset=utf8 最小长度:1 最大长度:255
  • Go 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" antiddos "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/antiddos/v1" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/antiddos/v1/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/antiddos/v1/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). Build() client := antiddos.NewAntiDDoSClient( antiddos.AntiDDoSClientBuilder(). WithRegion(region.ValueOf("cn-north-4")). WithCredential(auth). Build()) request := &model.ShowAlertConfigRequest{} response, err := client.ShowAlertConfig(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
  • 响应示例 状态码: 200 请求已成功 { "warn_config" : { "antiDDoS" : false, "bruce_force" : false, "remote_login" : false, "weak_password" : false, "high_privilege" : false, "back_doors" : false, "waf" : false, "send_frequency" : 0 }, "topic_urn" : null, "display_name" : null }
  • Java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.antiddos.v1.region.AntiDDoSRegion; import com.huaweicloud.sdk.antiddos.v1.*; import com.huaweicloud.sdk.antiddos.v1.model.*; public class ShowAlertConfigSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); ICredential auth = new BasicCredentials() .withAk(ak) .withSk(sk); AntiDDoSClient client = AntiDDoSClient.newBuilder() .withCredential(auth) .withRegion(AntiDDoSRegion.valueOf("cn-north-4")) .build(); ShowAlertConfigRequest request = new ShowAlertConfigRequest(); try { ShowAlertConfigResponse response = client.showAlertConfig(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } }
  • Python 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 # coding: utf-8 from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkantiddos.v1.region.antiddos_region import AntiDDoSRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkantiddos.v1 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.getenv("CLOUD_SDK_AK") sk = os.getenv("CLOUD_SDK_SK") credentials = BasicCredentials(ak, sk) \ client = AntiDDoSClient.new_builder() \ .with_credentials(credentials) \ .with_region(AntiDDoSRegion.value_of("cn-north-4")) \ .build() try: request = ShowAlertConfigRequest() response = client.show_alert_config(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 topic_urn String 告警群组的唯一标识 最小长度:1 最大长度:255 display_name String 告警群组描述 最小长度:1 最大长度:255 warn_config warn_config object 告警配置信息 表4 warn_config 参数 参数类型 描述 antiDDoS Boolean DDoS攻击 back_doors Boolean 网页后门 bruce_force Boolean 暴力破解(系统登录,FTP,DB) high_privilege Boolean 数据库进程权限过高 remote_login Boolean 异地登录提醒 send_frequency Integer 取值范围: 0:表示每天一次 1:表示半小时一次 对于HID必选。 waf Boolean 保留字段 weak_password Boolean 弱口令(系统,数据库)
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度:32 最大长度:2097152 Content-Type 是 String Content-Type请求头 缺省值:application/json;charset=utf8 最小长度:1 最大长度:255
  • 响应消息体(可选) 响应消息体通常以结构化格式返回,与响应消息头中Content-type对应,传递除响应消息头之外的内容。 对于获取用户Token接口,返回如下消息体。为篇幅起见,这里只展示部分内容。 { "token": { "expires_at": "2019-02-13T06:52:13.855000Z", "methods": [ "password" ], "catalog": [ { "endpoints": [ { "region_id": "xxxxxxxx", ...... 当接口调用出错时,会返回错误码及错误信息说明,错误响应的Body体格式如下所示。 { "error_msg": "The format of message is error", "error_code": "AS.0001" } 其中,error_code表示错误码,error_msg表示错误描述信息。
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 total Long 弹性IP总数 最小值:0 最大值:2147483647 logs Array of DailyLog objects 异常事件列表 数组长度:0 - 2147483647 表5 DailyLog 参数 参数类型 描述 start_time Long 开始时间 最小值:1 最大值:9999999999999 end_time Long 结束时间 最小值:1 最大值:9999999999999 status Integer 防护状态,可选范围: 1:表示清洗 2:表示黑洞 trigger_bps Integer 触发时流量 最小值:0 最大值:2147483647 trigger_pps Integer 触发时报文速率 最小值:0 最大值:2147483647 trigger_http_pps Integer 触发时HTTP请求速率 最小值:0 最大值:2147483647
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度:32 最大长度:2097152 Content-Type 是 String Content-Type请求头 缺省值:application/json;charset=utf8 最小长度:1 最大长度:255
  • URI GET /v1/{project_id}/antiddos/{floating_ip_id}/logs 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目id 最小长度:32 最大长度:64 floating_ip_id 是 String 用户EIP对应的ID 最小长度:32 最大长度:64 表2 Query参数 参数 是否必选 参数类型 描述 sort_dir 否 String 可选范围: desc:表示时间降序 asc:表示时间升序 默认值为“desc”。 limit 否 String 返回结果个数限制,此次查询返回数量最大值,取值范围:1~100,与offset配合使用。 若“limit”与“offset”均不携带则返回所有主机列表。 最小长度:1 最大长度:3 offset 否 String 偏移量,“limit”携带时此字段有效。 最小长度:1 最大长度:10 ip 否 String 用户EIP 最小长度:7 最大长度:128
  • 请求消息体 请求消息体通常以结构化格式发出,与请求消息头中Content-type对应,传递除请求消息头之外的内容。若请求消息体中参数支持中文,则中文字符必须为UTF-8编码。 每个接口的请求消息体内容不同,也并不是每个接口都需要有请求消息体(或者说消息体为空),GET、DELETE操作类型的接口就不需要消息体,消息体具体内容需要根据具体接口而定。 对于获取用户Token接口,您可以从接口的请求部分看到所需的请求参数及参数说明。将消息体加入后的请求如下所示,加粗的斜体字段需要根据实际值填写,其中username为用户名,domainname为用户所属的账号名称,********为用户登录密码,xxxxxxxxxxxxxxxxxx为project的名称,如“cn-north-4”,您可以从地区和终端节点获取,对应地区和终端节点页面的“区域”字段的值。 scope参数定义了Token的作用域,下面示例中获取的Token仅能访问project下的资源。您还可以设置Token作用域为某个账号下所有资源或账号的某个project下的资源,详细定义请参见获取用户Token。 POST https://iam.cn-north-4.myhuaweicloud.com/v3/auth/tokens Content-Type: application/json { "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "name": "username", "password": "********", "domain": { "name": "domainname" } } } }, "scope": { "project": { "name": "xxxxxxxxxxxxxxxxxx" } } } } 到这里为止这个请求需要的内容就具备齐全了,您可以使用curl、Postman或直接编写代码等方式发送请求调用API。对于获取用户Token接口,返回的响应消息头中“x-subject-token”就是需要获取的用户Token。有了Token之后,您就可以使用Token认证调用其他API。
  • 请求消息头 附加请求头字段,如指定的URI和HTTP方法所要求的字段。例如定义消息体类型的请求头“Content-Type”,请求鉴权信息等。 如下公共消息头需要添加到请求中。 Content-Type:消息体的类型(格式),必选,默认取值为“application/json”,有其他取值时会在具体接口中专门说明。 X-Auth-Token:用户Token,可选,当使用Token方式认证时,必须填充该字段。用户Token也就是调用获取用户Token接口的响应值,该接口是唯一不需要认证的接口。 API同时支持使用AK/SK认证,AK/SK认证是使用SDK对请求进行签名,签名过程会自动往请求中添加Authorization(签名认证信息)和X-Sdk-Date(请求发送的时间)请求头。 AK/SK认证的详细说明请参见AK/SK认证。 对于获取用户Token接口,由于不需要认证,所以只添加“Content-Type”即可,添加消息头后的请求如下所示。 POST https://iam.cn-north-4.myhuaweicloud.com/v3/auth/tokens Content-Type: application/json
  • 请求URI 请求URI由如下部分组成。 {URI-scheme} :// {Endpoint} / {resource-path} ? {query-string} 尽管请求URI包含在请求消息头中,但大多数语言或框架都要求您从请求消息中单独传递它,所以在此单独强调。 URI-scheme: 表示用于传输请求的协议,当前所有API均采用HTTPS协议。 Endpoint: 指定承载REST服务端点的服务器 域名 或IP,不同服务不同区域的Endpoint不同,您可以从地区和终端节点获取。 例如IAM服务在“华北-北京四”区域的Endpoint为“iam.cn-north-4.myhuaweicloud.com”。 resource-path: 资源路径,也即API访问路径。从具体API的URI模块获取,例如“获取用户Token”API的resource-path为“/v3/auth/tokens”。 query-string: 查询参数,是可选部分,并不是每个API都有查询参数。查询参数前面需要带一个“?”,形式为“参数名=参数取值”,例如“limit=10”,表示查询不超过10条数据。 例如您需要获取IAM在“华北-北京四”区域的Token,则需使用“华北-北京四”区域的Endpoint(iam.cn-north-4.myhuaweicloud.com),并在获取用户Token的URI部分找到resource-path(/v3/auth/tokens),拼接起来如下所示。 https://iam.cn-north-4.myhuaweicloud.com/v3/auth/tokens 图1 URI示意图 为查看方便,在每个具体API的URI部分,只给出resource-path部分,并将请求方法写在一起。这是因为URI-scheme都是HTTPS,同一个服务的Endpoint在同一个区域也相同,所以简洁起见将这两部分省略。
  • 请求方法 HTTP请求方法(也称为操作或动词),它告诉服务你正在请求什么类型的操作。 GET:请求服务器返回指定资源。 PUT:请求服务器更新指定资源。 POST:请求服务器新增资源或执行特殊操作。 DELETE:请求服务器删除指定资源,如删除对象等。 HEAD:请求服务器资源头部。 PATCH:请求服务器更新资源的部分内容。当资源不存在的时候,PATCH可能会去创建一个新的资源。 在获取用户Token的URI部分,您可以看到其请求方法为“POST”,则其请求为: POST https://iam.cn-north-4.myhuaweicloud.com/v3/auth/tokens
  • 操作步骤 批量查询用户所有主机的配置监控状态。 接口相关信息 URI格式:GET /v1/{project_id}/antiddos 详情请参见“查询EIP防护状态列表”。 请求示例 GET: https://{endpoint}/v1/1858a4e1f99d4454bd6a539d5477f5de/antiddos {endpoint}信息请从地区和终端节点获取。 Body: { } 响应示例 { "total": 1, "ddosStatus": [ { "floating_ip_id": "18e6ace5-eb36-4196-a15e-1e000c24e026", "floating_ip_address": "139.9.116.167", "network_type": "EIP", "status": "normal", "blackhole_endtime": 0, "protect_type": "default", "traffic_threshold": 99, "http_threshold": 0 } ] } 查询AntiDDOS服务的配置策略列表。 接口相关信息 URI格式:GET /v2/{project_id}/antiddos/query-config-list 详情请参见“查询Anti-DDoS配置可选范围”。 请求示例 GET: https://{endpoint}/v2/1858a4e1f99d4454bd6a539d5477f5de/antiddos/query-config-list {endpoint}信息请从地区和终端节点获取。 Body: { } 响应示例 { "traffic_limited_list": [ { "traffic_pos_id": 1, "traffic_per_second": 10, "packet_per_second": 2000 }, { "traffic_pos_id": 2, "traffic_per_second": 30, "packet_per_second": 6000 }, { "traffic_pos_id": 3, "traffic_per_second": 50, "packet_per_second": 10000 }, { "traffic_pos_id": 4, "traffic_per_second": 70, "packet_per_second": 15000 }, { "traffic_pos_id": 5, "traffic_per_second": 100, "packet_per_second": 20000 }, { "traffic_pos_id": 6, "traffic_per_second": 150, "packet_per_second": 25000 }, { "traffic_pos_id": 7, "traffic_per_second": 200, "packet_per_second": 35000 }, { "traffic_pos_id": 8, "traffic_per_second": 250, "packet_per_second": 50000 }, { "traffic_pos_id": 9, "traffic_per_second": 300, "packet_per_second": 70000 }, { "traffic_pos_id": 88, "traffic_per_second": 1000, "packet_per_second": 300000 } ], "http_limited_list": [ { "http_request_pos_id": 1, "http_packet_per_second": 100 }, { "http_request_pos_id": 2, "http_packet_per_second": 150 }, { "http_request_pos_id": 3, "http_packet_per_second": 240 }, { "http_request_pos_id": 4, "http_packet_per_second": 350 }, { "http_request_pos_id": 5, "http_packet_per_second": 480 }, { "http_request_pos_id": 6, "http_packet_per_second": 550 }, { "http_request_pos_id": 7, "http_packet_per_second": 700 }, { "http_request_pos_id": 8, "http_packet_per_second": 850 }, { "http_request_pos_id": 9, "http_packet_per_second": 1000 }, { "http_request_pos_id": 10, "http_packet_per_second": 1500 }, { "http_request_pos_id": 11, "http_packet_per_second": 2000 }, { "http_request_pos_id": 12, "http_packet_per_second": 3000 }, { "http_request_pos_id": 13, "http_packet_per_second": 5000 }, { "http_request_pos_id": 14, "http_packet_per_second": 10000 }, { "http_request_pos_id": 15, "http_packet_per_second": 20000 } ], "connection_limited_list": [ { "cleaning_access_pos_id": 1, "new_connection_limited": 10, "total_connection_limited": 30 }, { "cleaning_access_pos_id": 2, "new_connection_limited": 20, "total_connection_limited": 100 }, { "cleaning_access_pos_id": 3, "new_connection_limited": 30, "total_connection_limited": 200 }, { "cleaning_access_pos_id": 4, "new_connection_limited": 40, "total_connection_limited": 250 }, { "cleaning_access_pos_id": 5, "new_connection_limited": 50, "total_connection_limited": 300 }, { "cleaning_access_pos_id": 6, "new_connection_limited": 60, "total_connection_limited": 500 }, { "cleaning_access_pos_id": 7, "new_connection_limited": 70, "total_connection_limited": 600 }, { "cleaning_access_pos_id": 8, "new_connection_limited": 80, "total_connection_limited": 700 } ], "extend_ddos_config": [] } 更新IP的AntiDDoS安全服务配置策略。 接口相关信息 URI格式:PUT /v1/{project_id}/antiddos/{floating_ip_id} 详情请参见“更新Anti-DDoS服务”。 请求示例 PUT: https://{endpoint}/v1/1858a4e1f99d4454bd6a539d5477f5de/antiddos/18e6ace5-eb36-4196-a15e-1e000c24e026 {endpoint}信息请从地区和终端节点获取。 Body: { "app_type_id": 1, "cleaning_access_pos_id": 8, "enable_L7": false, "http_request_pos_id": 8, "traffic_pos_id": 8 } 响应示例 { "error_code": "10000000", "error_msg": "The task has been received and is being handled", "task_id": "59385d2a-6266-4d3a-9122-a228c530f557" } 根据3返回的任务ID获取任务状态。 接口相关信息 URI格式:GET /v2/{project_id}/query-task-status 详情请参见“查询Anti-DDoS任务”。 请求示例 GET: https://{endpoint}/v2/1858a4e1f99d4454bd6a539d5477f5de/query-task-status?task_id=59385d2a-6266-4d3a-9122-a228c530f557 {endpoint}信息请从地区和终端节点获取。 Body: { } 响应示例 { "task_status": "success", "task_msg": "" }
  • 响应示例 状态码: 200 OK { "items" : [ { "clean_threshold" : 120, "id" : "798d8975-f7cf-490f-b990-747ebaf41248", "name" : "sadf", "num_protected_ip" : 0, "package_id" : "09b5ae8e-ae05-49ff-80fc-8bdf68c16499", "package_name" : "测试", "region" : "cn-north-4" } ], "total" : 1 }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度:32 最大长度:2097152 Content-Type 是 String Content-Type 缺省值:application/json;charset=utf8 最小长度:1 最大长度:255
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 total Integer 总数 最小值:0 最大值:2147483647 items Array of PolicyResponse objects 策略列表 数组长度:0 - 2147483647 表4 PolicyResponse 参数 参数类型 描述 id String id 最小长度:32 最大长度:64 package_id String 防护包id 最小长度:32 最大长度:64 package_name String 防护包名 最小长度:0 最大长度:255 name String 策略名 最小长度:0 最大长度:255 description String 描述 最小长度:0 最大长度:255 region String 所属region的id 最小长度:1 最大长度:255 clean_threshold Integer 清洗阈值 最小值:100 最大值:1000 num_protected_ip Integer 防护ip数 最小值:0 最大值:2147483647
  • 请求示例 为id为“0c613ff9-2b63-4aa2-9333-e03541fe0d9a”的防护包创建一个名称为“name”的防护策略。 POST https://{endpoint}/v1/cnad/policies { "name" : "name", "package_id" : "0c613ff9-2b63-4aa2-9333-e03541fe0d9a", "description" : "" }
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 id String 策略id 最小长度:32 最大长度:64 name String 策略名 最小长度:0 最大长度:255 package_id String 防护包id 最小长度:32 最大长度:64 description String 描述 最小长度:0 最大长度:255 clean_threshold Integer 清洗阈值 最小值:100 最大值:1000
  • 请求参数 表1 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度:32 最大长度:2097152 Content-Type 是 String Content-Type 缺省值:application/json;charset=utf8 最小长度:1 最大长度:255 表2 请求Body参数 参数 是否必选 参数类型 描述 name 是 String 策略名 最小长度:1 最大长度:255 package_id 是 String 防护包id 最小长度:32 最大长度:64 description 否 String 描述 最小长度:0 最大长度:255
  • 请求参数 表1 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度:32 最大长度:2097152 Content-Type 是 String Content-Type 缺省值:application/json;charset=utf8 最小长度:1 最大长度:255
  • 请求参数 表1 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度:32 最大长度:2097152 Content-Type 是 String Content-Type 缺省值:application/json;charset=utf8 最小长度:1 最大长度:255 表2 请求Body参数 参数 是否必选 参数类型 描述 id 是 String 防护ip的id 最小长度:32 最大长度:64 tag 是 String 本地标签 最小长度:0 最大长度:2147483647
  • 响应示例 状态码: 200 高防实例IP的转发规则列表 { "total" : 2, "rules" : [ { "rule_id" : "81c8XXXX-XXXX-XXXX-XXXX11c9", "forward_protocol" : "tcp", "forward_port" : 31, "source_port" : 31, "lb_method" : "rr", "source_ip" : "4.0.1.1", "status" : 1 }, { "rule_id" : "ea86XXXX-XXXX-XXXX-XXXXfa13", "forward_protocol" : "tcp", "forward_port" : 61, "source_port" : 61, "lb_method" : "rr", "source_ip" : "6.0.1.1", "status" : 1 } ] }
共100000条