更新时间:2024-03-22 GMT+08:00
分享

局点支持特性查询

功能介绍

局点支持特性查询

调用方法

请参见如何调用API

URI

GET /v1/{project_id}/waf/config/console

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

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

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

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

Content-Type

String

内容类型

缺省值:application/json;charset=utf8

响应参数

状态码: 200

表3 响应Body参数

参数

参数类型

描述

eps

Boolean

是否支持EPS,false:不支持;true:支持

tls

Boolean

是否支持的TLS版本(TLS v1.0/TLS v1.1/TLS v1.2),默认为TLS v1.0版本,false:不支持;true:支持

ipv6

Boolean

是否支持IPV6,false:不支持;true:支持

alert

Boolean

是否支持告警,false:不支持;true:支持

custom

Boolean

是否支持精准防护,false:不支持;true:支持

elb_mode

Boolean

是否支持ELB模式,false:不支持;true:支持

event_lts

Boolean

是否支持LTS全量日志,false:不支持;true:支持

multi_dns

Boolean

是否支持多DNS解析,false:不支持;true:支持

search_ip

Boolean

是否支持搜索IP,false:不支持;true:支持

cc_enhance

Boolean

是否支持CC增强,false:不支持;true:支持

cname_switch

Boolean

是否支持cname切换,false:不支持;true:支持

custom_block

Boolean

是否支持自定义拦截页面,false:不支持,true:支持

advanced_ignore

Boolean

是否支持误报屏蔽,false:不支持;true:支持

js_crawler_enable

Boolean

是否支持js反爬虫,false:不支持;true:支持

deep_decode_enable

Boolean

是否支持web基础防护深度检测,false:不支持;true:支持

overview_bandwidth

Boolean

是否支持安全总览带宽统计,false:不支持;true:支持

proxy_use_oldcname

Boolean

是否支持使用旧cname解析,false:不支持;true:支持

check_all_headers_enable

Boolean

是否支持检查所有的header,false:不支持;true:支持

geoip_enable

Boolean

是否支持地理位置访问控制,false:不支持;true:支持

load_balance_enable

Boolean

是否支持域名访问负载均衡配置,false:不支持;true:支持

ipv6_protection_enable

Boolean

是否支持ipv6防护,false:不支持;true:支持

policy_sharing_enable

Boolean

是否支持策略共享,false:不支持;true:支持

ip_group

Boolean

是否支持ip地址组,false:不支持;true:支持

robot_action_enable

Boolean

是否支持网站反爬虫,false:不支持;true:支持

http2_enable

Boolean

是否支持http2,false:不支持;true:支持

timeout_config_enable

Boolean

是否支持超时配置,false:不支持;true:支持

状态码: 400

表4 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

状态码: 401

表5 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

状态码: 500

表6 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

请求示例

查询项目id为project_id,时间从2022-04-21 00:00:00到2022-04-21 14:45:20的局点支持特性

GET https://{Endpoint}/v1/{project_id}/waf/config/console?enterprise_project_id=0&from=1650470400089&to=1650523520089

响应示例

状态码: 200

OK

{
  "eps" : true,
  "tls" : true,
  "ipv6" : true,
  "alert" : true,
  "custom" : true,
  "ip_group" : true,
  "event_lts" : true,
  "multi_dns" : true,
  "search_ip" : true,
  "cc_enhance" : true,
  "cname_switch" : true,
  "custom_block" : true,
  "geoip_enable" : true,
  "http2_enable" : true,
  "advanced_ignore" : true,
  "js_crawler_enable" : true,
  "deep_decode_enable" : true,
  "overview_bandwidth" : true,
  "proxy_use_oldcname" : false,
  "load_balance_enable" : true,
  "robot_action_enable" : true,
  "policy_sharing_enable" : true,
  "timeout_config_enable" : true,
  "ipv6_protection_enable" : true,
  "check_all_headers_enable" : true,
  "elb_mode" : true
}

SDK代码示例

SDK代码示例如下。

 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.waf.v1.region.WafRegion;
import com.huaweicloud.sdk.waf.v1.*;
import com.huaweicloud.sdk.waf.v1.model.*;


public class ShowConsoleConfigSolution {

    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);

        WafClient client = WafClient.newBuilder()
                .withCredential(auth)
                .withRegion(WafRegion.valueOf("<YOUR REGION>"))
                .build();
        ShowConsoleConfigRequest request = new ShowConsoleConfigRequest();
        try {
            ShowConsoleConfigResponse response = client.showConsoleConfig(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());
        }
    }
}
 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 huaweicloudsdkwaf.v1.region.waf_region import WafRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkwaf.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 = __import__('os').getenv("CLOUD_SDK_AK")
    sk = __import__('os').getenv("CLOUD_SDK_SK")

    credentials = BasicCredentials(ak, sk) \

    client = WafClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(WafRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ShowConsoleConfigRequest()
        response = client.show_console_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)
 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"
    waf "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/waf/v1"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/waf/v1/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/waf/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 := waf.NewWafClient(
        waf.WafClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.ShowConsoleConfigRequest{}
	response, err := client.ShowConsoleConfig(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。

状态码

状态码

描述

200

OK

400

请求失败

401

token权限不足

500

服务器内部错误

错误码

请参见错误码

分享:

    相关文档

    相关产品