From 8ca3b4e45ec58b42175d47226acaca055bb80405 Mon Sep 17 00:00:00 2001 From: mikatong Date: Tue, 25 Jan 2022 14:54:38 +0800 Subject: [PATCH 1/4] feat: access ddosv2 l4 --- go.mod | 3 +- go.sum | 4 + .../data_source_tc_dayu_l4_rules_v2.go | 223 + .../data_source_tc_dayu_l4_rules_v2_test.go | 65 + tencentcloud/provider.go | 2 + tencentcloud/resource_tc_dayu_l4_rule_v2.go | 291 ++ .../resource_tc_dayu_l4_rule_v2_test.go | 141 + tencentcloud/service_tencentcloud_dayu.go | 194 + .../tencentcloud/antiddos/LICENSE | 201 + .../tencentcloud/antiddos/v20200309/client.go | 3581 +++++++++++++ .../tencentcloud/antiddos/v20200309/errors.go | 73 + .../tencentcloud/antiddos/v20200309/models.go | 4483 +++++++++++++++++ vendor/modules.txt | 2 + 13 files changed, 9262 insertions(+), 1 deletion(-) create mode 100644 tencentcloud/data_source_tc_dayu_l4_rules_v2.go create mode 100644 tencentcloud/data_source_tc_dayu_l4_rules_v2_test.go create mode 100644 tencentcloud/resource_tc_dayu_l4_rule_v2.go create mode 100644 tencentcloud/resource_tc_dayu_l4_rule_v2_test.go create mode 100644 vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/LICENSE create mode 100644 vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/v20200309/client.go create mode 100644 vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/v20200309/errors.go create mode 100644 vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/v20200309/models.go diff --git a/go.mod b/go.mod index 3d1949c410..839635c8c7 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,7 @@ require ( github.com/mitchellh/go-homedir v1.1.0 github.com/mozillazg/go-httpheader v0.3.0 // indirect github.com/pkg/errors v0.9.1 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos v1.0.334 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/api v1.0.285 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.199 @@ -32,7 +33,7 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.332 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.199 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dayu v1.0.199 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dayu v1.0.335 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dc v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.294 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/emr v1.0.287 diff --git a/go.sum b/go.sum index 35880722bf..ce12c68df9 100644 --- a/go.sum +++ b/go.sum @@ -446,6 +446,8 @@ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2 h1:Xr9gkxfOP0KQWXKNqmwe8vEeSUiUj4Rlee9CMVX2ZUQ= github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos v1.0.334 h1:wQMm0QGdVvdkYALiav8MHWnigkpquU4XiUsMOzEtw38= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos v1.0.334/go.mod h1:6ficOD4j2/gwkkXUrSlInWqKIAuWrIid1u4UvMiC41A= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/api v1.0.285 h1:gFmukRGLtYiXVBVvg/5DP/0fM1+dKpwDjT+khtDVLmc= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/api v1.0.285/go.mod h1:aGlXSWjtSnE6kuqcaRy/NKj1CLiB8NlMSHGsDn+k7Ag= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway v1.0.199 h1:e9M5HSIq2xw61Oz9whoaq+QT95rZtowkY/2zhdzx9v4= @@ -487,6 +489,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.199 h1:L0t github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.199/go.mod h1:AvfGfE5JXkyMV6uGd6B++SIDp+VV/SSphg1q2RiANFw= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dayu v1.0.199 h1:CzZEt6l0qDjZUW8D8rUNQ/sKw6z6oYYdWuby3hlsn8g= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dayu v1.0.199/go.mod h1:pz4s3nOhoB9cY0+uWzifuwr7lfh/Gvi1rv0ADxpPzD4= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dayu v1.0.335 h1:D8qrelkK5udv8RzJJIABMzItGIyaZoYnxEVeIsYqiNw= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dayu v1.0.335/go.mod h1:pz4s3nOhoB9cY0+uWzifuwr7lfh/Gvi1rv0ADxpPzD4= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dc v1.0.199 h1:7ShREKvI8ik2YNtLF42JR9x2YEeZS/gZvhIRfpsI8T0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dc v1.0.199/go.mod h1:5WGSrlIZJOhwIqPjjafb6vzrPEZieSHPhPMjjGPXOSU= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.294 h1:VKP8TRlMSDUIJ32GuFKr4a0Fv/oi4LksRVOfJoK9CVc= diff --git a/tencentcloud/data_source_tc_dayu_l4_rules_v2.go b/tencentcloud/data_source_tc_dayu_l4_rules_v2.go new file mode 100644 index 0000000000..970524e107 --- /dev/null +++ b/tencentcloud/data_source_tc_dayu_l4_rules_v2.go @@ -0,0 +1,223 @@ +/* +Use this data source to query dayu layer 4 rules + +Example Usage + +```hcl +data "tencentcloud_dayu_l4_rules_v2" "tencentcloud_dayu_l4_rules_v2" { + business = "bgpip" +} +``` +*/ +package tencentcloud + +import ( + "context" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + dayu "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dayu/v20180709" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func dataSourceTencentCloudDayuL4RulesV2() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudDayuL4RulesReadV2, + Schema: map[string]*schema.Schema{ + "business": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validateAllowedStringValue(DAYU_RESOURCE_TYPE), + Description: "Type of the resource that the layer 4 rule works for, valid values are `bgpip`, `bgp`, `bgp-multip` and `net`.", + }, + "virtual_port": { + Type: schema.TypeInt, + Optional: true, + Description: "Virtual port of resource.", + }, + "ip": { + Type: schema.TypeString, + Optional: true, + Description: "Ip of the resource.", + }, + "list": { + Type: schema.TypeList, + Computed: true, + Description: "A list of layer 4 rules. Each element contains the following attributes:", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "protocol": { + Type: schema.TypeString, + Computed: true, + Description: "Protocol of the rule.", + }, + "source_port": { + Type: schema.TypeInt, + Computed: true, + Description: "The source port of the layer 4 rule.", + }, + "virtual_port": { + Type: schema.TypeInt, + Computed: true, + Description: "The virtual port of the layer 4 rule.", + }, + "keeptime": { + Type: schema.TypeInt, + Computed: true, + Description: "The keeptime of the layer 4 rule.", + }, + "source_list": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "source": { + Type: schema.TypeString, + Computed: true, + Description: "Source IP or domain.", + }, + "weight": { + Type: schema.TypeInt, + Computed: true, + Description: "Weight of the source.", + }, + }, + }, + Description: "Source list of the rule.", + }, + "rule_id": { + Type: schema.TypeString, + Computed: true, + Description: "ID of the 4 layer rule.", + }, + "lb_type": { + Type: schema.TypeInt, + Computed: true, + Description: "LB type of the rule, `1` for weight cycling and `2` for IP hash.", + }, + "keep_enable": { + Type: schema.TypeBool, + Computed: true, + Description: "session hold switch.", + }, + "source_type": { + Type: schema.TypeInt, + Computed: true, + Description: "Source type, `1` for source of host, `2` for source of IP.", + }, + "rule_name": { + Type: schema.TypeString, + Computed: true, + Description: "Name of the rule.", + }, + "remove_switch": { + Type: schema.TypeBool, + Computed: true, + Description: "Remove the watermark state.", + }, + "modify_time": { + Type: schema.TypeString, + Computed: true, + Description: "Rule modification time.", + }, + "region": { + Type: schema.TypeInt, + Computed: true, + Description: "Corresponding regional information.", + }, + "ip": { + Type: schema.TypeString, + Computed: true, + Description: "Bind the resource IP information.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "Bind the resource ID information.", + }, + }, + }, + }, + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func dataSourceTencentCloudDayuL4RulesReadV2(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("data_source.tencentcloud_dayu_l4_rules_v2.read")() + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := DayuService{ + client: meta.(*TencentCloudClient).apiV3Conn, + } + + business := d.Get("business").(string) + extendParams := make(map[string]interface{}) + if v, ok := d.GetOk("ip"); ok { + extendParams["ip"] = v.(string) + } + if v, ok := d.GetOk("virtual_port"); ok { + extendParams["virtual_port"] = v.(int) + } + + rules := make([]*dayu.NewL4RuleEntry, 0) + err := resource.Retry(readRetryTimeout, func() *resource.RetryError { + result, err := service.DescribeNewL4Rules(ctx, business, extendParams) + + if err != nil { + return retryError(err) + } + rules = result + return nil + }) + + if err != nil { + return err + } + list := make([]map[string]interface{}, 0) + for _, rule := range rules { + tmpRule := make(map[string]interface{}) + tmpRule["protocol"] = *rule.Protocol + tmpRule["source_port"] = *rule.SourcePort + tmpRule["virtual_port"] = *rule.VirtualPort + tmpRule["keeptime"] = *rule.KeepEnable + tmpSourceList := make([]map[string]interface{}, 0) + for _, source := range rule.SourceList { + tmpSource := make(map[string]interface{}) + tmpSource["source"] = *source.Source + tmpSource["weight"] = *source.Weight + tmpSourceList = append(tmpSourceList, tmpSource) + } + tmpRule["source_list"] = tmpSourceList + tmpRule["rule_id"] = *rule.RuleId + tmpRule["lb_type"] = *rule.LbType + tmpRule["keep_enable"] = *rule.KeepEnable == 1 + tmpRule["source_type"] = *rule.SourceType + tmpRule["rule_name"] = *rule.RuleName + tmpRule["remove_switch"] = *rule.RemoveSwitch == 1 + tmpRule["modify_time"] = *rule.ModifyTime + tmpRule["region"] = *rule.Region + tmpRule["ip"] = *rule.Ip + tmpRule["id"] = *rule.Id + list = append(list, tmpRule) + } + ids := make([]string, 0, len(list)) + + d.SetId(helper.DataResourceIdsHash(ids)) + if e := d.Set("list", list); e != nil { + log.Printf("[CRITAL]%s provider set rules fail, reason:%s\n", logId, e.Error()) + return e + } + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + return writeToFile(output.(string), list) + } + return nil + +} diff --git a/tencentcloud/data_source_tc_dayu_l4_rules_v2_test.go b/tencentcloud/data_source_tc_dayu_l4_rules_v2_test.go new file mode 100644 index 0000000000..3cd83323c9 --- /dev/null +++ b/tencentcloud/data_source_tc_dayu_l4_rules_v2_test.go @@ -0,0 +1,65 @@ +package tencentcloud + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +var testDataDayuL4RulesV2Name = "data.tencentcloud_dayu_l4_rules_v2.test" + +func TestAccTencentCloudDataDayuL4RulesV2(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckDayuL4RuleV2Destroy, + Steps: []resource.TestStep{ + { + Config: testAccTencentCloudDataDayuL4RulesV2Baic, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckDayuL4RuleV2Exists(testDayuL4RuleV2ResourceKeyTCP), + resource.TestCheckResourceAttr(testDataDayuL4RulesV2Name, "list.#", "1"), + resource.TestCheckResourceAttr(testDataDayuL4RulesV2Name, "list.0.protocol", "TCP"), + resource.TestCheckResourceAttr(testDataDayuL4RulesV2Name, "list.0.source_list.#", "1"), + resource.TestCheckResourceAttr(testDataDayuL4RulesV2Name, "list.0.virtual_port", "2020"), + resource.TestCheckResourceAttr(testDataDayuL4RulesV2Name, "list.0.source_type", "2"), + resource.TestCheckResourceAttr(testDataDayuL4RulesV2Name, "list.0.source_port", "20"), + resource.TestCheckResourceAttr(testDataDayuL4RulesV2Name, "list.0.rule_name", "test"), + ), + }, + }, + }) +} + +const testAccTencentCloudDataDayuL4RulesV2Baic = ` +resource "tencentcloud_dayu_l4_rule_v2" "test" { + business = "bgpip" + resource_id = "bgpip-000004xg" + vpn = "162.62.163.50" + virtual_port = 2020 + + rules { + keep_enable = false + keeptime = 0 + lb_type = 1 + protocol = "TCP" + region = 5 + remove_switch = false + rule_name = "test" + source_list { + source = "1.2.3.9" + weight = 0 + } + source_port = 20 + source_type = 2 + virtual_port = 2020 + } + } + +data "tencentcloud_dayu_l4_rules_v2" "test" { + business = tencentcloud_dayu_l4_rule_v2.test.business + ip = tencentcloud_dayu_l4_rule_v2.test.vpn + virtual_port = tencentcloud_dayu_l4_rule_v2.test.virtual_port +} +` diff --git a/tencentcloud/provider.go b/tencentcloud/provider.go index 1e7d86e54b..a9323ed642 100644 --- a/tencentcloud/provider.go +++ b/tencentcloud/provider.go @@ -766,6 +766,7 @@ func Provider() terraform.ResourceProvider { "tencentcloud_dayu_ddos_policy_cases": dataSourceTencentCloudDayuDdosPolicyCases(), "tencentcloud_dayu_ddos_policy_attachments": dataSourceTencentCloudDayuDdosPolicyAttachments(), "tencentcloud_dayu_l4_rules": dataSourceTencentCloudDayuL4Rules(), + "tencentcloud_dayu_l4_rules_v2": dataSourceTencentCloudDayuL4RulesV2(), "tencentcloud_dayu_l7_rules": dataSourceTencentCloudDayuL7Rules(), "tencentcloud_gaap_proxies": dataSourceTencentCloudGaapProxies(), "tencentcloud_gaap_realservers": dataSourceTencentCloudGaapRealservers(), @@ -942,6 +943,7 @@ func Provider() terraform.ResourceProvider { "tencentcloud_dayu_ddos_policy_case": resourceTencentCloudDayuDdosPolicyCase(), "tencentcloud_dayu_ddos_policy_attachment": resourceTencentCloudDayuDdosPolicyAttachment(), "tencentcloud_dayu_l4_rule": resourceTencentCloudDayuL4Rule(), + "tencentcloud_dayu_l4_rule_v2": resourceTencentCloudDayuL4RuleV2(), "tencentcloud_dayu_l7_rule": resourceTencentCloudDayuL7Rule(), "tencentcloud_gaap_proxy": resourceTencentCloudGaapProxy(), "tencentcloud_gaap_realserver": resourceTencentCloudGaapRealserver(), diff --git a/tencentcloud/resource_tc_dayu_l4_rule_v2.go b/tencentcloud/resource_tc_dayu_l4_rule_v2.go new file mode 100644 index 0000000000..2dfcd0321c --- /dev/null +++ b/tencentcloud/resource_tc_dayu_l4_rule_v2.go @@ -0,0 +1,291 @@ +/* +Use this resource to create dayu layer 4 rule + +~> **NOTE:** This resource only support resource Anti-DDoS of type `bgpip` and `net` + +Example Usage + +```hcl +resource "tencentcloud_dayu_l4_rule" "test_rule" { + resource_type = "bgpip" + resource_id = "bgpip-00000294" + name = "rule_test" + protocol = "TCP" + s_port = 80 + d_port = 60 + source_type = 2 + health_check_switch = true + health_check_timeout = 30 + health_check_interval = 35 + health_check_health_num = 5 + health_check_unhealth_num = 10 + session_switch = false + session_time = 300 + + source_list { + source = "1.1.1.1" + weight = 100 + } + source_list { + source = "2.2.2.2" + weight = 50 + } +} +``` +*/ +package tencentcloud + +import ( + "context" + "fmt" + "log" + "strconv" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + dayu "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dayu/v20180709" +) + +func resourceTencentCloudDayuL4RuleV2() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudDayuL4RuleCreateV2, + Read: resourceTencentCloudDayuL4RuleReadV2, + Delete: resourceTencentCloudDayuL4RuleDeleteV2, + + Schema: map[string]*schema.Schema{ + "business": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validateAllowedStringValue(DAYU_RESOURCE_TYPE_RULE), + ForceNew: true, + Description: "Business of the resource that the layer 4 rule works for. Valid values: `bgpip` and `net`.", + }, + "resource_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Resource id.", + }, + "vpn": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Resource vpn.", + }, + "virtual_port": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + Description: "The virtual port of the layer 4 rule.", + }, + "rules": { + Type: schema.TypeList, + MaxItems: 1, + Required: true, + ForceNew: true, + Description: "A list of layer 4 rules. Each element contains the following attributes:", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "protocol": { + Type: schema.TypeString, + Required: true, + Description: "Protocol of the rule.", + }, + "source_port": { + Type: schema.TypeInt, + Required: true, + Description: "The source port of the layer 4 rule.", + }, + "virtual_port": { + Type: schema.TypeInt, + Required: true, + Description: "The virtual port of the layer 4 rule.", + }, + "keeptime": { + Type: schema.TypeInt, + Required: true, + Description: "The keeptime of the layer 4 rule.", + }, + "source_list": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "source": { + Type: schema.TypeString, + Required: true, + Description: "Source IP or domain.", + }, + "weight": { + Type: schema.TypeInt, + Required: true, + Description: "Weight of the source.", + }, + }, + }, + Description: "Source list of the rule.", + }, + "lb_type": { + Type: schema.TypeInt, + Required: true, + Description: "LB type of the rule, `1` for weight cycling and `2` for IP hash.", + }, + "keep_enable": { + Type: schema.TypeBool, + Required: true, + Description: "session hold switch.", + }, + "source_type": { + Type: schema.TypeInt, + Required: true, + Description: "Source type, `1` for source of host, `2` for source of IP.", + }, + "rule_name": { + Type: schema.TypeString, + Required: true, + Description: "Name of the rule.", + }, + "remove_switch": { + Type: schema.TypeBool, + Required: true, + Description: "Remove the watermark state.", + }, + "region": { + Type: schema.TypeInt, + Required: true, + Description: "Corresponding regional information.", + }, + }, + }, + }, + }, + } +} + +func resourceTencentCloudDayuL4RuleCreateV2(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_dayu_l4_rule_v2.create")() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + resourceId := d.Get("resource_id").(string) + business := d.Get("business").(string) + vpn := d.Get("vpn").(string) + virtualPort := d.Get("virtual_port").(int) + rules := d.Get("rules").([]interface{}) + service := DayuService{ + client: meta.(*TencentCloudClient).apiV3Conn, + } + err := service.CreateNewL4Rules(ctx, business, resourceId, vpn, rules) + if err != nil { + return err + } + virtualPortStr := strconv.Itoa(virtualPort) + d.SetId(business + FILED_SP + resourceId + FILED_SP + vpn + FILED_SP + virtualPortStr) + return resourceTencentCloudDayuL4RuleReadV2(d, meta) +} + +func resourceTencentCloudDayuL4RuleReadV2(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_dayu_l4_rule.read")() + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := DayuService{ + client: meta.(*TencentCloudClient).apiV3Conn, + } + items := strings.Split(d.Id(), FILED_SP) + if len(items) < 4 { + return fmt.Errorf("broken ID of dayu L4 rule") + } + business := items[0] + resourceId := items[1] + ip := items[2] + virtualPortStr := items[3] + + extendParams := make(map[string]interface{}) + extendParams["ip"] = ip + virtualPort, err := strconv.Atoi(virtualPortStr) + if err != nil { + log.Printf("virtual_port must be int.") + } + extendParams["virtual_port"] = virtualPort + + rules := make([]*dayu.NewL4RuleEntry, 0) + err = resource.Retry(readRetryTimeout, func() *resource.RetryError { + result, err := service.DescribeNewL4Rules(ctx, business, extendParams) + + if err != nil { + return retryError(err) + } + rules = result + return nil + }) + + if err != nil { + return err + } + posRules := make([]dayu.NewL4RuleEntry, 0) + for _, rule := range rules { + if *rule.Id == resourceId { + posRules = append(posRules, *rule) + } + } + + _ = d.Set("rules", posRules) + + return nil +} + +func resourceTencentCloudDayuL4RuleDeleteV2(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_dayu_l4_rule.delete")() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := DayuService{ + client: meta.(*TencentCloudClient).apiV3Conn, + } + + items := strings.Split(d.Id(), FILED_SP) + if len(items) < 4 { + return fmt.Errorf("broken ID of dayu L4 rule") + } + business := items[0] + resourceId := items[1] + vpn := items[2] + virtualPortStr := items[3] + virtualPort, err := strconv.Atoi(virtualPortStr) + if err != nil { + log.Printf("virtual_port must be int.") + } + extendParams := make(map[string]interface{}) + extendParams["ip"] = vpn + extendParams["virtual_port"] = virtualPort + + rules := make([]*dayu.NewL4RuleEntry, 0) + err = resource.Retry(readRetryTimeout, func() *resource.RetryError { + result, err := service.DescribeNewL4Rules(ctx, business, extendParams) + + if err != nil { + return retryError(err) + } + rules = result + return nil + }) + + if err != nil { + return err + } + var delRuleId string + if len(rules) > 0 { + if *rules[0].Ip == vpn && *rules[0].VirtualPort == uint64(virtualPort) { + delRuleId = *rules[0].RuleId + } + } + err = service.DeleteNewL4Rules(ctx, business, resourceId, vpn, []string{delRuleId}) + if err != nil { + return err + } + return nil +} diff --git a/tencentcloud/resource_tc_dayu_l4_rule_v2_test.go b/tencentcloud/resource_tc_dayu_l4_rule_v2_test.go new file mode 100644 index 0000000000..7cd9d4fcd9 --- /dev/null +++ b/tencentcloud/resource_tc_dayu_l4_rule_v2_test.go @@ -0,0 +1,141 @@ +package tencentcloud + +import ( + "context" + "fmt" + "log" + "strconv" + "strings" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +var testDayuL4RuleV2ResourceNameTCP = "tencentcloud_dayu_l4_rule_v2" +var testDayuL4RuleV2ResourceKeyTCP = testDayuL4RuleV2ResourceNameTCP + ".test" + +func TestAccTencentCloudDayuL4RuleV2Resource_TCP(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckDayuL4RuleV2Destroy, + Steps: []resource.TestStep{ + { + Config: testAccDayuL4RuleV2_tdp, + Check: resource.ComposeTestCheckFunc( + testAccCheckDayuL4RuleV2Exists(testDayuL4RuleV2ResourceKeyTCP), + resource.TestCheckResourceAttr(testDayuL4RuleV2ResourceKeyTCP, "business", "bgpip"), + resource.TestCheckResourceAttr(testDayuL4RuleV2ResourceKeyTCP, "rules.0.rule_name", "test"), + resource.TestCheckResourceAttr(testDayuL4RuleV2ResourceKeyTCP, "rules.0.protocol", "TCP"), + resource.TestCheckResourceAttr(testDayuL4RuleV2ResourceKeyTCP, "rules.0.source_list.#", "1"), + resource.TestCheckResourceAttr(testDayuL4RuleV2ResourceKeyTCP, "rules.0.virtual_port", "2020"), + resource.TestCheckResourceAttr(testDayuL4RuleV2ResourceKeyTCP, "vpn", "162.62.163.50"), + resource.TestCheckResourceAttr(testDayuL4RuleV2ResourceKeyTCP, "rules.0.source_port", "20"), + ), + }, + }, + }) +} + +func testAccCheckDayuL4RuleV2Destroy(s *terraform.State) error { + for _, rs := range s.RootModule().Resources { + if rs.Type != testDayuL4RuleV2ResourceNameTCP { + continue + } + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + items := strings.Split(rs.Primary.ID, FILED_SP) + if len(items) < 4 { + return fmt.Errorf("broken ID of L4 rule") + } + business := items[0] + resourceId := items[1] + vpn := items[2] + virtualPortStr := items[3] + service := DayuService{client: testAccProvider.Meta().(*TencentCloudClient).apiV3Conn} + extendParams := make(map[string]interface{}) + extendParams["ip"] = vpn + virtualPort, err := strconv.Atoi(virtualPortStr) + if err != nil { + log.Printf("virtual_port must be int.") + } + extendParams["virtual_port"] = virtualPort + result, err := service.DescribeNewL4Rules(ctx, business, extendParams) + if len(result) > 0 && err != nil { + delRuleId := *result[0].RuleId + err = service.DeleteNewL4Rules(ctx, business, resourceId, vpn, []string{delRuleId}) + } + if err != nil { + return err + } + } + return nil +} + +func testAccCheckDayuL4RuleV2Exists(n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("resource %s is not found", n) + } + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + items := strings.Split(rs.Primary.ID, FILED_SP) + if len(items) < 4 { + return fmt.Errorf("broken ID of L4 rule") + } + business := items[0] + vpn := items[2] + virtualPortStr := items[3] + virtualPort, err := strconv.Atoi(virtualPortStr) + service := DayuService{client: testAccProvider.Meta().(*TencentCloudClient).apiV3Conn} + + extendParams := make(map[string]interface{}) + extendParams["ip"] = vpn + if err != nil { + log.Printf("virtual_port must be int.") + } + extendParams["virtual_port"] = virtualPort + result, err := service.DescribeNewL4Rules(ctx, business, extendParams) + + if err != nil { + return err + } + if len(result) > 0 { + return nil + } else { + return fmt.Errorf("L4 rule %s not found on server", rs.Primary.ID) + + } + } +} + +const testAccDayuL4RuleV2_tdp string = ` +resource "tencentcloud_dayu_l4_rule_v2" "test" { + business = "bgpip" + resource_id = "bgpip-000004xg" + vpn = "162.62.163.50" + virtual_port = 2020 + + rules { + keep_enable = false + keeptime = 0 + lb_type = 1 + protocol = "TCP" + region = 5 + remove_switch = false + rule_name = "test" + source_list { + source = "1.2.3.9" + weight = 0 + } + source_port = 20 + source_type = 2 + virtual_port = 2020 + } + } +` diff --git a/tencentcloud/service_tencentcloud_dayu.go b/tencentcloud/service_tencentcloud_dayu.go index 9e49718bf8..64c243867f 100644 --- a/tencentcloud/service_tencentcloud_dayu.go +++ b/tencentcloud/service_tencentcloud_dayu.go @@ -7,6 +7,7 @@ import ( "net/url" "github.com/pkg/errors" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" sdkError "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors" dayu "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dayu/v20180709" "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/connectivity" @@ -1326,6 +1327,199 @@ func (me *DayuService) SetRuleSwitch(ctx context.Context, resourceType string, r } return } +func (me *DayuService) DescribeNewL4Rules(ctx context.Context, business string, extendParams map[string]interface{}) (infos []*dayu.NewL4RuleEntry, errRet error) { + logId := getLogId(ctx) + request := dayu.NewDescribeNewL4RulesRequest() + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail,reason[%s]", logId, request.GetAction(), errRet.Error()) + } + }() + + request.Business = common.StringPtr(business) + + var offset, limit uint64 = 0, 20 + request.Offset = common.Uint64Ptr(offset) + request.Limit = common.Uint64Ptr(limit) + + if ip, ok := extendParams["ip"]; ok { + request.Ip = common.StringPtr(ip.(string)) + } + if virtualPort, ok := extendParams["virtual_port"]; ok { + request.VirtualPort = common.Uint64Ptr(uint64(virtualPort.(int))) + } + + response, errRet := me.client.UseDayuClient().DescribeNewL4Rules(request) + if errRet != nil { + return + } + infos = response.Response.Rules + return + +} + +func (me *DayuService) DeleteNewL4Rules(ctx context.Context, business string, id string, ip string, ruleIds []string) (errRet error) { + logId := getLogId(ctx) + request := dayu.NewDeleteNewL4RulesRequest() + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail,reason[%s]", logId, request.GetAction(), errRet.Error()) + } + }() + + request.Business = common.StringPtr(business) + request.Rule = []*dayu.L4DelRule{ + { + Id: common.StringPtr(id), + Ip: common.StringPtr(ip), + RuleIdList: common.StringPtrs(ruleIds), + }, + } + for { + ratelimit.Check(request.GetAction()) + response, err := me.client.UseDayuClient().DeleteNewL4Rules(request) + + if err != nil { + if sdkErr, ok := err.(*sdkError.TencentCloudSDKError); ok { + if sdkErr.Code == "InvalidParameterValue" { + errRet = nil + return + } + } + errRet = err + return + } + if *response.Response.Success.Code == "Success" { + return + } + } +} + +func (me *DayuService) ModifyNewL4Rule(ctx context.Context, business string, id string, singleRule interface{}) (errRet error) { + logId := getLogId(ctx) + request := dayu.NewModifyNewL4RuleRequest() + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail,reason[%s]", logId, request.GetAction(), errRet.Error()) + } + }() + + rule := singleRule.(map[string]interface{}) + tmpRule := dayu.L4RuleEntry{} + tmpRule.Protocol = common.StringPtr(rule["protocol"].(string)) + tmpRule.SourcePort = common.Uint64Ptr((uint64(rule["source_port"].(int)))) + tmpRule.VirtualPort = common.Uint64Ptr((uint64(rule["virtual_port"].(int)))) + tmpRule.KeepTime = common.Uint64Ptr((uint64(rule["keeptime"].(int)))) + tmpRule.RuleId = common.StringPtr((rule["rule_id"].(string))) + tmpRule.LbType = common.Uint64Ptr((uint64(rule["lb_type"].(int)))) + if rule["keep_enable"].(bool) { + tmpRule.KeepEnable = common.Uint64Ptr((uint64(1))) + } else { + tmpRule.KeepEnable = common.Uint64Ptr((uint64(0))) + } + tmpRule.SourceType = common.Uint64Ptr((uint64(rule["source_type"].(int)))) + if rule["remove_switch"].(bool) { + tmpRule.RemoveSwitch = common.Uint64Ptr((uint64(1))) + } else { + tmpRule.RemoveSwitch = common.Uint64Ptr((uint64(0))) + } + sourceList := rule["source_list"].([]interface{}) + tmpRule.SourceList = make([]*dayu.L4RuleSource, 0) + for _, singleSource := range sourceList { + source := singleSource.(map[string]interface{}) + tSource := source["source"].(string) + tWeight := uint64(source["weight"].(int)) + tmpRule.SourceList = append(tmpRule.SourceList, &dayu.L4RuleSource{Source: &tSource, Weight: &tWeight}) + } + + request.Business = common.StringPtr(business) + request.Id = common.StringPtr(id) + request.Rule = &tmpRule + + for { + ratelimit.Check(request.GetAction()) + response, err := me.client.UseDayuClient().ModifyNewL4Rule(request) + + if err != nil { + if sdkErr, ok := err.(*sdkError.TencentCloudSDKError); ok { + if sdkErr.Code == "InvalidParameterValue" { + errRet = nil + return + } + } + errRet = err + return + } + if *response.Response.Success.Code == "Success" { + return + } + } +} + +func (me *DayuService) CreateNewL4Rules(ctx context.Context, business string, id string, vip string, ruleList []interface{}) (errRet error) { + logId := getLogId(ctx) + request := dayu.NewCreateNewL4RulesRequest() + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail,reason[%s]", logId, request.GetAction(), errRet.Error()) + } + }() + + rules := make([]*dayu.L4RuleEntry, 0) + for _, singleRule := range ruleList { + rule := singleRule.(map[string]interface{}) + tmpRule := dayu.L4RuleEntry{} + tmpRule.Protocol = common.StringPtr(rule["protocol"].(string)) + tmpRule.SourcePort = common.Uint64Ptr((uint64(rule["source_port"].(int)))) + tmpRule.VirtualPort = common.Uint64Ptr((uint64(rule["virtual_port"].(int)))) + tmpRule.KeepTime = common.Uint64Ptr((uint64(rule["keeptime"].(int)))) + tmpRule.RuleName = common.StringPtr((rule["rule_name"].(string))) + tmpRule.LbType = common.Uint64Ptr((uint64(rule["lb_type"].(int)))) + if rule["keep_enable"].(bool) { + tmpRule.KeepEnable = common.Uint64Ptr((uint64(1))) + } else { + tmpRule.KeepEnable = common.Uint64Ptr((uint64(0))) + } + tmpRule.SourceType = common.Uint64Ptr((uint64(rule["source_type"].(int)))) + if rule["remove_switch"].(bool) { + tmpRule.RemoveSwitch = common.Uint64Ptr((uint64(1))) + } else { + tmpRule.RemoveSwitch = common.Uint64Ptr((uint64(0))) + } + sourceList := rule["source_list"].([]interface{}) + tmpRule.SourceList = make([]*dayu.L4RuleSource, 0) + for _, singleSource := range sourceList { + source := singleSource.(map[string]interface{}) + tSource := source["source"].(string) + tWeight := uint64(source["weight"].(int)) + tmpRule.SourceList = append(tmpRule.SourceList, &dayu.L4RuleSource{Source: &tSource, Weight: &tWeight}) + } + rules = append(rules, &tmpRule) + } + request.Business = common.StringPtr(business) + request.IdList = common.StringPtrs([]string{id}) + request.VipList = common.StringPtrs([]string{vip}) + request.Rules = rules + + for { + ratelimit.Check(request.GetAction()) + response, err := me.client.UseDayuClient().CreateNewL4Rules(request) + + if err != nil { + if sdkErr, ok := err.(*sdkError.TencentCloudSDKError); ok { + if sdkErr.Code == "InvalidParameterValue" { + errRet = nil + return + } + } + errRet = err + return + } + if *response.Response.Success.Code == "Success" { + return + } + } +} func (me *DayuService) DescribeL4Rules(ctx context.Context, resourceType string, resourceId string, ruleName string, ruleId string) (infos []*dayu.L4RuleEntry, healths []*dayu.L4RuleHealth, has bool, errRet error) { logId := getLogId(ctx) diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/LICENSE b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/LICENSE new file mode 100644 index 0000000000..efc75a2253 --- /dev/null +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) 2017-2018 Tencent Ltd. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/v20200309/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/v20200309/client.go new file mode 100644 index 0000000000..b1e408837e --- /dev/null +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/v20200309/client.go @@ -0,0 +1,3581 @@ +// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v20200309 + +import ( + "context" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile" +) + +const APIVersion = "2020-03-09" + +type Client struct { + common.Client +} + +// Deprecated +func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error) { + cpf := profile.NewClientProfile() + client = &Client{} + client.Init(region).WithSecretId(secretId, secretKey).WithProfile(cpf) + return +} + +func NewClient(credential common.CredentialIface, region string, clientProfile *profile.ClientProfile) (client *Client, err error) { + client = &Client{} + client.Init(region). + WithCredential(credential). + WithProfile(clientProfile) + return +} + + +func NewAssociateDDoSEipAddressRequest() (request *AssociateDDoSEipAddressRequest) { + request = &AssociateDDoSEipAddressRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "AssociateDDoSEipAddress") + + + return +} + +func NewAssociateDDoSEipAddressResponse() (response *AssociateDDoSEipAddressResponse) { + response = &AssociateDDoSEipAddressResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// AssociateDDoSEipAddress +// 本接口 (AssociateDDoSEipAddress) 用于将高防弹性公网IP绑定到实例或弹性网卡的指定内网 IP 上。 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) AssociateDDoSEipAddress(request *AssociateDDoSEipAddressRequest) (response *AssociateDDoSEipAddressResponse, err error) { + if request == nil { + request = NewAssociateDDoSEipAddressRequest() + } + + response = NewAssociateDDoSEipAddressResponse() + err = c.Send(request, response) + return +} + +// AssociateDDoSEipAddress +// 本接口 (AssociateDDoSEipAddress) 用于将高防弹性公网IP绑定到实例或弹性网卡的指定内网 IP 上。 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) AssociateDDoSEipAddressWithContext(ctx context.Context, request *AssociateDDoSEipAddressRequest) (response *AssociateDDoSEipAddressResponse, err error) { + if request == nil { + request = NewAssociateDDoSEipAddressRequest() + } + request.SetContext(ctx) + + response = NewAssociateDDoSEipAddressResponse() + err = c.Send(request, response) + return +} + +func NewAssociateDDoSEipLoadBalancerRequest() (request *AssociateDDoSEipLoadBalancerRequest) { + request = &AssociateDDoSEipLoadBalancerRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "AssociateDDoSEipLoadBalancer") + + + return +} + +func NewAssociateDDoSEipLoadBalancerResponse() (response *AssociateDDoSEipLoadBalancerResponse) { + response = &AssociateDDoSEipLoadBalancerResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// AssociateDDoSEipLoadBalancer +// 本接口 (AssociateDDoSEipLoadBalancer) 用于将高防弹性公网IP绑定到负载均衡指定内网 IP 上。 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) AssociateDDoSEipLoadBalancer(request *AssociateDDoSEipLoadBalancerRequest) (response *AssociateDDoSEipLoadBalancerResponse, err error) { + if request == nil { + request = NewAssociateDDoSEipLoadBalancerRequest() + } + + response = NewAssociateDDoSEipLoadBalancerResponse() + err = c.Send(request, response) + return +} + +// AssociateDDoSEipLoadBalancer +// 本接口 (AssociateDDoSEipLoadBalancer) 用于将高防弹性公网IP绑定到负载均衡指定内网 IP 上。 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) AssociateDDoSEipLoadBalancerWithContext(ctx context.Context, request *AssociateDDoSEipLoadBalancerRequest) (response *AssociateDDoSEipLoadBalancerResponse, err error) { + if request == nil { + request = NewAssociateDDoSEipLoadBalancerRequest() + } + request.SetContext(ctx) + + response = NewAssociateDDoSEipLoadBalancerResponse() + err = c.Send(request, response) + return +} + +func NewCreateBlackWhiteIpListRequest() (request *CreateBlackWhiteIpListRequest) { + request = &CreateBlackWhiteIpListRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "CreateBlackWhiteIpList") + + + return +} + +func NewCreateBlackWhiteIpListResponse() (response *CreateBlackWhiteIpListResponse) { + response = &CreateBlackWhiteIpListResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreateBlackWhiteIpList +// 添加DDoS防护的IP黑白名单 +// +// 可能返回的错误码: +// LIMITEXCEEDED = "LimitExceeded" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateBlackWhiteIpList(request *CreateBlackWhiteIpListRequest) (response *CreateBlackWhiteIpListResponse, err error) { + if request == nil { + request = NewCreateBlackWhiteIpListRequest() + } + + response = NewCreateBlackWhiteIpListResponse() + err = c.Send(request, response) + return +} + +// CreateBlackWhiteIpList +// 添加DDoS防护的IP黑白名单 +// +// 可能返回的错误码: +// LIMITEXCEEDED = "LimitExceeded" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateBlackWhiteIpListWithContext(ctx context.Context, request *CreateBlackWhiteIpListRequest) (response *CreateBlackWhiteIpListResponse, err error) { + if request == nil { + request = NewCreateBlackWhiteIpListRequest() + } + request.SetContext(ctx) + + response = NewCreateBlackWhiteIpListResponse() + err = c.Send(request, response) + return +} + +func NewCreateBoundIPRequest() (request *CreateBoundIPRequest) { + request = &CreateBoundIPRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "CreateBoundIP") + + + return +} + +func NewCreateBoundIPResponse() (response *CreateBoundIPResponse) { + response = &CreateBoundIPResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreateBoundIP +// 绑定IP到高防包实例,支持独享包、共享包;需要注意的是此接口绑定或解绑IP是异步接口,当处于绑定或解绑中时,则不允许再进行绑定或解绑,需要等待当前绑定或解绑完成。 +// +// 可能返回的错误码: +// LIMITEXCEEDED = "LimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateBoundIP(request *CreateBoundIPRequest) (response *CreateBoundIPResponse, err error) { + if request == nil { + request = NewCreateBoundIPRequest() + } + + response = NewCreateBoundIPResponse() + err = c.Send(request, response) + return +} + +// CreateBoundIP +// 绑定IP到高防包实例,支持独享包、共享包;需要注意的是此接口绑定或解绑IP是异步接口,当处于绑定或解绑中时,则不允许再进行绑定或解绑,需要等待当前绑定或解绑完成。 +// +// 可能返回的错误码: +// LIMITEXCEEDED = "LimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateBoundIPWithContext(ctx context.Context, request *CreateBoundIPRequest) (response *CreateBoundIPResponse, err error) { + if request == nil { + request = NewCreateBoundIPRequest() + } + request.SetContext(ctx) + + response = NewCreateBoundIPResponse() + err = c.Send(request, response) + return +} + +func NewCreateDDoSAIRequest() (request *CreateDDoSAIRequest) { + request = &CreateDDoSAIRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "CreateDDoSAI") + + + return +} + +func NewCreateDDoSAIResponse() (response *CreateDDoSAIResponse) { + response = &CreateDDoSAIResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreateDDoSAI +// 设置DDoS防护的AI防护开关 +// +// 可能返回的错误码: +// LIMITEXCEEDED = "LimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateDDoSAI(request *CreateDDoSAIRequest) (response *CreateDDoSAIResponse, err error) { + if request == nil { + request = NewCreateDDoSAIRequest() + } + + response = NewCreateDDoSAIResponse() + err = c.Send(request, response) + return +} + +// CreateDDoSAI +// 设置DDoS防护的AI防护开关 +// +// 可能返回的错误码: +// LIMITEXCEEDED = "LimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateDDoSAIWithContext(ctx context.Context, request *CreateDDoSAIRequest) (response *CreateDDoSAIResponse, err error) { + if request == nil { + request = NewCreateDDoSAIRequest() + } + request.SetContext(ctx) + + response = NewCreateDDoSAIResponse() + err = c.Send(request, response) + return +} + +func NewCreateDDoSBlackWhiteIpListRequest() (request *CreateDDoSBlackWhiteIpListRequest) { + request = &CreateDDoSBlackWhiteIpListRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "CreateDDoSBlackWhiteIpList") + + + return +} + +func NewCreateDDoSBlackWhiteIpListResponse() (response *CreateDDoSBlackWhiteIpListResponse) { + response = &CreateDDoSBlackWhiteIpListResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreateDDoSBlackWhiteIpList +// 添加DDoS防护的IP网段黑白名单 +// +// 可能返回的错误码: +// LIMITEXCEEDED = "LimitExceeded" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateDDoSBlackWhiteIpList(request *CreateDDoSBlackWhiteIpListRequest) (response *CreateDDoSBlackWhiteIpListResponse, err error) { + if request == nil { + request = NewCreateDDoSBlackWhiteIpListRequest() + } + + response = NewCreateDDoSBlackWhiteIpListResponse() + err = c.Send(request, response) + return +} + +// CreateDDoSBlackWhiteIpList +// 添加DDoS防护的IP网段黑白名单 +// +// 可能返回的错误码: +// LIMITEXCEEDED = "LimitExceeded" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateDDoSBlackWhiteIpListWithContext(ctx context.Context, request *CreateDDoSBlackWhiteIpListRequest) (response *CreateDDoSBlackWhiteIpListResponse, err error) { + if request == nil { + request = NewCreateDDoSBlackWhiteIpListRequest() + } + request.SetContext(ctx) + + response = NewCreateDDoSBlackWhiteIpListResponse() + err = c.Send(request, response) + return +} + +func NewCreateDDoSConnectLimitRequest() (request *CreateDDoSConnectLimitRequest) { + request = &CreateDDoSConnectLimitRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "CreateDDoSConnectLimit") + + + return +} + +func NewCreateDDoSConnectLimitResponse() (response *CreateDDoSConnectLimitResponse) { + response = &CreateDDoSConnectLimitResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreateDDoSConnectLimit +// 配置DDoS连接抑制选项 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateDDoSConnectLimit(request *CreateDDoSConnectLimitRequest) (response *CreateDDoSConnectLimitResponse, err error) { + if request == nil { + request = NewCreateDDoSConnectLimitRequest() + } + + response = NewCreateDDoSConnectLimitResponse() + err = c.Send(request, response) + return +} + +// CreateDDoSConnectLimit +// 配置DDoS连接抑制选项 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateDDoSConnectLimitWithContext(ctx context.Context, request *CreateDDoSConnectLimitRequest) (response *CreateDDoSConnectLimitResponse, err error) { + if request == nil { + request = NewCreateDDoSConnectLimitRequest() + } + request.SetContext(ctx) + + response = NewCreateDDoSConnectLimitResponse() + err = c.Send(request, response) + return +} + +func NewCreateDDoSGeoIPBlockConfigRequest() (request *CreateDDoSGeoIPBlockConfigRequest) { + request = &CreateDDoSGeoIPBlockConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "CreateDDoSGeoIPBlockConfig") + + + return +} + +func NewCreateDDoSGeoIPBlockConfigResponse() (response *CreateDDoSGeoIPBlockConfigResponse) { + response = &CreateDDoSGeoIPBlockConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreateDDoSGeoIPBlockConfig +// 添加DDoS防护的区域封禁配置 +// +// 可能返回的错误码: +// LIMITEXCEEDED = "LimitExceeded" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateDDoSGeoIPBlockConfig(request *CreateDDoSGeoIPBlockConfigRequest) (response *CreateDDoSGeoIPBlockConfigResponse, err error) { + if request == nil { + request = NewCreateDDoSGeoIPBlockConfigRequest() + } + + response = NewCreateDDoSGeoIPBlockConfigResponse() + err = c.Send(request, response) + return +} + +// CreateDDoSGeoIPBlockConfig +// 添加DDoS防护的区域封禁配置 +// +// 可能返回的错误码: +// LIMITEXCEEDED = "LimitExceeded" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateDDoSGeoIPBlockConfigWithContext(ctx context.Context, request *CreateDDoSGeoIPBlockConfigRequest) (response *CreateDDoSGeoIPBlockConfigResponse, err error) { + if request == nil { + request = NewCreateDDoSGeoIPBlockConfigRequest() + } + request.SetContext(ctx) + + response = NewCreateDDoSGeoIPBlockConfigResponse() + err = c.Send(request, response) + return +} + +func NewCreateDDoSSpeedLimitConfigRequest() (request *CreateDDoSSpeedLimitConfigRequest) { + request = &CreateDDoSSpeedLimitConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "CreateDDoSSpeedLimitConfig") + + + return +} + +func NewCreateDDoSSpeedLimitConfigResponse() (response *CreateDDoSSpeedLimitConfigResponse) { + response = &CreateDDoSSpeedLimitConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreateDDoSSpeedLimitConfig +// 添加DDoS防护的访问限速配置 +// +// 可能返回的错误码: +// LIMITEXCEEDED = "LimitExceeded" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateDDoSSpeedLimitConfig(request *CreateDDoSSpeedLimitConfigRequest) (response *CreateDDoSSpeedLimitConfigResponse, err error) { + if request == nil { + request = NewCreateDDoSSpeedLimitConfigRequest() + } + + response = NewCreateDDoSSpeedLimitConfigResponse() + err = c.Send(request, response) + return +} + +// CreateDDoSSpeedLimitConfig +// 添加DDoS防护的访问限速配置 +// +// 可能返回的错误码: +// LIMITEXCEEDED = "LimitExceeded" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateDDoSSpeedLimitConfigWithContext(ctx context.Context, request *CreateDDoSSpeedLimitConfigRequest) (response *CreateDDoSSpeedLimitConfigResponse, err error) { + if request == nil { + request = NewCreateDDoSSpeedLimitConfigRequest() + } + request.SetContext(ctx) + + response = NewCreateDDoSSpeedLimitConfigResponse() + err = c.Send(request, response) + return +} + +func NewCreateDefaultAlarmThresholdRequest() (request *CreateDefaultAlarmThresholdRequest) { + request = &CreateDefaultAlarmThresholdRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "CreateDefaultAlarmThreshold") + + + return +} + +func NewCreateDefaultAlarmThresholdResponse() (response *CreateDefaultAlarmThresholdResponse) { + response = &CreateDefaultAlarmThresholdResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreateDefaultAlarmThreshold +// 设置单IP默认告警阈值配置 +// +// 可能返回的错误码: +// RESOURCEINUSE = "ResourceInUse" +func (c *Client) CreateDefaultAlarmThreshold(request *CreateDefaultAlarmThresholdRequest) (response *CreateDefaultAlarmThresholdResponse, err error) { + if request == nil { + request = NewCreateDefaultAlarmThresholdRequest() + } + + response = NewCreateDefaultAlarmThresholdResponse() + err = c.Send(request, response) + return +} + +// CreateDefaultAlarmThreshold +// 设置单IP默认告警阈值配置 +// +// 可能返回的错误码: +// RESOURCEINUSE = "ResourceInUse" +func (c *Client) CreateDefaultAlarmThresholdWithContext(ctx context.Context, request *CreateDefaultAlarmThresholdRequest) (response *CreateDefaultAlarmThresholdResponse, err error) { + if request == nil { + request = NewCreateDefaultAlarmThresholdRequest() + } + request.SetContext(ctx) + + response = NewCreateDefaultAlarmThresholdResponse() + err = c.Send(request, response) + return +} + +func NewCreateIPAlarmThresholdConfigRequest() (request *CreateIPAlarmThresholdConfigRequest) { + request = &CreateIPAlarmThresholdConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "CreateIPAlarmThresholdConfig") + + + return +} + +func NewCreateIPAlarmThresholdConfigResponse() (response *CreateIPAlarmThresholdConfigResponse) { + response = &CreateIPAlarmThresholdConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreateIPAlarmThresholdConfig +// 设置单IP告警阈值配置 +// +// 可能返回的错误码: +// RESOURCEINUSE = "ResourceInUse" +func (c *Client) CreateIPAlarmThresholdConfig(request *CreateIPAlarmThresholdConfigRequest) (response *CreateIPAlarmThresholdConfigResponse, err error) { + if request == nil { + request = NewCreateIPAlarmThresholdConfigRequest() + } + + response = NewCreateIPAlarmThresholdConfigResponse() + err = c.Send(request, response) + return +} + +// CreateIPAlarmThresholdConfig +// 设置单IP告警阈值配置 +// +// 可能返回的错误码: +// RESOURCEINUSE = "ResourceInUse" +func (c *Client) CreateIPAlarmThresholdConfigWithContext(ctx context.Context, request *CreateIPAlarmThresholdConfigRequest) (response *CreateIPAlarmThresholdConfigResponse, err error) { + if request == nil { + request = NewCreateIPAlarmThresholdConfigRequest() + } + request.SetContext(ctx) + + response = NewCreateIPAlarmThresholdConfigResponse() + err = c.Send(request, response) + return +} + +func NewCreateL7RuleCertsRequest() (request *CreateL7RuleCertsRequest) { + request = &CreateL7RuleCertsRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "CreateL7RuleCerts") + + + return +} + +func NewCreateL7RuleCertsResponse() (response *CreateL7RuleCertsResponse) { + response = &CreateL7RuleCertsResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreateL7RuleCerts +// 批量配置L7转发规则的证书供SSL测调用 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNKNOWNPARAMETER = "UnknownParameter" +func (c *Client) CreateL7RuleCerts(request *CreateL7RuleCertsRequest) (response *CreateL7RuleCertsResponse, err error) { + if request == nil { + request = NewCreateL7RuleCertsRequest() + } + + response = NewCreateL7RuleCertsResponse() + err = c.Send(request, response) + return +} + +// CreateL7RuleCerts +// 批量配置L7转发规则的证书供SSL测调用 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNKNOWNPARAMETER = "UnknownParameter" +func (c *Client) CreateL7RuleCertsWithContext(ctx context.Context, request *CreateL7RuleCertsRequest) (response *CreateL7RuleCertsResponse, err error) { + if request == nil { + request = NewCreateL7RuleCertsRequest() + } + request.SetContext(ctx) + + response = NewCreateL7RuleCertsResponse() + err = c.Send(request, response) + return +} + +func NewCreatePacketFilterConfigRequest() (request *CreatePacketFilterConfigRequest) { + request = &CreatePacketFilterConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "CreatePacketFilterConfig") + + + return +} + +func NewCreatePacketFilterConfigResponse() (response *CreatePacketFilterConfigResponse) { + response = &CreatePacketFilterConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreatePacketFilterConfig +// 添加DDoS防护的特征过滤规则 +// +// 可能返回的错误码: +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreatePacketFilterConfig(request *CreatePacketFilterConfigRequest) (response *CreatePacketFilterConfigResponse, err error) { + if request == nil { + request = NewCreatePacketFilterConfigRequest() + } + + response = NewCreatePacketFilterConfigResponse() + err = c.Send(request, response) + return +} + +// CreatePacketFilterConfig +// 添加DDoS防护的特征过滤规则 +// +// 可能返回的错误码: +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreatePacketFilterConfigWithContext(ctx context.Context, request *CreatePacketFilterConfigRequest) (response *CreatePacketFilterConfigResponse, err error) { + if request == nil { + request = NewCreatePacketFilterConfigRequest() + } + request.SetContext(ctx) + + response = NewCreatePacketFilterConfigResponse() + err = c.Send(request, response) + return +} + +func NewCreatePortAclConfigRequest() (request *CreatePortAclConfigRequest) { + request = &CreatePortAclConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "CreatePortAclConfig") + + + return +} + +func NewCreatePortAclConfigResponse() (response *CreatePortAclConfigResponse) { + response = &CreatePortAclConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreatePortAclConfig +// 添加DDoS防护的端口acl策略 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreatePortAclConfig(request *CreatePortAclConfigRequest) (response *CreatePortAclConfigResponse, err error) { + if request == nil { + request = NewCreatePortAclConfigRequest() + } + + response = NewCreatePortAclConfigResponse() + err = c.Send(request, response) + return +} + +// CreatePortAclConfig +// 添加DDoS防护的端口acl策略 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreatePortAclConfigWithContext(ctx context.Context, request *CreatePortAclConfigRequest) (response *CreatePortAclConfigResponse, err error) { + if request == nil { + request = NewCreatePortAclConfigRequest() + } + request.SetContext(ctx) + + response = NewCreatePortAclConfigResponse() + err = c.Send(request, response) + return +} + +func NewCreatePortAclConfigListRequest() (request *CreatePortAclConfigListRequest) { + request = &CreatePortAclConfigListRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "CreatePortAclConfigList") + + + return +} + +func NewCreatePortAclConfigListResponse() (response *CreatePortAclConfigListResponse) { + response = &CreatePortAclConfigListResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreatePortAclConfigList +// 批量添加DDoS防护的端口acl策略 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreatePortAclConfigList(request *CreatePortAclConfigListRequest) (response *CreatePortAclConfigListResponse, err error) { + if request == nil { + request = NewCreatePortAclConfigListRequest() + } + + response = NewCreatePortAclConfigListResponse() + err = c.Send(request, response) + return +} + +// CreatePortAclConfigList +// 批量添加DDoS防护的端口acl策略 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreatePortAclConfigListWithContext(ctx context.Context, request *CreatePortAclConfigListRequest) (response *CreatePortAclConfigListResponse, err error) { + if request == nil { + request = NewCreatePortAclConfigListRequest() + } + request.SetContext(ctx) + + response = NewCreatePortAclConfigListResponse() + err = c.Send(request, response) + return +} + +func NewCreateProtocolBlockConfigRequest() (request *CreateProtocolBlockConfigRequest) { + request = &CreateProtocolBlockConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "CreateProtocolBlockConfig") + + + return +} + +func NewCreateProtocolBlockConfigResponse() (response *CreateProtocolBlockConfigResponse) { + response = &CreateProtocolBlockConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreateProtocolBlockConfig +// 设置DDoS防护的协议封禁配置 +// +// 可能返回的错误码: +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateProtocolBlockConfig(request *CreateProtocolBlockConfigRequest) (response *CreateProtocolBlockConfigResponse, err error) { + if request == nil { + request = NewCreateProtocolBlockConfigRequest() + } + + response = NewCreateProtocolBlockConfigResponse() + err = c.Send(request, response) + return +} + +// CreateProtocolBlockConfig +// 设置DDoS防护的协议封禁配置 +// +// 可能返回的错误码: +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateProtocolBlockConfigWithContext(ctx context.Context, request *CreateProtocolBlockConfigRequest) (response *CreateProtocolBlockConfigResponse, err error) { + if request == nil { + request = NewCreateProtocolBlockConfigRequest() + } + request.SetContext(ctx) + + response = NewCreateProtocolBlockConfigResponse() + err = c.Send(request, response) + return +} + +func NewCreateSchedulingDomainRequest() (request *CreateSchedulingDomainRequest) { + request = &CreateSchedulingDomainRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "CreateSchedulingDomain") + + + return +} + +func NewCreateSchedulingDomainResponse() (response *CreateSchedulingDomainResponse) { + response = &CreateSchedulingDomainResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreateSchedulingDomain +// 创建一个域名,可用于在封堵时调度切换IP +// +// 可能返回的错误码: +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +func (c *Client) CreateSchedulingDomain(request *CreateSchedulingDomainRequest) (response *CreateSchedulingDomainResponse, err error) { + if request == nil { + request = NewCreateSchedulingDomainRequest() + } + + response = NewCreateSchedulingDomainResponse() + err = c.Send(request, response) + return +} + +// CreateSchedulingDomain +// 创建一个域名,可用于在封堵时调度切换IP +// +// 可能返回的错误码: +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +func (c *Client) CreateSchedulingDomainWithContext(ctx context.Context, request *CreateSchedulingDomainRequest) (response *CreateSchedulingDomainResponse, err error) { + if request == nil { + request = NewCreateSchedulingDomainRequest() + } + request.SetContext(ctx) + + response = NewCreateSchedulingDomainResponse() + err = c.Send(request, response) + return +} + +func NewCreateWaterPrintConfigRequest() (request *CreateWaterPrintConfigRequest) { + request = &CreateWaterPrintConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "CreateWaterPrintConfig") + + + return +} + +func NewCreateWaterPrintConfigResponse() (response *CreateWaterPrintConfigResponse) { + response = &CreateWaterPrintConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreateWaterPrintConfig +// 添加DDoS防护的水印防护配置 +// +// 可能返回的错误码: +// LIMITEXCEEDED = "LimitExceeded" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateWaterPrintConfig(request *CreateWaterPrintConfigRequest) (response *CreateWaterPrintConfigResponse, err error) { + if request == nil { + request = NewCreateWaterPrintConfigRequest() + } + + response = NewCreateWaterPrintConfigResponse() + err = c.Send(request, response) + return +} + +// CreateWaterPrintConfig +// 添加DDoS防护的水印防护配置 +// +// 可能返回的错误码: +// LIMITEXCEEDED = "LimitExceeded" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateWaterPrintConfigWithContext(ctx context.Context, request *CreateWaterPrintConfigRequest) (response *CreateWaterPrintConfigResponse, err error) { + if request == nil { + request = NewCreateWaterPrintConfigRequest() + } + request.SetContext(ctx) + + response = NewCreateWaterPrintConfigResponse() + err = c.Send(request, response) + return +} + +func NewCreateWaterPrintKeyRequest() (request *CreateWaterPrintKeyRequest) { + request = &CreateWaterPrintKeyRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "CreateWaterPrintKey") + + + return +} + +func NewCreateWaterPrintKeyResponse() (response *CreateWaterPrintKeyResponse) { + response = &CreateWaterPrintKeyResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// CreateWaterPrintKey +// 添加DDoS防护的水印防护密钥 +// +// 可能返回的错误码: +// LIMITEXCEEDED = "LimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateWaterPrintKey(request *CreateWaterPrintKeyRequest) (response *CreateWaterPrintKeyResponse, err error) { + if request == nil { + request = NewCreateWaterPrintKeyRequest() + } + + response = NewCreateWaterPrintKeyResponse() + err = c.Send(request, response) + return +} + +// CreateWaterPrintKey +// 添加DDoS防护的水印防护密钥 +// +// 可能返回的错误码: +// LIMITEXCEEDED = "LimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateWaterPrintKeyWithContext(ctx context.Context, request *CreateWaterPrintKeyRequest) (response *CreateWaterPrintKeyResponse, err error) { + if request == nil { + request = NewCreateWaterPrintKeyRequest() + } + request.SetContext(ctx) + + response = NewCreateWaterPrintKeyResponse() + err = c.Send(request, response) + return +} + +func NewDeleteBlackWhiteIpListRequest() (request *DeleteBlackWhiteIpListRequest) { + request = &DeleteBlackWhiteIpListRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DeleteBlackWhiteIpList") + + + return +} + +func NewDeleteBlackWhiteIpListResponse() (response *DeleteBlackWhiteIpListResponse) { + response = &DeleteBlackWhiteIpListResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DeleteBlackWhiteIpList +// 删除DDoS防护的IP黑白名单 +// +// 可能返回的错误码: +// RESOURCEINUSE = "ResourceInUse" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteBlackWhiteIpList(request *DeleteBlackWhiteIpListRequest) (response *DeleteBlackWhiteIpListResponse, err error) { + if request == nil { + request = NewDeleteBlackWhiteIpListRequest() + } + + response = NewDeleteBlackWhiteIpListResponse() + err = c.Send(request, response) + return +} + +// DeleteBlackWhiteIpList +// 删除DDoS防护的IP黑白名单 +// +// 可能返回的错误码: +// RESOURCEINUSE = "ResourceInUse" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteBlackWhiteIpListWithContext(ctx context.Context, request *DeleteBlackWhiteIpListRequest) (response *DeleteBlackWhiteIpListResponse, err error) { + if request == nil { + request = NewDeleteBlackWhiteIpListRequest() + } + request.SetContext(ctx) + + response = NewDeleteBlackWhiteIpListResponse() + err = c.Send(request, response) + return +} + +func NewDeleteDDoSBlackWhiteIpListRequest() (request *DeleteDDoSBlackWhiteIpListRequest) { + request = &DeleteDDoSBlackWhiteIpListRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DeleteDDoSBlackWhiteIpList") + + + return +} + +func NewDeleteDDoSBlackWhiteIpListResponse() (response *DeleteDDoSBlackWhiteIpListResponse) { + response = &DeleteDDoSBlackWhiteIpListResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DeleteDDoSBlackWhiteIpList +// 删除DDoS防护的IP网段黑白名单 +// +// 可能返回的错误码: +// RESOURCEINUSE = "ResourceInUse" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteDDoSBlackWhiteIpList(request *DeleteDDoSBlackWhiteIpListRequest) (response *DeleteDDoSBlackWhiteIpListResponse, err error) { + if request == nil { + request = NewDeleteDDoSBlackWhiteIpListRequest() + } + + response = NewDeleteDDoSBlackWhiteIpListResponse() + err = c.Send(request, response) + return +} + +// DeleteDDoSBlackWhiteIpList +// 删除DDoS防护的IP网段黑白名单 +// +// 可能返回的错误码: +// RESOURCEINUSE = "ResourceInUse" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteDDoSBlackWhiteIpListWithContext(ctx context.Context, request *DeleteDDoSBlackWhiteIpListRequest) (response *DeleteDDoSBlackWhiteIpListResponse, err error) { + if request == nil { + request = NewDeleteDDoSBlackWhiteIpListRequest() + } + request.SetContext(ctx) + + response = NewDeleteDDoSBlackWhiteIpListResponse() + err = c.Send(request, response) + return +} + +func NewDeleteDDoSGeoIPBlockConfigRequest() (request *DeleteDDoSGeoIPBlockConfigRequest) { + request = &DeleteDDoSGeoIPBlockConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DeleteDDoSGeoIPBlockConfig") + + + return +} + +func NewDeleteDDoSGeoIPBlockConfigResponse() (response *DeleteDDoSGeoIPBlockConfigResponse) { + response = &DeleteDDoSGeoIPBlockConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DeleteDDoSGeoIPBlockConfig +// 删除DDoS防护的区域封禁配置 +// +// 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteDDoSGeoIPBlockConfig(request *DeleteDDoSGeoIPBlockConfigRequest) (response *DeleteDDoSGeoIPBlockConfigResponse, err error) { + if request == nil { + request = NewDeleteDDoSGeoIPBlockConfigRequest() + } + + response = NewDeleteDDoSGeoIPBlockConfigResponse() + err = c.Send(request, response) + return +} + +// DeleteDDoSGeoIPBlockConfig +// 删除DDoS防护的区域封禁配置 +// +// 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteDDoSGeoIPBlockConfigWithContext(ctx context.Context, request *DeleteDDoSGeoIPBlockConfigRequest) (response *DeleteDDoSGeoIPBlockConfigResponse, err error) { + if request == nil { + request = NewDeleteDDoSGeoIPBlockConfigRequest() + } + request.SetContext(ctx) + + response = NewDeleteDDoSGeoIPBlockConfigResponse() + err = c.Send(request, response) + return +} + +func NewDeleteDDoSSpeedLimitConfigRequest() (request *DeleteDDoSSpeedLimitConfigRequest) { + request = &DeleteDDoSSpeedLimitConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DeleteDDoSSpeedLimitConfig") + + + return +} + +func NewDeleteDDoSSpeedLimitConfigResponse() (response *DeleteDDoSSpeedLimitConfigResponse) { + response = &DeleteDDoSSpeedLimitConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DeleteDDoSSpeedLimitConfig +// 删除DDoS防护的访问限速配置 +// +// 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteDDoSSpeedLimitConfig(request *DeleteDDoSSpeedLimitConfigRequest) (response *DeleteDDoSSpeedLimitConfigResponse, err error) { + if request == nil { + request = NewDeleteDDoSSpeedLimitConfigRequest() + } + + response = NewDeleteDDoSSpeedLimitConfigResponse() + err = c.Send(request, response) + return +} + +// DeleteDDoSSpeedLimitConfig +// 删除DDoS防护的访问限速配置 +// +// 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteDDoSSpeedLimitConfigWithContext(ctx context.Context, request *DeleteDDoSSpeedLimitConfigRequest) (response *DeleteDDoSSpeedLimitConfigResponse, err error) { + if request == nil { + request = NewDeleteDDoSSpeedLimitConfigRequest() + } + request.SetContext(ctx) + + response = NewDeleteDDoSSpeedLimitConfigResponse() + err = c.Send(request, response) + return +} + +func NewDeletePacketFilterConfigRequest() (request *DeletePacketFilterConfigRequest) { + request = &DeletePacketFilterConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DeletePacketFilterConfig") + + + return +} + +func NewDeletePacketFilterConfigResponse() (response *DeletePacketFilterConfigResponse) { + response = &DeletePacketFilterConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DeletePacketFilterConfig +// 删除DDoS防护的特征过滤规则 +// +// 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeletePacketFilterConfig(request *DeletePacketFilterConfigRequest) (response *DeletePacketFilterConfigResponse, err error) { + if request == nil { + request = NewDeletePacketFilterConfigRequest() + } + + response = NewDeletePacketFilterConfigResponse() + err = c.Send(request, response) + return +} + +// DeletePacketFilterConfig +// 删除DDoS防护的特征过滤规则 +// +// 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeletePacketFilterConfigWithContext(ctx context.Context, request *DeletePacketFilterConfigRequest) (response *DeletePacketFilterConfigResponse, err error) { + if request == nil { + request = NewDeletePacketFilterConfigRequest() + } + request.SetContext(ctx) + + response = NewDeletePacketFilterConfigResponse() + err = c.Send(request, response) + return +} + +func NewDeleteWaterPrintConfigRequest() (request *DeleteWaterPrintConfigRequest) { + request = &DeleteWaterPrintConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DeleteWaterPrintConfig") + + + return +} + +func NewDeleteWaterPrintConfigResponse() (response *DeleteWaterPrintConfigResponse) { + response = &DeleteWaterPrintConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DeleteWaterPrintConfig +// 删除DDoS防护的水印防护配置 +// +// 可能返回的错误码: +// RESOURCEINUSE = "ResourceInUse" +func (c *Client) DeleteWaterPrintConfig(request *DeleteWaterPrintConfigRequest) (response *DeleteWaterPrintConfigResponse, err error) { + if request == nil { + request = NewDeleteWaterPrintConfigRequest() + } + + response = NewDeleteWaterPrintConfigResponse() + err = c.Send(request, response) + return +} + +// DeleteWaterPrintConfig +// 删除DDoS防护的水印防护配置 +// +// 可能返回的错误码: +// RESOURCEINUSE = "ResourceInUse" +func (c *Client) DeleteWaterPrintConfigWithContext(ctx context.Context, request *DeleteWaterPrintConfigRequest) (response *DeleteWaterPrintConfigResponse, err error) { + if request == nil { + request = NewDeleteWaterPrintConfigRequest() + } + request.SetContext(ctx) + + response = NewDeleteWaterPrintConfigResponse() + err = c.Send(request, response) + return +} + +func NewDeleteWaterPrintKeyRequest() (request *DeleteWaterPrintKeyRequest) { + request = &DeleteWaterPrintKeyRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DeleteWaterPrintKey") + + + return +} + +func NewDeleteWaterPrintKeyResponse() (response *DeleteWaterPrintKeyResponse) { + response = &DeleteWaterPrintKeyResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DeleteWaterPrintKey +// 删除DDoS防护的水印防护密钥 +// +// 可能返回的错误码: +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DeleteWaterPrintKey(request *DeleteWaterPrintKeyRequest) (response *DeleteWaterPrintKeyResponse, err error) { + if request == nil { + request = NewDeleteWaterPrintKeyRequest() + } + + response = NewDeleteWaterPrintKeyResponse() + err = c.Send(request, response) + return +} + +// DeleteWaterPrintKey +// 删除DDoS防护的水印防护密钥 +// +// 可能返回的错误码: +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DeleteWaterPrintKeyWithContext(ctx context.Context, request *DeleteWaterPrintKeyRequest) (response *DeleteWaterPrintKeyResponse, err error) { + if request == nil { + request = NewDeleteWaterPrintKeyRequest() + } + request.SetContext(ctx) + + response = NewDeleteWaterPrintKeyResponse() + err = c.Send(request, response) + return +} + +func NewDescribeBasicDeviceStatusRequest() (request *DescribeBasicDeviceStatusRequest) { + request = &DescribeBasicDeviceStatusRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeBasicDeviceStatus") + + + return +} + +func NewDescribeBasicDeviceStatusResponse() (response *DescribeBasicDeviceStatusResponse) { + response = &DescribeBasicDeviceStatusResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeBasicDeviceStatus +// 获取基础防护攻击状态 +// +// 可能返回的错误码: +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeBasicDeviceStatus(request *DescribeBasicDeviceStatusRequest) (response *DescribeBasicDeviceStatusResponse, err error) { + if request == nil { + request = NewDescribeBasicDeviceStatusRequest() + } + + response = NewDescribeBasicDeviceStatusResponse() + err = c.Send(request, response) + return +} + +// DescribeBasicDeviceStatus +// 获取基础防护攻击状态 +// +// 可能返回的错误码: +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeBasicDeviceStatusWithContext(ctx context.Context, request *DescribeBasicDeviceStatusRequest) (response *DescribeBasicDeviceStatusResponse, err error) { + if request == nil { + request = NewDescribeBasicDeviceStatusRequest() + } + request.SetContext(ctx) + + response = NewDescribeBasicDeviceStatusResponse() + err = c.Send(request, response) + return +} + +func NewDescribeBizTrendRequest() (request *DescribeBizTrendRequest) { + request = &DescribeBizTrendRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeBizTrend") + + + return +} + +func NewDescribeBizTrendResponse() (response *DescribeBizTrendResponse) { + response = &DescribeBizTrendResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeBizTrend +// 获取业务流量曲线 +// +// 可能返回的错误码: +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +func (c *Client) DescribeBizTrend(request *DescribeBizTrendRequest) (response *DescribeBizTrendResponse, err error) { + if request == nil { + request = NewDescribeBizTrendRequest() + } + + response = NewDescribeBizTrendResponse() + err = c.Send(request, response) + return +} + +// DescribeBizTrend +// 获取业务流量曲线 +// +// 可能返回的错误码: +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +func (c *Client) DescribeBizTrendWithContext(ctx context.Context, request *DescribeBizTrendRequest) (response *DescribeBizTrendResponse, err error) { + if request == nil { + request = NewDescribeBizTrendRequest() + } + request.SetContext(ctx) + + response = NewDescribeBizTrendResponse() + err = c.Send(request, response) + return +} + +func NewDescribeBlackWhiteIpListRequest() (request *DescribeBlackWhiteIpListRequest) { + request = &DescribeBlackWhiteIpListRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeBlackWhiteIpList") + + + return +} + +func NewDescribeBlackWhiteIpListResponse() (response *DescribeBlackWhiteIpListResponse) { + response = &DescribeBlackWhiteIpListResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeBlackWhiteIpList +// 获取DDoS防护的IP黑白名单 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeBlackWhiteIpList(request *DescribeBlackWhiteIpListRequest) (response *DescribeBlackWhiteIpListResponse, err error) { + if request == nil { + request = NewDescribeBlackWhiteIpListRequest() + } + + response = NewDescribeBlackWhiteIpListResponse() + err = c.Send(request, response) + return +} + +// DescribeBlackWhiteIpList +// 获取DDoS防护的IP黑白名单 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeBlackWhiteIpListWithContext(ctx context.Context, request *DescribeBlackWhiteIpListRequest) (response *DescribeBlackWhiteIpListResponse, err error) { + if request == nil { + request = NewDescribeBlackWhiteIpListRequest() + } + request.SetContext(ctx) + + response = NewDescribeBlackWhiteIpListResponse() + err = c.Send(request, response) + return +} + +func NewDescribeCCTrendRequest() (request *DescribeCCTrendRequest) { + request = &DescribeCCTrendRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeCCTrend") + + + return +} + +func NewDescribeCCTrendResponse() (response *DescribeCCTrendResponse) { + response = &DescribeCCTrendResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeCCTrend +// 获取CC攻击指标数据,包括总请求峰值(QPS)和攻击请求(QPS)以及总请求次数和攻击请求次数 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeCCTrend(request *DescribeCCTrendRequest) (response *DescribeCCTrendResponse, err error) { + if request == nil { + request = NewDescribeCCTrendRequest() + } + + response = NewDescribeCCTrendResponse() + err = c.Send(request, response) + return +} + +// DescribeCCTrend +// 获取CC攻击指标数据,包括总请求峰值(QPS)和攻击请求(QPS)以及总请求次数和攻击请求次数 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeCCTrendWithContext(ctx context.Context, request *DescribeCCTrendRequest) (response *DescribeCCTrendResponse, err error) { + if request == nil { + request = NewDescribeCCTrendRequest() + } + request.SetContext(ctx) + + response = NewDescribeCCTrendResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDDoSBlackWhiteIpListRequest() (request *DescribeDDoSBlackWhiteIpListRequest) { + request = &DescribeDDoSBlackWhiteIpListRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeDDoSBlackWhiteIpList") + + + return +} + +func NewDescribeDDoSBlackWhiteIpListResponse() (response *DescribeDDoSBlackWhiteIpListResponse) { + response = &DescribeDDoSBlackWhiteIpListResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeDDoSBlackWhiteIpList +// 获取DDoS防护的IP网段黑白名单 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeDDoSBlackWhiteIpList(request *DescribeDDoSBlackWhiteIpListRequest) (response *DescribeDDoSBlackWhiteIpListResponse, err error) { + if request == nil { + request = NewDescribeDDoSBlackWhiteIpListRequest() + } + + response = NewDescribeDDoSBlackWhiteIpListResponse() + err = c.Send(request, response) + return +} + +// DescribeDDoSBlackWhiteIpList +// 获取DDoS防护的IP网段黑白名单 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeDDoSBlackWhiteIpListWithContext(ctx context.Context, request *DescribeDDoSBlackWhiteIpListRequest) (response *DescribeDDoSBlackWhiteIpListResponse, err error) { + if request == nil { + request = NewDescribeDDoSBlackWhiteIpListRequest() + } + request.SetContext(ctx) + + response = NewDescribeDDoSBlackWhiteIpListResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDDoSConnectLimitListRequest() (request *DescribeDDoSConnectLimitListRequest) { + request = &DescribeDDoSConnectLimitListRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeDDoSConnectLimitList") + + + return +} + +func NewDescribeDDoSConnectLimitListResponse() (response *DescribeDDoSConnectLimitListResponse) { + response = &DescribeDDoSConnectLimitListResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeDDoSConnectLimitList +// 获取DDoS连接抑制配置列表 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeDDoSConnectLimitList(request *DescribeDDoSConnectLimitListRequest) (response *DescribeDDoSConnectLimitListResponse, err error) { + if request == nil { + request = NewDescribeDDoSConnectLimitListRequest() + } + + response = NewDescribeDDoSConnectLimitListResponse() + err = c.Send(request, response) + return +} + +// DescribeDDoSConnectLimitList +// 获取DDoS连接抑制配置列表 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeDDoSConnectLimitListWithContext(ctx context.Context, request *DescribeDDoSConnectLimitListRequest) (response *DescribeDDoSConnectLimitListResponse, err error) { + if request == nil { + request = NewDescribeDDoSConnectLimitListRequest() + } + request.SetContext(ctx) + + response = NewDescribeDDoSConnectLimitListResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDDoSTrendRequest() (request *DescribeDDoSTrendRequest) { + request = &DescribeDDoSTrendRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeDDoSTrend") + + + return +} + +func NewDescribeDDoSTrendResponse() (response *DescribeDDoSTrendResponse) { + response = &DescribeDDoSTrendResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeDDoSTrend +// 获取DDoS攻击流量带宽和攻击包速率数据 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeDDoSTrend(request *DescribeDDoSTrendRequest) (response *DescribeDDoSTrendResponse, err error) { + if request == nil { + request = NewDescribeDDoSTrendRequest() + } + + response = NewDescribeDDoSTrendResponse() + err = c.Send(request, response) + return +} + +// DescribeDDoSTrend +// 获取DDoS攻击流量带宽和攻击包速率数据 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeDDoSTrendWithContext(ctx context.Context, request *DescribeDDoSTrendRequest) (response *DescribeDDoSTrendResponse, err error) { + if request == nil { + request = NewDescribeDDoSTrendRequest() + } + request.SetContext(ctx) + + response = NewDescribeDDoSTrendResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDefaultAlarmThresholdRequest() (request *DescribeDefaultAlarmThresholdRequest) { + request = &DescribeDefaultAlarmThresholdRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeDefaultAlarmThreshold") + + + return +} + +func NewDescribeDefaultAlarmThresholdResponse() (response *DescribeDefaultAlarmThresholdResponse) { + response = &DescribeDefaultAlarmThresholdResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeDefaultAlarmThreshold +// 获取单IP默认告警阈值配置 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeDefaultAlarmThreshold(request *DescribeDefaultAlarmThresholdRequest) (response *DescribeDefaultAlarmThresholdResponse, err error) { + if request == nil { + request = NewDescribeDefaultAlarmThresholdRequest() + } + + response = NewDescribeDefaultAlarmThresholdResponse() + err = c.Send(request, response) + return +} + +// DescribeDefaultAlarmThreshold +// 获取单IP默认告警阈值配置 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeDefaultAlarmThresholdWithContext(ctx context.Context, request *DescribeDefaultAlarmThresholdRequest) (response *DescribeDefaultAlarmThresholdResponse, err error) { + if request == nil { + request = NewDescribeDefaultAlarmThresholdRequest() + } + request.SetContext(ctx) + + response = NewDescribeDefaultAlarmThresholdResponse() + err = c.Send(request, response) + return +} + +func NewDescribeL7RulesBySSLCertIdRequest() (request *DescribeL7RulesBySSLCertIdRequest) { + request = &DescribeL7RulesBySSLCertIdRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeL7RulesBySSLCertId") + + + return +} + +func NewDescribeL7RulesBySSLCertIdResponse() (response *DescribeL7RulesBySSLCertIdResponse) { + response = &DescribeL7RulesBySSLCertIdResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeL7RulesBySSLCertId +// 查询与证书ID对于域名匹配的七层规则 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeL7RulesBySSLCertId(request *DescribeL7RulesBySSLCertIdRequest) (response *DescribeL7RulesBySSLCertIdResponse, err error) { + if request == nil { + request = NewDescribeL7RulesBySSLCertIdRequest() + } + + response = NewDescribeL7RulesBySSLCertIdResponse() + err = c.Send(request, response) + return +} + +// DescribeL7RulesBySSLCertId +// 查询与证书ID对于域名匹配的七层规则 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeL7RulesBySSLCertIdWithContext(ctx context.Context, request *DescribeL7RulesBySSLCertIdRequest) (response *DescribeL7RulesBySSLCertIdResponse, err error) { + if request == nil { + request = NewDescribeL7RulesBySSLCertIdRequest() + } + request.SetContext(ctx) + + response = NewDescribeL7RulesBySSLCertIdResponse() + err = c.Send(request, response) + return +} + +func NewDescribeListBGPIPInstancesRequest() (request *DescribeListBGPIPInstancesRequest) { + request = &DescribeListBGPIPInstancesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeListBGPIPInstances") + + + return +} + +func NewDescribeListBGPIPInstancesResponse() (response *DescribeListBGPIPInstancesResponse) { + response = &DescribeListBGPIPInstancesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeListBGPIPInstances +// 获取高防IP资产实例列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListBGPIPInstances(request *DescribeListBGPIPInstancesRequest) (response *DescribeListBGPIPInstancesResponse, err error) { + if request == nil { + request = NewDescribeListBGPIPInstancesRequest() + } + + response = NewDescribeListBGPIPInstancesResponse() + err = c.Send(request, response) + return +} + +// DescribeListBGPIPInstances +// 获取高防IP资产实例列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListBGPIPInstancesWithContext(ctx context.Context, request *DescribeListBGPIPInstancesRequest) (response *DescribeListBGPIPInstancesResponse, err error) { + if request == nil { + request = NewDescribeListBGPIPInstancesRequest() + } + request.SetContext(ctx) + + response = NewDescribeListBGPIPInstancesResponse() + err = c.Send(request, response) + return +} + +func NewDescribeListBGPInstancesRequest() (request *DescribeListBGPInstancesRequest) { + request = &DescribeListBGPInstancesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeListBGPInstances") + + + return +} + +func NewDescribeListBGPInstancesResponse() (response *DescribeListBGPInstancesResponse) { + response = &DescribeListBGPInstancesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeListBGPInstances +// 获取高防包资产实例列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListBGPInstances(request *DescribeListBGPInstancesRequest) (response *DescribeListBGPInstancesResponse, err error) { + if request == nil { + request = NewDescribeListBGPInstancesRequest() + } + + response = NewDescribeListBGPInstancesResponse() + err = c.Send(request, response) + return +} + +// DescribeListBGPInstances +// 获取高防包资产实例列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListBGPInstancesWithContext(ctx context.Context, request *DescribeListBGPInstancesRequest) (response *DescribeListBGPInstancesResponse, err error) { + if request == nil { + request = NewDescribeListBGPInstancesRequest() + } + request.SetContext(ctx) + + response = NewDescribeListBGPInstancesResponse() + err = c.Send(request, response) + return +} + +func NewDescribeListBlackWhiteIpListRequest() (request *DescribeListBlackWhiteIpListRequest) { + request = &DescribeListBlackWhiteIpListRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeListBlackWhiteIpList") + + + return +} + +func NewDescribeListBlackWhiteIpListResponse() (response *DescribeListBlackWhiteIpListResponse) { + response = &DescribeListBlackWhiteIpListResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeListBlackWhiteIpList +// 获取DDoS防护的IP黑白名单列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListBlackWhiteIpList(request *DescribeListBlackWhiteIpListRequest) (response *DescribeListBlackWhiteIpListResponse, err error) { + if request == nil { + request = NewDescribeListBlackWhiteIpListRequest() + } + + response = NewDescribeListBlackWhiteIpListResponse() + err = c.Send(request, response) + return +} + +// DescribeListBlackWhiteIpList +// 获取DDoS防护的IP黑白名单列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListBlackWhiteIpListWithContext(ctx context.Context, request *DescribeListBlackWhiteIpListRequest) (response *DescribeListBlackWhiteIpListResponse, err error) { + if request == nil { + request = NewDescribeListBlackWhiteIpListRequest() + } + request.SetContext(ctx) + + response = NewDescribeListBlackWhiteIpListResponse() + err = c.Send(request, response) + return +} + +func NewDescribeListDDoSAIRequest() (request *DescribeListDDoSAIRequest) { + request = &DescribeListDDoSAIRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeListDDoSAI") + + + return +} + +func NewDescribeListDDoSAIResponse() (response *DescribeListDDoSAIResponse) { + response = &DescribeListDDoSAIResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeListDDoSAI +// 获取DDoS防护的AI防护开关列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListDDoSAI(request *DescribeListDDoSAIRequest) (response *DescribeListDDoSAIResponse, err error) { + if request == nil { + request = NewDescribeListDDoSAIRequest() + } + + response = NewDescribeListDDoSAIResponse() + err = c.Send(request, response) + return +} + +// DescribeListDDoSAI +// 获取DDoS防护的AI防护开关列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListDDoSAIWithContext(ctx context.Context, request *DescribeListDDoSAIRequest) (response *DescribeListDDoSAIResponse, err error) { + if request == nil { + request = NewDescribeListDDoSAIRequest() + } + request.SetContext(ctx) + + response = NewDescribeListDDoSAIResponse() + err = c.Send(request, response) + return +} + +func NewDescribeListDDoSGeoIPBlockConfigRequest() (request *DescribeListDDoSGeoIPBlockConfigRequest) { + request = &DescribeListDDoSGeoIPBlockConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeListDDoSGeoIPBlockConfig") + + + return +} + +func NewDescribeListDDoSGeoIPBlockConfigResponse() (response *DescribeListDDoSGeoIPBlockConfigResponse) { + response = &DescribeListDDoSGeoIPBlockConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeListDDoSGeoIPBlockConfig +// 获取DDoS防护的区域封禁配置列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListDDoSGeoIPBlockConfig(request *DescribeListDDoSGeoIPBlockConfigRequest) (response *DescribeListDDoSGeoIPBlockConfigResponse, err error) { + if request == nil { + request = NewDescribeListDDoSGeoIPBlockConfigRequest() + } + + response = NewDescribeListDDoSGeoIPBlockConfigResponse() + err = c.Send(request, response) + return +} + +// DescribeListDDoSGeoIPBlockConfig +// 获取DDoS防护的区域封禁配置列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListDDoSGeoIPBlockConfigWithContext(ctx context.Context, request *DescribeListDDoSGeoIPBlockConfigRequest) (response *DescribeListDDoSGeoIPBlockConfigResponse, err error) { + if request == nil { + request = NewDescribeListDDoSGeoIPBlockConfigRequest() + } + request.SetContext(ctx) + + response = NewDescribeListDDoSGeoIPBlockConfigResponse() + err = c.Send(request, response) + return +} + +func NewDescribeListDDoSSpeedLimitConfigRequest() (request *DescribeListDDoSSpeedLimitConfigRequest) { + request = &DescribeListDDoSSpeedLimitConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeListDDoSSpeedLimitConfig") + + + return +} + +func NewDescribeListDDoSSpeedLimitConfigResponse() (response *DescribeListDDoSSpeedLimitConfigResponse) { + response = &DescribeListDDoSSpeedLimitConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeListDDoSSpeedLimitConfig +// 获取DDoS防护的访问限速配置列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListDDoSSpeedLimitConfig(request *DescribeListDDoSSpeedLimitConfigRequest) (response *DescribeListDDoSSpeedLimitConfigResponse, err error) { + if request == nil { + request = NewDescribeListDDoSSpeedLimitConfigRequest() + } + + response = NewDescribeListDDoSSpeedLimitConfigResponse() + err = c.Send(request, response) + return +} + +// DescribeListDDoSSpeedLimitConfig +// 获取DDoS防护的访问限速配置列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListDDoSSpeedLimitConfigWithContext(ctx context.Context, request *DescribeListDDoSSpeedLimitConfigRequest) (response *DescribeListDDoSSpeedLimitConfigResponse, err error) { + if request == nil { + request = NewDescribeListDDoSSpeedLimitConfigRequest() + } + request.SetContext(ctx) + + response = NewDescribeListDDoSSpeedLimitConfigResponse() + err = c.Send(request, response) + return +} + +func NewDescribeListIPAlarmConfigRequest() (request *DescribeListIPAlarmConfigRequest) { + request = &DescribeListIPAlarmConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeListIPAlarmConfig") + + + return +} + +func NewDescribeListIPAlarmConfigResponse() (response *DescribeListIPAlarmConfigResponse) { + response = &DescribeListIPAlarmConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeListIPAlarmConfig +// 获取单IP告警阈值配置列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListIPAlarmConfig(request *DescribeListIPAlarmConfigRequest) (response *DescribeListIPAlarmConfigResponse, err error) { + if request == nil { + request = NewDescribeListIPAlarmConfigRequest() + } + + response = NewDescribeListIPAlarmConfigResponse() + err = c.Send(request, response) + return +} + +// DescribeListIPAlarmConfig +// 获取单IP告警阈值配置列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListIPAlarmConfigWithContext(ctx context.Context, request *DescribeListIPAlarmConfigRequest) (response *DescribeListIPAlarmConfigResponse, err error) { + if request == nil { + request = NewDescribeListIPAlarmConfigRequest() + } + request.SetContext(ctx) + + response = NewDescribeListIPAlarmConfigResponse() + err = c.Send(request, response) + return +} + +func NewDescribeListListenerRequest() (request *DescribeListListenerRequest) { + request = &DescribeListListenerRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeListListener") + + + return +} + +func NewDescribeListListenerResponse() (response *DescribeListListenerResponse) { + response = &DescribeListListenerResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeListListener +// 获取转发监听器列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListListener(request *DescribeListListenerRequest) (response *DescribeListListenerResponse, err error) { + if request == nil { + request = NewDescribeListListenerRequest() + } + + response = NewDescribeListListenerResponse() + err = c.Send(request, response) + return +} + +// DescribeListListener +// 获取转发监听器列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListListenerWithContext(ctx context.Context, request *DescribeListListenerRequest) (response *DescribeListListenerResponse, err error) { + if request == nil { + request = NewDescribeListListenerRequest() + } + request.SetContext(ctx) + + response = NewDescribeListListenerResponse() + err = c.Send(request, response) + return +} + +func NewDescribeListPacketFilterConfigRequest() (request *DescribeListPacketFilterConfigRequest) { + request = &DescribeListPacketFilterConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeListPacketFilterConfig") + + + return +} + +func NewDescribeListPacketFilterConfigResponse() (response *DescribeListPacketFilterConfigResponse) { + response = &DescribeListPacketFilterConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeListPacketFilterConfig +// 获取DDoS防护的特征过滤规则列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListPacketFilterConfig(request *DescribeListPacketFilterConfigRequest) (response *DescribeListPacketFilterConfigResponse, err error) { + if request == nil { + request = NewDescribeListPacketFilterConfigRequest() + } + + response = NewDescribeListPacketFilterConfigResponse() + err = c.Send(request, response) + return +} + +// DescribeListPacketFilterConfig +// 获取DDoS防护的特征过滤规则列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListPacketFilterConfigWithContext(ctx context.Context, request *DescribeListPacketFilterConfigRequest) (response *DescribeListPacketFilterConfigResponse, err error) { + if request == nil { + request = NewDescribeListPacketFilterConfigRequest() + } + request.SetContext(ctx) + + response = NewDescribeListPacketFilterConfigResponse() + err = c.Send(request, response) + return +} + +func NewDescribeListPortAclListRequest() (request *DescribeListPortAclListRequest) { + request = &DescribeListPortAclListRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeListPortAclList") + + + return +} + +func NewDescribeListPortAclListResponse() (response *DescribeListPortAclListResponse) { + response = &DescribeListPortAclListResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeListPortAclList +// 获取DDoS防护的端口acl策略列表 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListPortAclList(request *DescribeListPortAclListRequest) (response *DescribeListPortAclListResponse, err error) { + if request == nil { + request = NewDescribeListPortAclListRequest() + } + + response = NewDescribeListPortAclListResponse() + err = c.Send(request, response) + return +} + +// DescribeListPortAclList +// 获取DDoS防护的端口acl策略列表 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListPortAclListWithContext(ctx context.Context, request *DescribeListPortAclListRequest) (response *DescribeListPortAclListResponse, err error) { + if request == nil { + request = NewDescribeListPortAclListRequest() + } + request.SetContext(ctx) + + response = NewDescribeListPortAclListResponse() + err = c.Send(request, response) + return +} + +func NewDescribeListProtectThresholdConfigRequest() (request *DescribeListProtectThresholdConfigRequest) { + request = &DescribeListProtectThresholdConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeListProtectThresholdConfig") + + + return +} + +func NewDescribeListProtectThresholdConfigResponse() (response *DescribeListProtectThresholdConfigResponse) { + response = &DescribeListProtectThresholdConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeListProtectThresholdConfig +// 获取防护阈值配置列表,包括DDoS的AI、等级、CC阈值开关等 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListProtectThresholdConfig(request *DescribeListProtectThresholdConfigRequest) (response *DescribeListProtectThresholdConfigResponse, err error) { + if request == nil { + request = NewDescribeListProtectThresholdConfigRequest() + } + + response = NewDescribeListProtectThresholdConfigResponse() + err = c.Send(request, response) + return +} + +// DescribeListProtectThresholdConfig +// 获取防护阈值配置列表,包括DDoS的AI、等级、CC阈值开关等 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListProtectThresholdConfigWithContext(ctx context.Context, request *DescribeListProtectThresholdConfigRequest) (response *DescribeListProtectThresholdConfigResponse, err error) { + if request == nil { + request = NewDescribeListProtectThresholdConfigRequest() + } + request.SetContext(ctx) + + response = NewDescribeListProtectThresholdConfigResponse() + err = c.Send(request, response) + return +} + +func NewDescribeListProtocolBlockConfigRequest() (request *DescribeListProtocolBlockConfigRequest) { + request = &DescribeListProtocolBlockConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeListProtocolBlockConfig") + + + return +} + +func NewDescribeListProtocolBlockConfigResponse() (response *DescribeListProtocolBlockConfigResponse) { + response = &DescribeListProtocolBlockConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeListProtocolBlockConfig +// 获取DDoS防护的协议封禁配置列表 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListProtocolBlockConfig(request *DescribeListProtocolBlockConfigRequest) (response *DescribeListProtocolBlockConfigResponse, err error) { + if request == nil { + request = NewDescribeListProtocolBlockConfigRequest() + } + + response = NewDescribeListProtocolBlockConfigResponse() + err = c.Send(request, response) + return +} + +// DescribeListProtocolBlockConfig +// 获取DDoS防护的协议封禁配置列表 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListProtocolBlockConfigWithContext(ctx context.Context, request *DescribeListProtocolBlockConfigRequest) (response *DescribeListProtocolBlockConfigResponse, err error) { + if request == nil { + request = NewDescribeListProtocolBlockConfigRequest() + } + request.SetContext(ctx) + + response = NewDescribeListProtocolBlockConfigResponse() + err = c.Send(request, response) + return +} + +func NewDescribeListSchedulingDomainRequest() (request *DescribeListSchedulingDomainRequest) { + request = &DescribeListSchedulingDomainRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeListSchedulingDomain") + + + return +} + +func NewDescribeListSchedulingDomainResponse() (response *DescribeListSchedulingDomainResponse) { + response = &DescribeListSchedulingDomainResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeListSchedulingDomain +// 获取智能调度域名列表 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListSchedulingDomain(request *DescribeListSchedulingDomainRequest) (response *DescribeListSchedulingDomainResponse, err error) { + if request == nil { + request = NewDescribeListSchedulingDomainRequest() + } + + response = NewDescribeListSchedulingDomainResponse() + err = c.Send(request, response) + return +} + +// DescribeListSchedulingDomain +// 获取智能调度域名列表 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListSchedulingDomainWithContext(ctx context.Context, request *DescribeListSchedulingDomainRequest) (response *DescribeListSchedulingDomainResponse, err error) { + if request == nil { + request = NewDescribeListSchedulingDomainRequest() + } + request.SetContext(ctx) + + response = NewDescribeListSchedulingDomainResponse() + err = c.Send(request, response) + return +} + +func NewDescribeListWaterPrintConfigRequest() (request *DescribeListWaterPrintConfigRequest) { + request = &DescribeListWaterPrintConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DescribeListWaterPrintConfig") + + + return +} + +func NewDescribeListWaterPrintConfigResponse() (response *DescribeListWaterPrintConfigResponse) { + response = &DescribeListWaterPrintConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DescribeListWaterPrintConfig +// 获取DDoS防护的水印防护配置列表 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListWaterPrintConfig(request *DescribeListWaterPrintConfigRequest) (response *DescribeListWaterPrintConfigResponse, err error) { + if request == nil { + request = NewDescribeListWaterPrintConfigRequest() + } + + response = NewDescribeListWaterPrintConfigResponse() + err = c.Send(request, response) + return +} + +// DescribeListWaterPrintConfig +// 获取DDoS防护的水印防护配置列表 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeListWaterPrintConfigWithContext(ctx context.Context, request *DescribeListWaterPrintConfigRequest) (response *DescribeListWaterPrintConfigResponse, err error) { + if request == nil { + request = NewDescribeListWaterPrintConfigRequest() + } + request.SetContext(ctx) + + response = NewDescribeListWaterPrintConfigResponse() + err = c.Send(request, response) + return +} + +func NewDisassociateDDoSEipAddressRequest() (request *DisassociateDDoSEipAddressRequest) { + request = &DisassociateDDoSEipAddressRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "DisassociateDDoSEipAddress") + + + return +} + +func NewDisassociateDDoSEipAddressResponse() (response *DisassociateDDoSEipAddressResponse) { + response = &DisassociateDDoSEipAddressResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// DisassociateDDoSEipAddress +// 本接口 (DisassociateDDoSEipAddress) 用于解绑高防弹性公网IP。 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DisassociateDDoSEipAddress(request *DisassociateDDoSEipAddressRequest) (response *DisassociateDDoSEipAddressResponse, err error) { + if request == nil { + request = NewDisassociateDDoSEipAddressRequest() + } + + response = NewDisassociateDDoSEipAddressResponse() + err = c.Send(request, response) + return +} + +// DisassociateDDoSEipAddress +// 本接口 (DisassociateDDoSEipAddress) 用于解绑高防弹性公网IP。 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// DRYRUNOPERATION = "DryRunOperation" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DisassociateDDoSEipAddressWithContext(ctx context.Context, request *DisassociateDDoSEipAddressRequest) (response *DisassociateDDoSEipAddressResponse, err error) { + if request == nil { + request = NewDisassociateDDoSEipAddressRequest() + } + request.SetContext(ctx) + + response = NewDisassociateDDoSEipAddressResponse() + err = c.Send(request, response) + return +} + +func NewModifyDDoSGeoIPBlockConfigRequest() (request *ModifyDDoSGeoIPBlockConfigRequest) { + request = &ModifyDDoSGeoIPBlockConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "ModifyDDoSGeoIPBlockConfig") + + + return +} + +func NewModifyDDoSGeoIPBlockConfigResponse() (response *ModifyDDoSGeoIPBlockConfigResponse) { + response = &ModifyDDoSGeoIPBlockConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// ModifyDDoSGeoIPBlockConfig +// 修改DDoS防护的区域封禁配置 +// +// 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) ModifyDDoSGeoIPBlockConfig(request *ModifyDDoSGeoIPBlockConfigRequest) (response *ModifyDDoSGeoIPBlockConfigResponse, err error) { + if request == nil { + request = NewModifyDDoSGeoIPBlockConfigRequest() + } + + response = NewModifyDDoSGeoIPBlockConfigResponse() + err = c.Send(request, response) + return +} + +// ModifyDDoSGeoIPBlockConfig +// 修改DDoS防护的区域封禁配置 +// +// 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) ModifyDDoSGeoIPBlockConfigWithContext(ctx context.Context, request *ModifyDDoSGeoIPBlockConfigRequest) (response *ModifyDDoSGeoIPBlockConfigResponse, err error) { + if request == nil { + request = NewModifyDDoSGeoIPBlockConfigRequest() + } + request.SetContext(ctx) + + response = NewModifyDDoSGeoIPBlockConfigResponse() + err = c.Send(request, response) + return +} + +func NewModifyDDoSSpeedLimitConfigRequest() (request *ModifyDDoSSpeedLimitConfigRequest) { + request = &ModifyDDoSSpeedLimitConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "ModifyDDoSSpeedLimitConfig") + + + return +} + +func NewModifyDDoSSpeedLimitConfigResponse() (response *ModifyDDoSSpeedLimitConfigResponse) { + response = &ModifyDDoSSpeedLimitConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// ModifyDDoSSpeedLimitConfig +// 修改DDoS防护的访问限速配置 +// +// 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) ModifyDDoSSpeedLimitConfig(request *ModifyDDoSSpeedLimitConfigRequest) (response *ModifyDDoSSpeedLimitConfigResponse, err error) { + if request == nil { + request = NewModifyDDoSSpeedLimitConfigRequest() + } + + response = NewModifyDDoSSpeedLimitConfigResponse() + err = c.Send(request, response) + return +} + +// ModifyDDoSSpeedLimitConfig +// 修改DDoS防护的访问限速配置 +// +// 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) ModifyDDoSSpeedLimitConfigWithContext(ctx context.Context, request *ModifyDDoSSpeedLimitConfigRequest) (response *ModifyDDoSSpeedLimitConfigResponse, err error) { + if request == nil { + request = NewModifyDDoSSpeedLimitConfigRequest() + } + request.SetContext(ctx) + + response = NewModifyDDoSSpeedLimitConfigResponse() + err = c.Send(request, response) + return +} + +func NewModifyDomainUsrNameRequest() (request *ModifyDomainUsrNameRequest) { + request = &ModifyDomainUsrNameRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "ModifyDomainUsrName") + + + return +} + +func NewModifyDomainUsrNameResponse() (response *ModifyDomainUsrNameResponse) { + response = &ModifyDomainUsrNameResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// ModifyDomainUsrName +// 修改智能解析域名名称 +// +// 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) ModifyDomainUsrName(request *ModifyDomainUsrNameRequest) (response *ModifyDomainUsrNameResponse, err error) { + if request == nil { + request = NewModifyDomainUsrNameRequest() + } + + response = NewModifyDomainUsrNameResponse() + err = c.Send(request, response) + return +} + +// ModifyDomainUsrName +// 修改智能解析域名名称 +// +// 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) ModifyDomainUsrNameWithContext(ctx context.Context, request *ModifyDomainUsrNameRequest) (response *ModifyDomainUsrNameResponse, err error) { + if request == nil { + request = NewModifyDomainUsrNameRequest() + } + request.SetContext(ctx) + + response = NewModifyDomainUsrNameResponse() + err = c.Send(request, response) + return +} + +func NewModifyL7RulesEdgeRequest() (request *ModifyL7RulesEdgeRequest) { + request = &ModifyL7RulesEdgeRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "ModifyL7RulesEdge") + + + return +} + +func NewModifyL7RulesEdgeResponse() (response *ModifyL7RulesEdgeResponse) { + response = &ModifyL7RulesEdgeResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// ModifyL7RulesEdge +// 修改边界防护L7转发规则 +// +// 可能返回的错误码: +// RESOURCEINUSE = "ResourceInUse" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyL7RulesEdge(request *ModifyL7RulesEdgeRequest) (response *ModifyL7RulesEdgeResponse, err error) { + if request == nil { + request = NewModifyL7RulesEdgeRequest() + } + + response = NewModifyL7RulesEdgeResponse() + err = c.Send(request, response) + return +} + +// ModifyL7RulesEdge +// 修改边界防护L7转发规则 +// +// 可能返回的错误码: +// RESOURCEINUSE = "ResourceInUse" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyL7RulesEdgeWithContext(ctx context.Context, request *ModifyL7RulesEdgeRequest) (response *ModifyL7RulesEdgeResponse, err error) { + if request == nil { + request = NewModifyL7RulesEdgeRequest() + } + request.SetContext(ctx) + + response = NewModifyL7RulesEdgeResponse() + err = c.Send(request, response) + return +} + +func NewModifyNewDomainRulesRequest() (request *ModifyNewDomainRulesRequest) { + request = &ModifyNewDomainRulesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "ModifyNewDomainRules") + + + return +} + +func NewModifyNewDomainRulesResponse() (response *ModifyNewDomainRulesResponse) { + response = &ModifyNewDomainRulesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// ModifyNewDomainRules +// 修改7层转发规则 +// +// 可能返回的错误码: +// RESOURCEINUSE = "ResourceInUse" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyNewDomainRules(request *ModifyNewDomainRulesRequest) (response *ModifyNewDomainRulesResponse, err error) { + if request == nil { + request = NewModifyNewDomainRulesRequest() + } + + response = NewModifyNewDomainRulesResponse() + err = c.Send(request, response) + return +} + +// ModifyNewDomainRules +// 修改7层转发规则 +// +// 可能返回的错误码: +// RESOURCEINUSE = "ResourceInUse" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyNewDomainRulesWithContext(ctx context.Context, request *ModifyNewDomainRulesRequest) (response *ModifyNewDomainRulesResponse, err error) { + if request == nil { + request = NewModifyNewDomainRulesRequest() + } + request.SetContext(ctx) + + response = NewModifyNewDomainRulesResponse() + err = c.Send(request, response) + return +} + +func NewModifyPacketFilterConfigRequest() (request *ModifyPacketFilterConfigRequest) { + request = &ModifyPacketFilterConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "ModifyPacketFilterConfig") + + + return +} + +func NewModifyPacketFilterConfigResponse() (response *ModifyPacketFilterConfigResponse) { + response = &ModifyPacketFilterConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// ModifyPacketFilterConfig +// 修改DDoS防护的特征过滤规则 +// +// 可能返回的错误码: +// RESOURCEINUSE = "ResourceInUse" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyPacketFilterConfig(request *ModifyPacketFilterConfigRequest) (response *ModifyPacketFilterConfigResponse, err error) { + if request == nil { + request = NewModifyPacketFilterConfigRequest() + } + + response = NewModifyPacketFilterConfigResponse() + err = c.Send(request, response) + return +} + +// ModifyPacketFilterConfig +// 修改DDoS防护的特征过滤规则 +// +// 可能返回的错误码: +// RESOURCEINUSE = "ResourceInUse" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyPacketFilterConfigWithContext(ctx context.Context, request *ModifyPacketFilterConfigRequest) (response *ModifyPacketFilterConfigResponse, err error) { + if request == nil { + request = NewModifyPacketFilterConfigRequest() + } + request.SetContext(ctx) + + response = NewModifyPacketFilterConfigResponse() + err = c.Send(request, response) + return +} + +func NewSwitchWaterPrintConfigRequest() (request *SwitchWaterPrintConfigRequest) { + request = &SwitchWaterPrintConfigRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + request.Init().WithApiInfo("antiddos", APIVersion, "SwitchWaterPrintConfig") + + + return +} + +func NewSwitchWaterPrintConfigResponse() (response *SwitchWaterPrintConfigResponse) { + response = &SwitchWaterPrintConfigResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// SwitchWaterPrintConfig +// 开启或关闭DDoS防护的水印防护配置 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) SwitchWaterPrintConfig(request *SwitchWaterPrintConfigRequest) (response *SwitchWaterPrintConfigResponse, err error) { + if request == nil { + request = NewSwitchWaterPrintConfigRequest() + } + + response = NewSwitchWaterPrintConfigResponse() + err = c.Send(request, response) + return +} + +// SwitchWaterPrintConfig +// 开启或关闭DDoS防护的水印防护配置 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) SwitchWaterPrintConfigWithContext(ctx context.Context, request *SwitchWaterPrintConfigRequest) (response *SwitchWaterPrintConfigResponse, err error) { + if request == nil { + request = NewSwitchWaterPrintConfigRequest() + } + request.SetContext(ctx) + + response = NewSwitchWaterPrintConfigResponse() + err = c.Send(request, response) + return +} diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/v20200309/errors.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/v20200309/errors.go new file mode 100644 index 0000000000..9b50226dc6 --- /dev/null +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/v20200309/errors.go @@ -0,0 +1,73 @@ +// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v20200309 + +const ( + // 此产品的特有错误码 + + // CAM签名/鉴权错误。 + AUTHFAILURE = "AuthFailure" + + // DryRun 操作,代表请求将会是成功的,只是多传了 DryRun 参数。 + DRYRUNOPERATION = "DryRunOperation" + + // 操作失败。 + FAILEDOPERATION = "FailedOperation" + + // 内部错误。 + INTERNALERROR = "InternalError" + + // 参数错误。 + INVALIDPARAMETER = "InvalidParameter" + + // 参数取值错误。 + INVALIDPARAMETERVALUE = "InvalidParameterValue" + + // 超过配额限制。 + LIMITEXCEEDED = "LimitExceeded" + + // 缺少参数错误。 + MISSINGPARAMETER = "MissingParameter" + + // 操作被拒绝。 + OPERATIONDENIED = "OperationDenied" + + // 请求的次数超过了频率限制。 + REQUESTLIMITEXCEEDED = "RequestLimitExceeded" + + // 资源被占用。 + RESOURCEINUSE = "ResourceInUse" + + // 资源不足。 + RESOURCEINSUFFICIENT = "ResourceInsufficient" + + // 资源不存在。 + RESOURCENOTFOUND = "ResourceNotFound" + + // 资源不可用。 + RESOURCEUNAVAILABLE = "ResourceUnavailable" + + // 资源售罄。 + RESOURCESSOLDOUT = "ResourcesSoldOut" + + // 未授权操作。 + UNAUTHORIZEDOPERATION = "UnauthorizedOperation" + + // 未知参数错误。 + UNKNOWNPARAMETER = "UnknownParameter" + + // 操作不支持。 + UNSUPPORTEDOPERATION = "UnsupportedOperation" +) diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/v20200309/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/v20200309/models.go new file mode 100644 index 0000000000..1b9f40fd21 --- /dev/null +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/v20200309/models.go @@ -0,0 +1,4483 @@ +// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v20200309 + +import ( + "encoding/json" + tcerr "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors" + tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" +) + +type AclConfig struct { + + // 协议类型, 可取值tcp, udp, all + ForwardProtocol *string `json:"ForwardProtocol,omitempty" name:"ForwardProtocol"` + + // 目的端口起始,可取值范围0~65535 + DPortStart *uint64 `json:"DPortStart,omitempty" name:"DPortStart"` + + // 目的端口结束,可取值范围0~65535 + DPortEnd *uint64 `json:"DPortEnd,omitempty" name:"DPortEnd"` + + // 来源端口起始,可取值范围0~65535 + SPortStart *uint64 `json:"SPortStart,omitempty" name:"SPortStart"` + + // 来源端口结束,可取值范围0~65535 + SPortEnd *uint64 `json:"SPortEnd,omitempty" name:"SPortEnd"` + + // 动作,可取值:drop, transmit, forward + Action *string `json:"Action,omitempty" name:"Action"` + + // 策略优先级,数字越小,级别越高,该规则越靠前匹配,取值1-1000 + // 注意:此字段可能返回 null,表示取不到有效值。 + Priority *uint64 `json:"Priority,omitempty" name:"Priority"` +} + +type AclConfigRelation struct { + + // acl策略 + AclConfig *AclConfig `json:"AclConfig,omitempty" name:"AclConfig"` + + // 实例列表 + InstanceDetailList []*InstanceRelation `json:"InstanceDetailList,omitempty" name:"InstanceDetailList"` +} + +type AssociateDDoSEipAddressRequest struct { + *tchttp.BaseRequest + + // 资源实例ID,实例ID形如:bgpip-0000011x。只能填写高防IP实例。 + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 资源实例ID对应的高防弹性公网IP。 + Eip *string `json:"Eip,omitempty" name:"Eip"` + + // 要绑定的实例 ID。实例 ID 形如:ins-11112222。可通过登录控制台查询,也可通过 DescribeInstances 接口返回值中的InstanceId获取。 + CvmInstanceID *string `json:"CvmInstanceID,omitempty" name:"CvmInstanceID"` + + // cvm实例所在地域,例如:ap-hongkong。 + CvmRegion *string `json:"CvmRegion,omitempty" name:"CvmRegion"` +} + +func (r *AssociateDDoSEipAddressRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *AssociateDDoSEipAddressRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "Eip") + delete(f, "CvmInstanceID") + delete(f, "CvmRegion") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AssociateDDoSEipAddressRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type AssociateDDoSEipAddressResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *AssociateDDoSEipAddressResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *AssociateDDoSEipAddressResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type AssociateDDoSEipLoadBalancerRequest struct { + *tchttp.BaseRequest + + // 资源实例ID,实例ID形如:bgpip-0000011x。只能填写高防IP实例。 + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 资源实例ID对应的高防弹性公网IP。 + Eip *string `json:"Eip,omitempty" name:"Eip"` + + // 要绑定的负载均衡ID。负载均衡 ID 形如:lb-0000002i。可通过登录控制台查询,也可通过 DescribeLoadBalancers 接口返回值中的LoadBalancerId获取。 + LoadBalancerID *string `json:"LoadBalancerID,omitempty" name:"LoadBalancerID"` + + // Clb所在地域,例如:ap-hongkong。 + LoadBalancerRegion *string `json:"LoadBalancerRegion,omitempty" name:"LoadBalancerRegion"` +} + +func (r *AssociateDDoSEipLoadBalancerRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *AssociateDDoSEipLoadBalancerRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "Eip") + delete(f, "LoadBalancerID") + delete(f, "LoadBalancerRegion") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AssociateDDoSEipLoadBalancerRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type AssociateDDoSEipLoadBalancerResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *AssociateDDoSEipLoadBalancerResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *AssociateDDoSEipLoadBalancerResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type BGPIPInstance struct { + + // 资产实例的详细信息 + InstanceDetail *InstanceRelation `json:"InstanceDetail,omitempty" name:"InstanceDetail"` + + // 资产实例的规格信息 + SpecificationLimit *BGPIPInstanceSpecification `json:"SpecificationLimit,omitempty" name:"SpecificationLimit"` + + // 资产实例的使用统计信息 + Usage *BGPIPInstanceUsages `json:"Usage,omitempty" name:"Usage"` + + // 资产实例所在的地域 + Region *RegionInfo `json:"Region,omitempty" name:"Region"` + + // 资产实例的防护状态,状态码如下: + // "idle":正常状态(无攻击) + // "attacking":攻击中 + // "blocking":封堵中 + // "creating":创建中 + // "deblocking":解封中 + // "isolate":回收隔离中 + Status *string `json:"Status,omitempty" name:"Status"` + + // 购买时间 + ExpiredTime *string `json:"ExpiredTime,omitempty" name:"ExpiredTime"` + + // 到期时间 + CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` + + // 资产实例的名称 + Name *string `json:"Name,omitempty" name:"Name"` + + // 资产实例所属的套餐包信息, + // 注意:当资产实例不是套餐包的实例时,此字段为null + // 注意:此字段可能返回 null,表示取不到有效值。 + PackInfo *PackInfo `json:"PackInfo,omitempty" name:"PackInfo"` + + // 资产实例所属的三网套餐包详情, + // 注意:当资产实例不是三网套餐包的实例时,此字段为null + // 注意:此字段可能返回 null,表示取不到有效值。 + StaticPackRelation *StaticPackRelation `json:"StaticPackRelation,omitempty" name:"StaticPackRelation"` + + // 区分高防IP境外线路 + // 注意:此字段可能返回 null,表示取不到有效值。 + ZoneId *uint64 `json:"ZoneId,omitempty" name:"ZoneId"` + + // 区分集群 + // 注意:此字段可能返回 null,表示取不到有效值。 + Tgw *uint64 `json:"Tgw,omitempty" name:"Tgw"` + + // 高防弹性公网IP状态,包含'CREATING'(创建中),'BINDING'(绑定中),'BIND'(已绑定),'UNBINDING'(解绑中),'UNBIND'(已解绑),'OFFLINING'(释放中),'BIND_ENI'(绑定悬空弹性网卡)。只对高防弹性公网IP实例有效。 + // 注意:此字段可能返回 null,表示取不到有效值。 + EipAddressStatus *string `json:"EipAddressStatus,omitempty" name:"EipAddressStatus"` + + // 是否高防弹性公网IP实例,是为1,否为0。 + // 注意:此字段可能返回 null,表示取不到有效值。 + EipFlag *int64 `json:"EipFlag,omitempty" name:"EipFlag"` + + // 资产实例所属的高防弹性公网IP套餐包详情, + // 注意:当资产实例不是高防弹性公网IP套餐包的实例时,此字段为null + // 注意:此字段可能返回 null,表示取不到有效值。 + EipAddressPackRelation *EipAddressPackRelation `json:"EipAddressPackRelation,omitempty" name:"EipAddressPackRelation"` + + // 高防弹性公网IP关联的实例信息。 + // 注意:当资产实例不是高防弹性公网IP实例时,此字段为null + // 注意:此字段可能返回 null,表示取不到有效值。 + EipAddressInfo *EipAddressRelation `json:"EipAddressInfo,omitempty" name:"EipAddressInfo"` + + // 建议客户接入的域名,客户可使用域名接入。 + // 注意:此字段可能返回 null,表示取不到有效值。 + Domain *string `json:"Domain,omitempty" name:"Domain"` + + // 是否开启安全加速,是为1,否为0。 + DamDDoSStatus *uint64 `json:"DamDDoSStatus,omitempty" name:"DamDDoSStatus"` + + // 是否Ipv6版本的IP, 是为1,否为0 + // 注意:此字段可能返回 null,表示取不到有效值。 + V6Flag *uint64 `json:"V6Flag,omitempty" name:"V6Flag"` +} + +type BGPIPInstanceSpecification struct { + + // 保底防护峰值,单位Mbps + ProtectBandwidth *uint64 `json:"ProtectBandwidth,omitempty" name:"ProtectBandwidth"` + + // CC防护峰值,单位qps + ProtectCCQPS *uint64 `json:"ProtectCCQPS,omitempty" name:"ProtectCCQPS"` + + // 正常业务带宽,单位Mbps + NormalBandwidth *uint64 `json:"NormalBandwidth,omitempty" name:"NormalBandwidth"` + + // 转发规则数,单位条 + ForwardRulesLimit *uint64 `json:"ForwardRulesLimit,omitempty" name:"ForwardRulesLimit"` + + // 自动续费状态,取值[ + // 0:没有开启自动续费 + // 1:开启了自动续费 + // ] + AutoRenewFlag *uint64 `json:"AutoRenewFlag,omitempty" name:"AutoRenewFlag"` + + // 高防IP线路,取值为[ + // 1:BGP线路 + // 2:电信 + // 3:联通 + // 4:移动 + // 99:第三方合作线路 + // ] + Line *uint64 `json:"Line,omitempty" name:"Line"` + + // 弹性防护峰值,单位Mbps + ElasticBandwidth *uint64 `json:"ElasticBandwidth,omitempty" name:"ElasticBandwidth"` +} + +type BGPIPInstanceUsages struct { + + // 已使用的端口规则数,单位条 + PortRulesUsage *uint64 `json:"PortRulesUsage,omitempty" name:"PortRulesUsage"` + + // 已使用的域名规则数,单位条 + DomainRulesUsage *uint64 `json:"DomainRulesUsage,omitempty" name:"DomainRulesUsage"` + + // 最近7天的攻击次数,单位次 + Last7DayAttackCount *uint64 `json:"Last7DayAttackCount,omitempty" name:"Last7DayAttackCount"` +} + +type BGPInstance struct { + + // 资产实例的详细信息 + InstanceDetail *InstanceRelation `json:"InstanceDetail,omitempty" name:"InstanceDetail"` + + // 资产实例的规格信息 + SpecificationLimit *BGPInstanceSpecification `json:"SpecificationLimit,omitempty" name:"SpecificationLimit"` + + // 资产实例的使用统计信息 + Usage *BGPInstanceUsages `json:"Usage,omitempty" name:"Usage"` + + // 资产实例所在的地域 + Region *RegionInfo `json:"Region,omitempty" name:"Region"` + + // 资产实例的防护状态,状态码如下: + // "idle":正常状态(无攻击) + // "attacking":攻击中 + // "blocking":封堵中 + // "creating":创建中 + // "deblocking":解封中 + // "isolate":回收隔离中 + Status *string `json:"Status,omitempty" name:"Status"` + + // 购买时间 + CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` + + // 到期时间 + ExpiredTime *string `json:"ExpiredTime,omitempty" name:"ExpiredTime"` + + // 资产实例的名称 + Name *string `json:"Name,omitempty" name:"Name"` + + // 资产实例所属的套餐包信息, + // 注意:当资产实例不是套餐包的实例时,此字段为null + // 注意:此字段可能返回 null,表示取不到有效值。 + PackInfo *PackInfo `json:"PackInfo,omitempty" name:"PackInfo"` + + // 高防包绑定的EIP属于的云产品信息 + EipProductInfos []*EipProductInfo `json:"EipProductInfos,omitempty" name:"EipProductInfos"` + + // 高防包绑定状态,取值[ + // "idle":绑定已完成 + // "bounding":正在绑定中 + // "failed":绑定失败 + // ] + BoundStatus *string `json:"BoundStatus,omitempty" name:"BoundStatus"` + + // 四层防护严格级别 + DDoSLevel *string `json:"DDoSLevel,omitempty" name:"DDoSLevel"` + + // CC防护开关 + CCEnable *int64 `json:"CCEnable,omitempty" name:"CCEnable"` +} + +type BGPInstanceSpecification struct { + + // 保底防护峰值,单位Gbps + ProtectBandwidth *uint64 `json:"ProtectBandwidth,omitempty" name:"ProtectBandwidth"` + + // 防护次数,单位次 + ProtectCountLimit *uint64 `json:"ProtectCountLimit,omitempty" name:"ProtectCountLimit"` + + // 防护IP数,单位个 + ProtectIPNumberLimit *uint64 `json:"ProtectIPNumberLimit,omitempty" name:"ProtectIPNumberLimit"` + + // 自动续费状态,取值[ + // 0:没有开启自动续费 + // 1:开启了自动续费 + // ] + AutoRenewFlag *uint64 `json:"AutoRenewFlag,omitempty" name:"AutoRenewFlag"` +} + +type BGPInstanceUsages struct { + + // 已使用的防护次数,单位次 + ProtectCountUsage *uint64 `json:"ProtectCountUsage,omitempty" name:"ProtectCountUsage"` + + // 已防护的IP数,单位个 + ProtectIPNumberUsage *uint64 `json:"ProtectIPNumberUsage,omitempty" name:"ProtectIPNumberUsage"` + + // 最近7天的攻击次数,单位次 + Last7DayAttackCount *uint64 `json:"Last7DayAttackCount,omitempty" name:"Last7DayAttackCount"` +} + +type BlackWhiteIpRelation struct { + + // IP地址 + Ip *string `json:"Ip,omitempty" name:"Ip"` + + // IP类型,取值[black(黑IP),white(白IP)] + Type *string `json:"Type,omitempty" name:"Type"` + + // 黑白IP所属的实例 + InstanceDetailList []*InstanceRelation `json:"InstanceDetailList,omitempty" name:"InstanceDetailList"` + + // ip掩码,0表示32位完整ip + Mask *uint64 `json:"Mask,omitempty" name:"Mask"` +} + +type BoundIpInfo struct { + + // IP地址 + Ip *string `json:"Ip,omitempty" name:"Ip"` + + // 绑定的产品分类,取值[public(CVM、CLB产品),bm(黑石产品),eni(弹性网卡),vpngw(VPN网关), natgw(NAT网关),waf(Web应用安全产品),fpc(金融产品),gaap(GAAP产品), other(托管IP)] + BizType *string `json:"BizType,omitempty" name:"BizType"` + + // IP所属的资源实例ID,当绑定新IP时必须填写此字段;例如是弹性网卡的IP,则InstanceId填写弹性网卡的ID(eni-*); 如果绑定的是托管IP没有对应的资源实例ID,请填写"none"; + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 产品分类下的子类型,取值[cvm(CVM),lb(负载均衡器),eni(弹性网卡),vpngw(VPN),natgw(NAT),waf(WAF),fpc(金融),gaap(GAAP),other(托管IP),eip(黑石弹性IP)] + DeviceType *string `json:"DeviceType,omitempty" name:"DeviceType"` + + // 运营商,0:电信;1:联通;2:移动;5:BGP + IspCode *uint64 `json:"IspCode,omitempty" name:"IspCode"` +} + +type CertIdInsL7Rules struct { + + // 使用证书的规则列表 + L7Rules []*InsL7Rules `json:"L7Rules,omitempty" name:"L7Rules"` + + // 证书ID + CertId *string `json:"CertId,omitempty" name:"CertId"` +} + +type ConnectLimitConfig struct { + + // 基于源IP+目的IP的每秒新建数限制 + SdNewLimit *uint64 `json:"SdNewLimit,omitempty" name:"SdNewLimit"` + + // 基于目的IP的每秒新建数限制 + DstNewLimit *uint64 `json:"DstNewLimit,omitempty" name:"DstNewLimit"` + + // 基于源IP+目的IP的并发连接控制 + SdConnLimit *uint64 `json:"SdConnLimit,omitempty" name:"SdConnLimit"` + + // 基于目的IP+目的端口的并发连接控制 + DstConnLimit *uint64 `json:"DstConnLimit,omitempty" name:"DstConnLimit"` + + // 基于连接抑制触发阈值,取值范围[0,4294967295] + BadConnThreshold *uint64 `json:"BadConnThreshold,omitempty" name:"BadConnThreshold"` + + // 异常连接检测条件,空连接防护开关,,取值范围[0,1] + NullConnEnable *uint64 `json:"NullConnEnable,omitempty" name:"NullConnEnable"` + + // 异常连接检测条件,连接超时,,取值范围[0,65535] + ConnTimeout *uint64 `json:"ConnTimeout,omitempty" name:"ConnTimeout"` + + // 异常连接检测条件,syn占比ack百分比,,取值范围[0,100] + SynRate *uint64 `json:"SynRate,omitempty" name:"SynRate"` + + // 异常连接检测条件,syn阈值,取值范围[0,100] + SynLimit *uint64 `json:"SynLimit,omitempty" name:"SynLimit"` +} + +type ConnectLimitRelation struct { + + // 连接抑制配置 + ConnectLimitConfig *ConnectLimitConfig `json:"ConnectLimitConfig,omitempty" name:"ConnectLimitConfig"` + + // 连接抑制关联的实例信息 + InstanceDetailList []*InstanceRelation `json:"InstanceDetailList,omitempty" name:"InstanceDetailList"` +} + +type CreateBlackWhiteIpListRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // IP列表 + IpList []*string `json:"IpList,omitempty" name:"IpList"` + + // IP类型,取值[black(黑名单IP), white(白名单IP)] + Type *string `json:"Type,omitempty" name:"Type"` +} + +func (r *CreateBlackWhiteIpListRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateBlackWhiteIpListRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "IpList") + delete(f, "Type") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateBlackWhiteIpListRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreateBlackWhiteIpListResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreateBlackWhiteIpListResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateBlackWhiteIpListResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type CreateBoundIPRequest struct { + *tchttp.BaseRequest + + // 大禹子产品代号(bgp表示独享包;bgp-multip表示共享包) + Business *string `json:"Business,omitempty" name:"Business"` + + // 资源实例ID + Id *string `json:"Id,omitempty" name:"Id"` + + // 绑定到资源实例的IP数组,当资源实例为高防包(独享包)时,数组只允许填1个IP;当没有要绑定的IP时可以为空数组;但是BoundDevList和UnBoundDevList至少有一个不为空; + BoundDevList []*BoundIpInfo `json:"BoundDevList,omitempty" name:"BoundDevList"` + + // 与资源实例解绑的IP数组,当资源实例为高防包(独享包)时,数组只允许填1个IP;当没有要解绑的IP时可以为空数组;但是BoundDevList和UnBoundDevList至少有一个不为空; + UnBoundDevList []*BoundIpInfo `json:"UnBoundDevList,omitempty" name:"UnBoundDevList"` + + // 已弃用,不填 + CopyPolicy *string `json:"CopyPolicy,omitempty" name:"CopyPolicy"` +} + +func (r *CreateBoundIPRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateBoundIPRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Business") + delete(f, "Id") + delete(f, "BoundDevList") + delete(f, "UnBoundDevList") + delete(f, "CopyPolicy") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateBoundIPRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreateBoundIPResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 成功码 + Success *SuccessCode `json:"Success,omitempty" name:"Success"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreateBoundIPResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateBoundIPResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type CreateDDoSAIRequest struct { + *tchttp.BaseRequest + + // 资源实例ID列表 + InstanceIdList []*string `json:"InstanceIdList,omitempty" name:"InstanceIdList"` + + // AI防护开关,取值[ + // on(开启) + // off(关闭) + // ] + DDoSAI *string `json:"DDoSAI,omitempty" name:"DDoSAI"` +} + +func (r *CreateDDoSAIRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDDoSAIRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceIdList") + delete(f, "DDoSAI") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDDoSAIRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreateDDoSAIResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreateDDoSAIResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDDoSAIResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type CreateDDoSBlackWhiteIpListRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // IP列表 + IpList []*IpSegment `json:"IpList,omitempty" name:"IpList"` + + // IP类型,取值[black(黑名单IP), white(白名单IP)] + Type *string `json:"Type,omitempty" name:"Type"` +} + +func (r *CreateDDoSBlackWhiteIpListRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDDoSBlackWhiteIpListRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "IpList") + delete(f, "Type") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDDoSBlackWhiteIpListRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreateDDoSBlackWhiteIpListResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreateDDoSBlackWhiteIpListResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDDoSBlackWhiteIpListResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type CreateDDoSConnectLimitRequest struct { + *tchttp.BaseRequest + + // 资源实例Id + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 连接抑制配置 + ConnectLimitConfig *ConnectLimitConfig `json:"ConnectLimitConfig,omitempty" name:"ConnectLimitConfig"` +} + +func (r *CreateDDoSConnectLimitRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDDoSConnectLimitRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "ConnectLimitConfig") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDDoSConnectLimitRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreateDDoSConnectLimitResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreateDDoSConnectLimitResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDDoSConnectLimitResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type CreateDDoSGeoIPBlockConfigRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // DDoS区域封禁配置,填写参数时配置ID请为空 + DDoSGeoIPBlockConfig *DDoSGeoIPBlockConfig `json:"DDoSGeoIPBlockConfig,omitempty" name:"DDoSGeoIPBlockConfig"` +} + +func (r *CreateDDoSGeoIPBlockConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDDoSGeoIPBlockConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "DDoSGeoIPBlockConfig") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDDoSGeoIPBlockConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreateDDoSGeoIPBlockConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreateDDoSGeoIPBlockConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDDoSGeoIPBlockConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type CreateDDoSSpeedLimitConfigRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 访问限速配置,填写参数时配置ID请为空 + DDoSSpeedLimitConfig *DDoSSpeedLimitConfig `json:"DDoSSpeedLimitConfig,omitempty" name:"DDoSSpeedLimitConfig"` +} + +func (r *CreateDDoSSpeedLimitConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDDoSSpeedLimitConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "DDoSSpeedLimitConfig") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDDoSSpeedLimitConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreateDDoSSpeedLimitConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreateDDoSSpeedLimitConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDDoSSpeedLimitConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type CreateDefaultAlarmThresholdRequest struct { + *tchttp.BaseRequest + + // 默认告警阈值配置 + DefaultAlarmConfig *DefaultAlarmThreshold `json:"DefaultAlarmConfig,omitempty" name:"DefaultAlarmConfig"` + + // 产品类型,取值[ + // bgp(表示高防包产品) + // bgpip(表示高防IP产品) + // ] + InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` +} + +func (r *CreateDefaultAlarmThresholdRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDefaultAlarmThresholdRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DefaultAlarmConfig") + delete(f, "InstanceType") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDefaultAlarmThresholdRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreateDefaultAlarmThresholdResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreateDefaultAlarmThresholdResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDefaultAlarmThresholdResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type CreateIPAlarmThresholdConfigRequest struct { + *tchttp.BaseRequest + + // IP告警阈值配置列表 + IpAlarmThresholdConfigList []*IPAlarmThresholdRelation `json:"IpAlarmThresholdConfigList,omitempty" name:"IpAlarmThresholdConfigList"` +} + +func (r *CreateIPAlarmThresholdConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateIPAlarmThresholdConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IpAlarmThresholdConfigList") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateIPAlarmThresholdConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreateIPAlarmThresholdConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreateIPAlarmThresholdConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateIPAlarmThresholdConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type CreateL7RuleCertsRequest struct { + *tchttp.BaseRequest + + // SSL证书ID + CertId *string `json:"CertId,omitempty" name:"CertId"` + + // L7域名转发规则列表 + L7Rules []*InsL7Rules `json:"L7Rules,omitempty" name:"L7Rules"` +} + +func (r *CreateL7RuleCertsRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateL7RuleCertsRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "CertId") + delete(f, "L7Rules") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateL7RuleCertsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreateL7RuleCertsResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 成功码 + Success *SuccessCode `json:"Success,omitempty" name:"Success"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreateL7RuleCertsResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateL7RuleCertsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type CreatePacketFilterConfigRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 特征过滤规则 + PacketFilterConfig *PacketFilterConfig `json:"PacketFilterConfig,omitempty" name:"PacketFilterConfig"` +} + +func (r *CreatePacketFilterConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreatePacketFilterConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "PacketFilterConfig") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreatePacketFilterConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreatePacketFilterConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreatePacketFilterConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreatePacketFilterConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type CreatePortAclConfigListRequest struct { + *tchttp.BaseRequest + + // 资源实例ID列表 + InstanceIdList []*string `json:"InstanceIdList,omitempty" name:"InstanceIdList"` + + // 端口acl策略 + AclConfig *AclConfig `json:"AclConfig,omitempty" name:"AclConfig"` +} + +func (r *CreatePortAclConfigListRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreatePortAclConfigListRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceIdList") + delete(f, "AclConfig") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreatePortAclConfigListRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreatePortAclConfigListResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreatePortAclConfigListResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreatePortAclConfigListResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type CreatePortAclConfigRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 端口acl策略 + AclConfig *AclConfig `json:"AclConfig,omitempty" name:"AclConfig"` +} + +func (r *CreatePortAclConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreatePortAclConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "AclConfig") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreatePortAclConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreatePortAclConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreatePortAclConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreatePortAclConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type CreateProtocolBlockConfigRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 协议封禁配置 + ProtocolBlockConfig *ProtocolBlockConfig `json:"ProtocolBlockConfig,omitempty" name:"ProtocolBlockConfig"` +} + +func (r *CreateProtocolBlockConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateProtocolBlockConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "ProtocolBlockConfig") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateProtocolBlockConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreateProtocolBlockConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreateProtocolBlockConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateProtocolBlockConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type CreateSchedulingDomainRequest struct { + *tchttp.BaseRequest +} + +func (r *CreateSchedulingDomainRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateSchedulingDomainRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateSchedulingDomainRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreateSchedulingDomainResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 新创建的域名 + Domain *string `json:"Domain,omitempty" name:"Domain"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreateSchedulingDomainResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateSchedulingDomainResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type CreateWaterPrintConfigRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 水印防护配置 + WaterPrintConfig *WaterPrintConfig `json:"WaterPrintConfig,omitempty" name:"WaterPrintConfig"` +} + +func (r *CreateWaterPrintConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateWaterPrintConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "WaterPrintConfig") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateWaterPrintConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreateWaterPrintConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreateWaterPrintConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateWaterPrintConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type CreateWaterPrintKeyRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` +} + +func (r *CreateWaterPrintKeyRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateWaterPrintKeyRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateWaterPrintKeyRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type CreateWaterPrintKeyResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *CreateWaterPrintKeyResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateWaterPrintKeyResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DDoSAIRelation struct { + + // AI防护开关,取值[ + // on(开启) + // off(关闭) + // ] + DDoSAI *string `json:"DDoSAI,omitempty" name:"DDoSAI"` + + // AI防护开关所属的资源实例 + InstanceDetailList []*InstanceRelation `json:"InstanceDetailList,omitempty" name:"InstanceDetailList"` +} + +type DDoSGeoIPBlockConfig struct { + + // 区域类型,取值[ + // oversea(海外) + // china(国内) + // customized(自定义地区) + // ] + RegionType *string `json:"RegionType,omitempty" name:"RegionType"` + + // 封禁动作,取值[ + // drop(拦截) + // trans(放行) + // ] + Action *string `json:"Action,omitempty" name:"Action"` + + // 配置ID,配置添加成功后生成;添加新配置时不用填写此字段,修改或删除配置时需要填写配置ID + Id *string `json:"Id,omitempty" name:"Id"` + + // 当RegionType为customized时,必须填写AreaList,且最多填写128个; + AreaList []*int64 `json:"AreaList,omitempty" name:"AreaList"` +} + +type DDoSGeoIPBlockConfigRelation struct { + + // DDoS区域封禁配置 + GeoIPBlockConfig *DDoSGeoIPBlockConfig `json:"GeoIPBlockConfig,omitempty" name:"GeoIPBlockConfig"` + + // 配置所属的资源实例 + InstanceDetailList []*InstanceRelation `json:"InstanceDetailList,omitempty" name:"InstanceDetailList"` +} + +type DDoSSpeedLimitConfig struct { + + // 限速模式,取值[ + // 1(基于源IP限速) + // 2(基于目的端口限速) + // ] + Mode *uint64 `json:"Mode,omitempty" name:"Mode"` + + // 限速值,每种类型的限速值最多支持1个;该字段数组至少有一种限速值 + SpeedValues []*SpeedValue `json:"SpeedValues,omitempty" name:"SpeedValues"` + + // 此字段已弃用,请填写新字段DstPortList。 + DstPortScopes []*PortSegment `json:"DstPortScopes,omitempty" name:"DstPortScopes"` + + // 配置ID,配置添加成功后生成;添加新限制配置时不用填写此字段,修改或删除限速配置时需要填写配置ID + Id *string `json:"Id,omitempty" name:"Id"` + + // IP protocol numbers, 取值[ + // ALL(所有协议) + // TCP(tcp协议) + // UDP(udp协议) + // SMP(smp协议) + // 1;2-100(自定义协议号范围,最多8个) + // ] + // 注意:当自定义协议号范围时,只能填写协议号,多个范围;分隔;当填写ALL时不能再填写其他协议或协议号。 + ProtocolList *string `json:"ProtocolList,omitempty" name:"ProtocolList"` + + // 端口范围列表,最多8个,多个;分隔,范围表示用-;此端口范围必须填写;填写样式1:0-65535,样式2:80;443;1000-2000 + DstPortList *string `json:"DstPortList,omitempty" name:"DstPortList"` +} + +type DDoSSpeedLimitConfigRelation struct { + + // DDoS访问限速配置 + SpeedLimitConfig *DDoSSpeedLimitConfig `json:"SpeedLimitConfig,omitempty" name:"SpeedLimitConfig"` + + // 配置所属的资源实例 + InstanceDetailList []*InstanceRelation `json:"InstanceDetailList,omitempty" name:"InstanceDetailList"` +} + +type DefaultAlarmThreshold struct { + + // 告警阈值类型,取值[ + // 1(入流量告警阈值) + // 2(攻击清洗流量告警阈值) + // ] + AlarmType *uint64 `json:"AlarmType,omitempty" name:"AlarmType"` + + // 告警阈值,单位Mbps,取值>=0;当作为输入参数时,设置0会删除告警阈值配置; + AlarmThreshold *uint64 `json:"AlarmThreshold,omitempty" name:"AlarmThreshold"` +} + +type DeleteBlackWhiteIpListRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // IP列表 + IpList []*string `json:"IpList,omitempty" name:"IpList"` + + // IP类型,取值[black(黑名单IP), white(白名单IP)] + Type *string `json:"Type,omitempty" name:"Type"` +} + +func (r *DeleteBlackWhiteIpListRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteBlackWhiteIpListRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "IpList") + delete(f, "Type") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteBlackWhiteIpListRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DeleteBlackWhiteIpListResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DeleteBlackWhiteIpListResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteBlackWhiteIpListResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DeleteDDoSBlackWhiteIpListRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // IP列表 + IpList []*IpSegment `json:"IpList,omitempty" name:"IpList"` + + // IP类型,取值[black(黑名单IP), white(白名单IP)] + Type *string `json:"Type,omitempty" name:"Type"` +} + +func (r *DeleteDDoSBlackWhiteIpListRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteDDoSBlackWhiteIpListRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "IpList") + delete(f, "Type") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteDDoSBlackWhiteIpListRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DeleteDDoSBlackWhiteIpListResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DeleteDDoSBlackWhiteIpListResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteDDoSBlackWhiteIpListResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DeleteDDoSGeoIPBlockConfigRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // DDoS区域封禁配置,填写参数时配置ID不能为空 + DDoSGeoIPBlockConfig *DDoSGeoIPBlockConfig `json:"DDoSGeoIPBlockConfig,omitempty" name:"DDoSGeoIPBlockConfig"` +} + +func (r *DeleteDDoSGeoIPBlockConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteDDoSGeoIPBlockConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "DDoSGeoIPBlockConfig") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteDDoSGeoIPBlockConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DeleteDDoSGeoIPBlockConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DeleteDDoSGeoIPBlockConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteDDoSGeoIPBlockConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DeleteDDoSSpeedLimitConfigRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 访问限速配置,填写参数时配置ID不能为空 + DDoSSpeedLimitConfig *DDoSSpeedLimitConfig `json:"DDoSSpeedLimitConfig,omitempty" name:"DDoSSpeedLimitConfig"` +} + +func (r *DeleteDDoSSpeedLimitConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteDDoSSpeedLimitConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "DDoSSpeedLimitConfig") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteDDoSSpeedLimitConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DeleteDDoSSpeedLimitConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DeleteDDoSSpeedLimitConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteDDoSSpeedLimitConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DeletePacketFilterConfigRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 特征过滤配置 + PacketFilterConfig *PacketFilterConfig `json:"PacketFilterConfig,omitempty" name:"PacketFilterConfig"` +} + +func (r *DeletePacketFilterConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeletePacketFilterConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "PacketFilterConfig") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeletePacketFilterConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DeletePacketFilterConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DeletePacketFilterConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeletePacketFilterConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DeleteWaterPrintConfigRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` +} + +func (r *DeleteWaterPrintConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteWaterPrintConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteWaterPrintConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DeleteWaterPrintConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DeleteWaterPrintConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteWaterPrintConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DeleteWaterPrintKeyRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 水印密钥ID + KeyId *string `json:"KeyId,omitempty" name:"KeyId"` +} + +func (r *DeleteWaterPrintKeyRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteWaterPrintKeyRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "KeyId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteWaterPrintKeyRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DeleteWaterPrintKeyResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DeleteWaterPrintKeyResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteWaterPrintKeyResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeBasicDeviceStatusRequest struct { + *tchttp.BaseRequest + + // IP 资源列表 + IpList []*string `json:"IpList,omitempty" name:"IpList"` +} + +func (r *DescribeBasicDeviceStatusRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeBasicDeviceStatusRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IpList") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeBasicDeviceStatusRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeBasicDeviceStatusResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 返回资源及状态,状态码: + // 1 - 封堵状态 + // 2 - 正常状态 + // 3 - 攻击状态 + Data []*KeyValue `json:"Data,omitempty" name:"Data"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeBasicDeviceStatusResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeBasicDeviceStatusResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeBizTrendRequest struct { + *tchttp.BaseRequest + + // 统计方式,可取值max, min, avg, sum, 如统计纬度是流量速率或包量速率,仅可取值max + Statistics *string `json:"Statistics,omitempty" name:"Statistics"` + + // 大禹子产品代号(bgpip表示高防IP) + Business *string `json:"Business,omitempty" name:"Business"` + + // 统计周期,可取值300,1800,3600,21600,86400,单位秒 + Period *uint64 `json:"Period,omitempty" name:"Period"` + + // 统计开始时间。 例:“2020-09-22 00:00:00” + StartTime *string `json:"StartTime,omitempty" name:"StartTime"` + + // 统计结束时间。 例:“2020-09-22 00:00:00” + EndTime *string `json:"EndTime,omitempty" name:"EndTime"` + + // 资源实例ID + Id *string `json:"Id,omitempty" name:"Id"` + + // 统计纬度,可取值connum, new_conn, inactive_conn, intraffic, outtraffic, inpkg, outpkg, qps + MetricName *string `json:"MetricName,omitempty" name:"MetricName"` + + // 统计纬度为qps时,可选特定域名查询 + Domain *string `json:"Domain,omitempty" name:"Domain"` + + // 协议及端口列表,协议可取值TCP, UDP, HTTP, HTTPS,仅统计纬度为连接数时有效 + ProtoInfo []*ProtocolPort `json:"ProtoInfo,omitempty" name:"ProtoInfo"` +} + +func (r *DescribeBizTrendRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeBizTrendRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Statistics") + delete(f, "Business") + delete(f, "Period") + delete(f, "StartTime") + delete(f, "EndTime") + delete(f, "Id") + delete(f, "MetricName") + delete(f, "Domain") + delete(f, "ProtoInfo") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeBizTrendRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeBizTrendResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 曲线图各个时间点的值 + DataList []*float64 `json:"DataList,omitempty" name:"DataList"` + + // 统计纬度 + MetricName *string `json:"MetricName,omitempty" name:"MetricName"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeBizTrendResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeBizTrendResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeBlackWhiteIpListRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` +} + +func (r *DescribeBlackWhiteIpListRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeBlackWhiteIpListRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeBlackWhiteIpListRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeBlackWhiteIpListResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 黑名单IP列表 + BlackIpList []*string `json:"BlackIpList,omitempty" name:"BlackIpList"` + + // 白名单IP列表 + WhiteIpList []*string `json:"WhiteIpList,omitempty" name:"WhiteIpList"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeBlackWhiteIpListResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeBlackWhiteIpListResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeCCTrendRequest struct { + *tchttp.BaseRequest + + // 大禹子产品代号(bgpip表示高防IP;bgp表示独享包;bgp-multip表示共享包;net表示高防IP专业版;basic表示DDoS基础防护) + Business *string `json:"Business,omitempty" name:"Business"` + + // 资源的IP + Ip *string `json:"Ip,omitempty" name:"Ip"` + + // 统计粒度,取值[300(5分钟),3600(小时),86400(天)] + Period *int64 `json:"Period,omitempty" name:"Period"` + + // 统计开始时间 + StartTime *string `json:"StartTime,omitempty" name:"StartTime"` + + // 统计结束时间 + EndTime *string `json:"EndTime,omitempty" name:"EndTime"` + + // 指标,取值[inqps(总请求峰值,dropqps(攻击请求峰值)),incount(请求次数), dropcount(攻击次数)] + MetricName *string `json:"MetricName,omitempty" name:"MetricName"` + + // 域名,可选 + Domain *string `json:"Domain,omitempty" name:"Domain"` + + // 资源实例ID,当Business为basic时,此字段不用填写(因为基础防护没有资源实例) + Id *string `json:"Id,omitempty" name:"Id"` +} + +func (r *DescribeCCTrendRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeCCTrendRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Business") + delete(f, "Ip") + delete(f, "Period") + delete(f, "StartTime") + delete(f, "EndTime") + delete(f, "MetricName") + delete(f, "Domain") + delete(f, "Id") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeCCTrendRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeCCTrendResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 值个数 + Count *uint64 `json:"Count,omitempty" name:"Count"` + + // 大禹子产品代号(bgpip表示高防IP;bgp表示独享包;bgp-multip表示共享包;net表示高防IP专业版;basic表示DDoS基础防护) + Business *string `json:"Business,omitempty" name:"Business"` + + // 资源的IP + Ip *string `json:"Ip,omitempty" name:"Ip"` + + // 统计粒度,取值[300(5分钟),3600(小时),86400(天)] + Period *int64 `json:"Period,omitempty" name:"Period"` + + // 统计开始时间 + StartTime *string `json:"StartTime,omitempty" name:"StartTime"` + + // 统计结束时间 + EndTime *string `json:"EndTime,omitempty" name:"EndTime"` + + // 值数组 + Data []*uint64 `json:"Data,omitempty" name:"Data"` + + // 资源ID + // 注意:此字段可能返回 null,表示取不到有效值。 + Id *string `json:"Id,omitempty" name:"Id"` + + // 指标,取值[inqps(总请求峰值,dropqps(攻击请求峰值)),incount(请求次数), dropcount(攻击次数)] + MetricName *string `json:"MetricName,omitempty" name:"MetricName"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeCCTrendResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeCCTrendResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeDDoSBlackWhiteIpListRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` +} + +func (r *DescribeDDoSBlackWhiteIpListRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeDDoSBlackWhiteIpListRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDDoSBlackWhiteIpListRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeDDoSBlackWhiteIpListResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 黑名单IP列表 + BlackIpList []*IpSegment `json:"BlackIpList,omitempty" name:"BlackIpList"` + + // 白名单IP列表 + WhiteIpList []*IpSegment `json:"WhiteIpList,omitempty" name:"WhiteIpList"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeDDoSBlackWhiteIpListResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeDDoSBlackWhiteIpListResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeDDoSConnectLimitListRequest struct { + *tchttp.BaseRequest + + // 页起始偏移,取值为(页码-1)*一页条数 + Offset *uint64 `json:"Offset,omitempty" name:"Offset"` + + // 一页条数 + Limit *uint64 `json:"Limit,omitempty" name:"Limit"` + + // 可选参数,按照IP进行过滤 + FilterIp *string `json:"FilterIp,omitempty" name:"FilterIp"` + + // 可选参数,按照实例id进行过滤 + FilterInstanceId *string `json:"FilterInstanceId,omitempty" name:"FilterInstanceId"` +} + +func (r *DescribeDDoSConnectLimitListRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeDDoSConnectLimitListRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Offset") + delete(f, "Limit") + delete(f, "FilterIp") + delete(f, "FilterInstanceId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDDoSConnectLimitListRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeDDoSConnectLimitListResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 连接抑制配置总数 + Total *uint64 `json:"Total,omitempty" name:"Total"` + + // 连接抑制配置详情信息 + ConfigList []*ConnectLimitRelation `json:"ConfigList,omitempty" name:"ConfigList"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeDDoSConnectLimitListResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeDDoSConnectLimitListResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeDDoSTrendRequest struct { + *tchttp.BaseRequest + + // 大禹子产品代号(bgpip表示高防IP;bgp表示独享包;bgp-multip表示共享包;net表示高防IP专业版;basic表示DDoS基础防护) + Business *string `json:"Business,omitempty" name:"Business"` + + // 资源实例的IP + Ip *string `json:"Ip,omitempty" name:"Ip"` + + // 统计粒度,取值[300(5分钟),3600(小时),86400(天)] + Period *int64 `json:"Period,omitempty" name:"Period"` + + // 统计开始时间 + StartTime *string `json:"StartTime,omitempty" name:"StartTime"` + + // 统计结束时间 + EndTime *string `json:"EndTime,omitempty" name:"EndTime"` + + // 指标,取值[bps(攻击流量带宽,pps(攻击包速率))] + MetricName *string `json:"MetricName,omitempty" name:"MetricName"` + + // 资源实例ID,当Business为basic时,此字段不用填写(因为基础防护没有资源实例) + Id *string `json:"Id,omitempty" name:"Id"` +} + +func (r *DescribeDDoSTrendRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeDDoSTrendRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Business") + delete(f, "Ip") + delete(f, "Period") + delete(f, "StartTime") + delete(f, "EndTime") + delete(f, "MetricName") + delete(f, "Id") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDDoSTrendRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeDDoSTrendResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 值个数 + Count *uint64 `json:"Count,omitempty" name:"Count"` + + // 大禹子产品代号(bgpip表示高防IP;bgp表示独享包;bgp-multip表示共享包;net表示高防IP专业版;basic表示DDoS基础防护) + Business *string `json:"Business,omitempty" name:"Business"` + + // 资源的IP + Ip *string `json:"Ip,omitempty" name:"Ip"` + + // 统计粒度,取值[300(5分钟),3600(小时),86400(天)] + Period *int64 `json:"Period,omitempty" name:"Period"` + + // 统计开始时间 + StartTime *string `json:"StartTime,omitempty" name:"StartTime"` + + // 统计结束时间 + EndTime *string `json:"EndTime,omitempty" name:"EndTime"` + + // 值数组,攻击流量带宽单位为Mbps,包速率单位为pps + Data []*uint64 `json:"Data,omitempty" name:"Data"` + + // 资源ID + // 注意:此字段可能返回 null,表示取不到有效值。 + Id *string `json:"Id,omitempty" name:"Id"` + + // 指标,取值[bps(攻击流量带宽,pps(攻击包速率))] + MetricName *string `json:"MetricName,omitempty" name:"MetricName"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeDDoSTrendResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeDDoSTrendResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeDefaultAlarmThresholdRequest struct { + *tchttp.BaseRequest + + // 产品类型,取值[ + // bgp(表示高防包产品) + // bgpip(表示高防IP产品) + // ] + InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` + + // 告警阈值类型搜索,取值[ + // 1(入流量告警阈值) + // 2(攻击清洗流量告警阈值) + // ] + FilterAlarmType *int64 `json:"FilterAlarmType,omitempty" name:"FilterAlarmType"` +} + +func (r *DescribeDefaultAlarmThresholdRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeDefaultAlarmThresholdRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceType") + delete(f, "FilterAlarmType") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDefaultAlarmThresholdRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeDefaultAlarmThresholdResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 默认告警阈值配置 + DefaultAlarmConfigList []*DefaultAlarmThreshold `json:"DefaultAlarmConfigList,omitempty" name:"DefaultAlarmConfigList"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeDefaultAlarmThresholdResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeDefaultAlarmThresholdResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeL7RulesBySSLCertIdRequest struct { + *tchttp.BaseRequest + + // 域名状态,可取bindable, binded, opened, closed, all,all表示全部状态 + Status *string `json:"Status,omitempty" name:"Status"` + + // 证书ID列表 + CertIds []*string `json:"CertIds,omitempty" name:"CertIds"` +} + +func (r *DescribeL7RulesBySSLCertIdRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeL7RulesBySSLCertIdRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Status") + delete(f, "CertIds") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeL7RulesBySSLCertIdRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeL7RulesBySSLCertIdResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 证书规则集合 + CertSet []*CertIdInsL7Rules `json:"CertSet,omitempty" name:"CertSet"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeL7RulesBySSLCertIdResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeL7RulesBySSLCertIdResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListBGPIPInstancesRequest struct { + *tchttp.BaseRequest + + // 页起始偏移,取值为(页码-1)*一页条数 + Offset *uint64 `json:"Offset,omitempty" name:"Offset"` + + // 一页条数,当Limit=0时,默认一页条数为20;最大取值为100 + Limit *uint64 `json:"Limit,omitempty" name:"Limit"` + + // IP搜索 + FilterIp *string `json:"FilterIp,omitempty" name:"FilterIp"` + + // 资产实例ID搜索,例如,bgpip-00000001 + FilterInstanceId *string `json:"FilterInstanceId,omitempty" name:"FilterInstanceId"` + + // 高防IP线路搜索,取值为[ + // 1:BGP线路 + // 2:电信 + // 3:联通 + // 4:移动 + // 99:第三方合作线路 + // ] + FilterLine *uint64 `json:"FilterLine,omitempty" name:"FilterLine"` + + // 地域搜索,例如,ap-guangzhou + FilterRegion *string `json:"FilterRegion,omitempty" name:"FilterRegion"` + + // 名称搜索 + FilterName *string `json:"FilterName,omitempty" name:"FilterName"` + + // 是否只获取高防弹性公网IP实例。填写时,只能填写1或者0。当填写1时,表示返回高防弹性公网IP实例。当填写0时,表示返回非高防弹性公网IP实例。 + FilterEipType *int64 `json:"FilterEipType,omitempty" name:"FilterEipType"` + + // 高防弹性公网IP实例的绑定状态搜索条件,取值范围 [BINDING、 BIND、UNBINDING、UNBIND]。该搜索条件只在FilterEipType=1时才有效。 + FilterEipEipAddressStatus []*string `json:"FilterEipEipAddressStatus,omitempty" name:"FilterEipEipAddressStatus"` + + // 是否只获取安全加速实例。填写时,只能填写1或者0。当填写1时,表示返回安全加速实例。当填写0时,表示返回非安全加速实例。 + FilterDamDDoSStatus *int64 `json:"FilterDamDDoSStatus,omitempty" name:"FilterDamDDoSStatus"` + + // 获取特定状态的资源,运行中填idle,攻击中填attacking,封堵中填blocking + FilterStatus *string `json:"FilterStatus,omitempty" name:"FilterStatus"` +} + +func (r *DescribeListBGPIPInstancesRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListBGPIPInstancesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Offset") + delete(f, "Limit") + delete(f, "FilterIp") + delete(f, "FilterInstanceId") + delete(f, "FilterLine") + delete(f, "FilterRegion") + delete(f, "FilterName") + delete(f, "FilterEipType") + delete(f, "FilterEipEipAddressStatus") + delete(f, "FilterDamDDoSStatus") + delete(f, "FilterStatus") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeListBGPIPInstancesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListBGPIPInstancesResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 总数 + Total *uint64 `json:"Total,omitempty" name:"Total"` + + // 高防IP资产实例列表 + InstanceList []*BGPIPInstance `json:"InstanceList,omitempty" name:"InstanceList"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeListBGPIPInstancesResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListBGPIPInstancesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListBGPInstancesRequest struct { + *tchttp.BaseRequest + + // 页起始偏移,取值为(页码-1)*一页条数 + Offset *uint64 `json:"Offset,omitempty" name:"Offset"` + + // 一页条数,当Limit=0时,默认一页条数为20;最大取值为100 + Limit *uint64 `json:"Limit,omitempty" name:"Limit"` + + // IP搜索 + FilterIp *string `json:"FilterIp,omitempty" name:"FilterIp"` + + // 资产实例ID搜索,例如,bgp-00000001 + FilterInstanceId *string `json:"FilterInstanceId,omitempty" name:"FilterInstanceId"` + + // 地域搜索,例如,ap-guangzhou + FilterRegion *string `json:"FilterRegion,omitempty" name:"FilterRegion"` + + // 名称搜索 + FilterName *string `json:"FilterName,omitempty" name:"FilterName"` + + // 按照线路搜索, 1: BGP; 2: 三网 + FilterLine *uint64 `json:"FilterLine,omitempty" name:"FilterLine"` + + // 状态搜索,idle:允许中;attacking:攻击中;blocking:封堵中 + FilterStatus *string `json:"FilterStatus,omitempty" name:"FilterStatus"` + + // 高防包绑定状态搜索,bounding:绑定中; failed:绑定失败 + FilterBoundStatus *string `json:"FilterBoundStatus,omitempty" name:"FilterBoundStatus"` +} + +func (r *DescribeListBGPInstancesRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListBGPInstancesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Offset") + delete(f, "Limit") + delete(f, "FilterIp") + delete(f, "FilterInstanceId") + delete(f, "FilterRegion") + delete(f, "FilterName") + delete(f, "FilterLine") + delete(f, "FilterStatus") + delete(f, "FilterBoundStatus") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeListBGPInstancesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListBGPInstancesResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 总数 + Total *uint64 `json:"Total,omitempty" name:"Total"` + + // 高防包资产实例列表 + InstanceList []*BGPInstance `json:"InstanceList,omitempty" name:"InstanceList"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeListBGPInstancesResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListBGPInstancesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListBlackWhiteIpListRequest struct { + *tchttp.BaseRequest + + // 页起始偏移,取值为(页码-1)*一页条数 + Offset *int64 `json:"Offset,omitempty" name:"Offset"` + + // 一页条数,当Limit=0时,默认一页条数为100;最大取值为100 + Limit *int64 `json:"Limit,omitempty" name:"Limit"` + + // 资源实例ID搜索, 支持资源实例前缀通配搜索,例如bgp-*表示获取高防包类型的资源实例 + FilterInstanceId *string `json:"FilterInstanceId,omitempty" name:"FilterInstanceId"` + + // IP搜索 + FilterIp *string `json:"FilterIp,omitempty" name:"FilterIp"` +} + +func (r *DescribeListBlackWhiteIpListRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListBlackWhiteIpListRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Offset") + delete(f, "Limit") + delete(f, "FilterInstanceId") + delete(f, "FilterIp") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeListBlackWhiteIpListRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListBlackWhiteIpListResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 总数 + Total *int64 `json:"Total,omitempty" name:"Total"` + + // 黑白IP列表 + IpList []*BlackWhiteIpRelation `json:"IpList,omitempty" name:"IpList"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeListBlackWhiteIpListResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListBlackWhiteIpListResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListDDoSAIRequest struct { + *tchttp.BaseRequest + + // 页起始偏移,取值为(页码-1)*一页条数 + Offset *int64 `json:"Offset,omitempty" name:"Offset"` + + // 一页条数,当Limit=0时,默认一页条数为100;最大取值为100 + Limit *int64 `json:"Limit,omitempty" name:"Limit"` + + // 资源实例ID搜索, 支持资源实例前缀通配搜索,例如bgp-*表示获取高防包类型的资源实例 + FilterInstanceId *string `json:"FilterInstanceId,omitempty" name:"FilterInstanceId"` + + // IP搜索 + FilterIp *string `json:"FilterIp,omitempty" name:"FilterIp"` +} + +func (r *DescribeListDDoSAIRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListDDoSAIRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Offset") + delete(f, "Limit") + delete(f, "FilterInstanceId") + delete(f, "FilterIp") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeListDDoSAIRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListDDoSAIResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 总数 + Total *int64 `json:"Total,omitempty" name:"Total"` + + // AI防护开关列表 + ConfigList []*DDoSAIRelation `json:"ConfigList,omitempty" name:"ConfigList"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeListDDoSAIResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListDDoSAIResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListDDoSGeoIPBlockConfigRequest struct { + *tchttp.BaseRequest + + // 页起始偏移,取值为(页码-1)*一页条数 + Offset *uint64 `json:"Offset,omitempty" name:"Offset"` + + // 一页条数,当Limit=0时,默认一页条数为100;最大取值为100 + Limit *uint64 `json:"Limit,omitempty" name:"Limit"` + + // 资源实例ID搜索, 支持资源实例前缀通配搜索,例如bgp-*表示获取高防包类型的资源实例 + FilterInstanceId *string `json:"FilterInstanceId,omitempty" name:"FilterInstanceId"` + + // IP搜索 + FilterIp *string `json:"FilterIp,omitempty" name:"FilterIp"` +} + +func (r *DescribeListDDoSGeoIPBlockConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListDDoSGeoIPBlockConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Offset") + delete(f, "Limit") + delete(f, "FilterInstanceId") + delete(f, "FilterIp") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeListDDoSGeoIPBlockConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListDDoSGeoIPBlockConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 总数 + Total *uint64 `json:"Total,omitempty" name:"Total"` + + // DDoS区域封禁配置列表 + ConfigList []*DDoSGeoIPBlockConfigRelation `json:"ConfigList,omitempty" name:"ConfigList"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeListDDoSGeoIPBlockConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListDDoSGeoIPBlockConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListDDoSSpeedLimitConfigRequest struct { + *tchttp.BaseRequest + + // 页起始偏移,取值为(页码-1)*一页条数 + Offset *uint64 `json:"Offset,omitempty" name:"Offset"` + + // 一页条数,当Limit=0时,默认一页条数为100;最大取值为100 + Limit *uint64 `json:"Limit,omitempty" name:"Limit"` + + // 资源实例ID搜索, 支持资源实例前缀通配搜索,例如bgp-*表示获取高防包类型的资源实例 + FilterInstanceId *string `json:"FilterInstanceId,omitempty" name:"FilterInstanceId"` + + // IP搜索 + FilterIp *string `json:"FilterIp,omitempty" name:"FilterIp"` +} + +func (r *DescribeListDDoSSpeedLimitConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListDDoSSpeedLimitConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Offset") + delete(f, "Limit") + delete(f, "FilterInstanceId") + delete(f, "FilterIp") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeListDDoSSpeedLimitConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListDDoSSpeedLimitConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 总数 + Total *uint64 `json:"Total,omitempty" name:"Total"` + + // 访问限速配置列表 + ConfigList []*DDoSSpeedLimitConfigRelation `json:"ConfigList,omitempty" name:"ConfigList"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeListDDoSSpeedLimitConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListDDoSSpeedLimitConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListIPAlarmConfigRequest struct { + *tchttp.BaseRequest + + // 页起始偏移,取值为(页码-1)*一页条数 + Offset *int64 `json:"Offset,omitempty" name:"Offset"` + + // 一页条数,当Limit=0时,默认一页条数为100;最大取值为100 + Limit *int64 `json:"Limit,omitempty" name:"Limit"` + + // 资源实例ID搜索, 支持资源实例前缀通配搜索,例如bgp-*表示获取高防包类型的资源实例 + FilterInstanceId *string `json:"FilterInstanceId,omitempty" name:"FilterInstanceId"` + + // 告警阈值类型搜索,取值[ + // 1(入流量告警阈值) + // 2(攻击清洗流量告警阈值) + // ] + FilterAlarmType *int64 `json:"FilterAlarmType,omitempty" name:"FilterAlarmType"` + + // IP搜索 + FilterIp *string `json:"FilterIp,omitempty" name:"FilterIp"` +} + +func (r *DescribeListIPAlarmConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListIPAlarmConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Offset") + delete(f, "Limit") + delete(f, "FilterInstanceId") + delete(f, "FilterAlarmType") + delete(f, "FilterIp") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeListIPAlarmConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListIPAlarmConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 总数 + Total *int64 `json:"Total,omitempty" name:"Total"` + + // IP告警阈值配置列表 + ConfigList []*IPAlarmThresholdRelation `json:"ConfigList,omitempty" name:"ConfigList"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeListIPAlarmConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListIPAlarmConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListListenerRequest struct { + *tchttp.BaseRequest +} + +func (r *DescribeListListenerRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListListenerRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeListListenerRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListListenerResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 4层转发监听器列表 + Layer4Listeners []*Layer4Rule `json:"Layer4Listeners,omitempty" name:"Layer4Listeners"` + + // 7层转发监听器列表 + Layer7Listeners []*Layer7Rule `json:"Layer7Listeners,omitempty" name:"Layer7Listeners"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeListListenerResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListListenerResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListPacketFilterConfigRequest struct { + *tchttp.BaseRequest + + // 页起始偏移,取值为(页码-1)*一页条数 + Offset *int64 `json:"Offset,omitempty" name:"Offset"` + + // 一页条数,当Limit=0时,默认一页条数为100;最大取值为100 + Limit *int64 `json:"Limit,omitempty" name:"Limit"` + + // 资源实例ID搜索, 支持资源实例前缀通配搜索,例如bgp-*表示获取高防包类型的资源实例 + FilterInstanceId *string `json:"FilterInstanceId,omitempty" name:"FilterInstanceId"` + + // IP搜索 + FilterIp *string `json:"FilterIp,omitempty" name:"FilterIp"` +} + +func (r *DescribeListPacketFilterConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListPacketFilterConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Offset") + delete(f, "Limit") + delete(f, "FilterInstanceId") + delete(f, "FilterIp") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeListPacketFilterConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListPacketFilterConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 总数 + Total *int64 `json:"Total,omitempty" name:"Total"` + + // 特征过滤配置 + ConfigList []*PacketFilterRelation `json:"ConfigList,omitempty" name:"ConfigList"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeListPacketFilterConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListPacketFilterConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListPortAclListRequest struct { + *tchttp.BaseRequest + + // 页起始偏移,取值为(页码-1)*一页条数 + Offset *uint64 `json:"Offset,omitempty" name:"Offset"` + + // 一页条数,当Limit=0时,默认一页条数为100;最大取值为100 + Limit *uint64 `json:"Limit,omitempty" name:"Limit"` + + // 资源实例ID搜索, 支持资源实例前缀通配搜索,例如bgp-*表示获取高防包类型的资源实例 + FilterInstanceId *string `json:"FilterInstanceId,omitempty" name:"FilterInstanceId"` + + // ip搜索 + FilterIp *string `json:"FilterIp,omitempty" name:"FilterIp"` +} + +func (r *DescribeListPortAclListRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListPortAclListRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Offset") + delete(f, "Limit") + delete(f, "FilterInstanceId") + delete(f, "FilterIp") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeListPortAclListRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListPortAclListResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 总数 + Total *uint64 `json:"Total,omitempty" name:"Total"` + + // 端口acl策略 + AclList []*AclConfigRelation `json:"AclList,omitempty" name:"AclList"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeListPortAclListResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListPortAclListResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListProtectThresholdConfigRequest struct { + *tchttp.BaseRequest + + // 页起始偏移,取值为(页码-1)*一页条数 + Offset *uint64 `json:"Offset,omitempty" name:"Offset"` + + // 一页条数,当Limit=0时,默认一页条数为100;最大取值为100 + Limit *uint64 `json:"Limit,omitempty" name:"Limit"` + + // 资源实例ID搜索, 支持资源实例前缀通配搜索,例如bgp-*表示获取高防包类型的资源实例 + FilterInstanceId *string `json:"FilterInstanceId,omitempty" name:"FilterInstanceId"` + + // IP搜索 + FilterIp *string `json:"FilterIp,omitempty" name:"FilterIp"` + + // 域名搜索(查询域名与协议的CC防护阈值时使用) + FilterDomain *string `json:"FilterDomain,omitempty" name:"FilterDomain"` + + // 协议搜索(查询域名与协议的CC防护阈值时使用) + FilterProtocol *string `json:"FilterProtocol,omitempty" name:"FilterProtocol"` +} + +func (r *DescribeListProtectThresholdConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListProtectThresholdConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Offset") + delete(f, "Limit") + delete(f, "FilterInstanceId") + delete(f, "FilterIp") + delete(f, "FilterDomain") + delete(f, "FilterProtocol") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeListProtectThresholdConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListProtectThresholdConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 总记录数 + Total *uint64 `json:"Total,omitempty" name:"Total"` + + // 防护阈值配置列表 + ConfigList []*ProtectThresholdRelation `json:"ConfigList,omitempty" name:"ConfigList"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeListProtectThresholdConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListProtectThresholdConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListProtocolBlockConfigRequest struct { + *tchttp.BaseRequest + + // 页起始偏移,取值为(页码-1)*一页条数 + Offset *int64 `json:"Offset,omitempty" name:"Offset"` + + // 一页条数,当Limit=0时,默认一页条数为100;最大取值为100 + Limit *int64 `json:"Limit,omitempty" name:"Limit"` + + // 资源实例ID搜索, 支持资源实例前缀通配搜索,例如bgp-*表示获取高防包类型的资源实例 + FilterInstanceId *string `json:"FilterInstanceId,omitempty" name:"FilterInstanceId"` + + // IP搜索 + FilterIp *string `json:"FilterIp,omitempty" name:"FilterIp"` +} + +func (r *DescribeListProtocolBlockConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListProtocolBlockConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Offset") + delete(f, "Limit") + delete(f, "FilterInstanceId") + delete(f, "FilterIp") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeListProtocolBlockConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListProtocolBlockConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 总数 + Total *int64 `json:"Total,omitempty" name:"Total"` + + // 协议封禁配置 + ConfigList []*ProtocolBlockRelation `json:"ConfigList,omitempty" name:"ConfigList"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeListProtocolBlockConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListProtocolBlockConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListSchedulingDomainRequest struct { + *tchttp.BaseRequest + + // 页起始偏移,取值为(页码-1)*一页条数 + Offset *uint64 `json:"Offset,omitempty" name:"Offset"` + + // 一页条数,当Limit=0时,默认一页条数为20;最大取值为100 + Limit *uint64 `json:"Limit,omitempty" name:"Limit"` + + // 调度域名搜索 + FilterDomain *string `json:"FilterDomain,omitempty" name:"FilterDomain"` +} + +func (r *DescribeListSchedulingDomainRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListSchedulingDomainRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Offset") + delete(f, "Limit") + delete(f, "FilterDomain") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeListSchedulingDomainRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListSchedulingDomainResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 总数 + Total *uint64 `json:"Total,omitempty" name:"Total"` + + // 调度域名信息列表 + DomainList []*SchedulingDomainInfo `json:"DomainList,omitempty" name:"DomainList"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeListSchedulingDomainResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListSchedulingDomainResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListWaterPrintConfigRequest struct { + *tchttp.BaseRequest + + // 页起始偏移,取值为(页码-1)*一页条数 + Offset *int64 `json:"Offset,omitempty" name:"Offset"` + + // 一页条数,当Limit=0时,默认一页条数为100;最大取值为100 + Limit *int64 `json:"Limit,omitempty" name:"Limit"` + + // 资源实例ID搜索, 支持资源实例前缀通配搜索,例如bgp-*表示获取高防包类型的资源实例 + FilterInstanceId *string `json:"FilterInstanceId,omitempty" name:"FilterInstanceId"` + + // IP搜索 + FilterIp *string `json:"FilterIp,omitempty" name:"FilterIp"` +} + +func (r *DescribeListWaterPrintConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListWaterPrintConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Offset") + delete(f, "Limit") + delete(f, "FilterInstanceId") + delete(f, "FilterIp") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeListWaterPrintConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DescribeListWaterPrintConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 总数 + Total *int64 `json:"Total,omitempty" name:"Total"` + + // 水印配置列表 + ConfigList []*WaterPrintRelation `json:"ConfigList,omitempty" name:"ConfigList"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DescribeListWaterPrintConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeListWaterPrintConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type DisassociateDDoSEipAddressRequest struct { + *tchttp.BaseRequest + + // 资源实例ID,实例ID形如:bgpip-0000011x。只能填写高防IP实例。 + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 资源实例ID对应的高防弹性公网IP。 + Eip *string `json:"Eip,omitempty" name:"Eip"` +} + +func (r *DisassociateDDoSEipAddressRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DisassociateDDoSEipAddressRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "Eip") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisassociateDDoSEipAddressRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type DisassociateDDoSEipAddressResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *DisassociateDDoSEipAddressResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DisassociateDDoSEipAddressResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type EipAddressPackRelation struct { + + // 套餐IP数量 + IpCount *uint64 `json:"IpCount,omitempty" name:"IpCount"` + + // 自动续费标记 + AutoRenewFlag *uint64 `json:"AutoRenewFlag,omitempty" name:"AutoRenewFlag"` + + // 当前到期时间 + CurDeadline *string `json:"CurDeadline,omitempty" name:"CurDeadline"` +} + +type EipAddressRelation struct { + + // 高防弹性公网IP绑定的实例地区,例如hk代表香港 + // 注意:此字段可能返回 null,表示取不到有效值。 + EipAddressRegion *string `json:"EipAddressRegion,omitempty" name:"EipAddressRegion"` + + // 绑定的资源实例ID。可能是一个CVM。 + // 注意:此字段可能返回 null,表示取不到有效值。 + EipBoundRscIns *string `json:"EipBoundRscIns,omitempty" name:"EipBoundRscIns"` + + // 绑定的弹性网卡ID + // 注意:此字段可能返回 null,表示取不到有效值。 + EipBoundRscEni *string `json:"EipBoundRscEni,omitempty" name:"EipBoundRscEni"` + + // 绑定的资源内网ip + // 注意:此字段可能返回 null,表示取不到有效值。 + EipBoundRscVip *string `json:"EipBoundRscVip,omitempty" name:"EipBoundRscVip"` + + // 修改时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + ModifyTime *string `json:"ModifyTime,omitempty" name:"ModifyTime"` +} + +type EipProductInfo struct { + + // IP地址 + Ip *string `json:"Ip,omitempty" name:"Ip"` + + // 云产品类型,取值[ + // public(CVM产品), + // bm(黑石产品), + // eni(弹性网卡), + // vpngw(VPN网关), + // natgw(NAT网关), + // waf(Web应用安全产品), + // fpc(金融产品), + // gaap(GAAP产品), + // other(托管IP) + // ] + BizType *string `json:"BizType,omitempty" name:"BizType"` + + // 云产品子类型,取值[cvm(CVM),lb(负载均衡器),eni(弹性网卡),vpngw(VPN),natgw(NAT),waf(WAF),fpc(金融),gaap(GAAP),other(托管IP),eip(黑石弹性IP)] + DeviceType *string `json:"DeviceType,omitempty" name:"DeviceType"` + + // IP所属的云产品实例ID,例如是弹性网卡的IP,InstanceId为弹性网卡的ID(eni-*); 如果是托管IP没有对应的资源实例ID,InstanceId为"" + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` +} + +type ForwardListener struct { + + // 转发监听端口下限,取值1~65535 + FrontendPort *int64 `json:"FrontendPort,omitempty" name:"FrontendPort"` + + // 转发协议,取值[ + // TCP + // UDP + // ] + ForwardProtocol *string `json:"ForwardProtocol,omitempty" name:"ForwardProtocol"` + + // 转发监听端口上限,取值1~65535 + FrontendPortEnd *int64 `json:"FrontendPortEnd,omitempty" name:"FrontendPortEnd"` +} + +type IPAlarmThresholdRelation struct { + + // 告警阈值类型,取值[ + // 1(入流量告警阈值) + // 2(攻击清洗流量告警阈值) + // ] + AlarmType *uint64 `json:"AlarmType,omitempty" name:"AlarmType"` + + // 告警阈值,单位Mbps,取值>=0;当作为输入参数时,设置0会删除告警阈值配置; + AlarmThreshold *uint64 `json:"AlarmThreshold,omitempty" name:"AlarmThreshold"` + + // 告警阈值所属的资源实例 + InstanceDetailList []*InstanceRelation `json:"InstanceDetailList,omitempty" name:"InstanceDetailList"` +} + +type IPLineInfo struct { + + // IP线路类型,取值[ + // "bgp":BGP线路IP + // "ctcc":电信线路IP + // "cucc":联通线路IP + // "cmcc":移动线路IP + // "abroad":境外线路IP + // ] + Type *string `json:"Type,omitempty" name:"Type"` + + // 线路IP + Eip *string `json:"Eip,omitempty" name:"Eip"` +} + +type InsL7Rules struct { + + // 规则状态,0: 正常运行中, 1: 配置规则中(配置生效中), 2: 配置规则失败(配置生效失败), 3: 删除规则中(删除生效中), 5: 删除规则失败(删除失败), 6: 等待添加规则, 7: 等待删除规则, 8: 等待上传证书, 9: 规则对应的资源不存在,被隔离, 10:等待修改规则, 11:配置修改中 + Status *uint64 `json:"Status,omitempty" name:"Status"` + + // 域名 + Domain *string `json:"Domain,omitempty" name:"Domain"` + + // 协议 + Protocol *string `json:"Protocol,omitempty" name:"Protocol"` + + // 实例ID + InsId *string `json:"InsId,omitempty" name:"InsId"` + + // 用户AppID + AppId *string `json:"AppId,omitempty" name:"AppId"` + + // 高防端口 + VirtualPort *string `json:"VirtualPort,omitempty" name:"VirtualPort"` + + // 证书ID + SSLId *string `json:"SSLId,omitempty" name:"SSLId"` +} + +type InstanceRelation struct { + + // 资源实例的IP + EipList []*string `json:"EipList,omitempty" name:"EipList"` + + // 资源实例的ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` +} + +type IpSegment struct { + + // ip地址 + Ip *string `json:"Ip,omitempty" name:"Ip"` + + // ip掩码,如果为32位ip,填0 + Mask *uint64 `json:"Mask,omitempty" name:"Mask"` +} + +type KeyValue struct { + + // 字段名称 + Key *string `json:"Key,omitempty" name:"Key"` + + // 字段取值 + Value *string `json:"Value,omitempty" name:"Value"` +} + +type L4RuleSource struct { + + // 回源IP或域名 + Source *string `json:"Source,omitempty" name:"Source"` + + // 权重值,取值[0,100] + Weight *uint64 `json:"Weight,omitempty" name:"Weight"` + + // 8000 + // 注意:此字段可能返回 null,表示取不到有效值。 + Port *uint64 `json:"Port,omitempty" name:"Port"` +} + +type L7RuleEntry struct { + + // 会话保持时间,单位秒 + KeepTime *uint64 `json:"KeepTime,omitempty" name:"KeepTime"` + + // 转发域名 + Domain *string `json:"Domain,omitempty" name:"Domain"` + + // 转发协议,取值[http, https] + Protocol *string `json:"Protocol,omitempty" name:"Protocol"` + + // 回源方式,取值[1(域名回源),2(IP回源)] + SourceType *uint64 `json:"SourceType,omitempty" name:"SourceType"` + + // 负载均衡方式,取值[1(加权轮询)] + LbType *uint64 `json:"LbType,omitempty" name:"LbType"` + + // 回源列表 + SourceList []*L4RuleSource `json:"SourceList,omitempty" name:"SourceList"` + + // 会话保持开关,取值[0(会话保持关闭),1(会话保持开启)] + KeepEnable *uint64 `json:"KeepEnable,omitempty" name:"KeepEnable"` + + // 规则状态,取值[0(规则配置成功),1(规则配置生效中),2(规则配置失败),3(规则删除生效中),5(规则删除失败),6(规则等待配置),7(规则等待删除),8(规则待配置证书)] + Status *uint64 `json:"Status,omitempty" name:"Status"` + + // 规则ID,当添加新规则时可以不用填写此字段;当修改或者删除规则时需要填写此字段; + RuleId *string `json:"RuleId,omitempty" name:"RuleId"` + + // HTTPS协议的CC防护阈值 + CCThreshold *uint64 `json:"CCThreshold,omitempty" name:"CCThreshold"` + + // 当证书来源为自有证书时,此字段必须填写证书密钥;(因已不再支持自有证书,此字段已弃用,请不用填写此字段) + PrivateKey *string `json:"PrivateKey,omitempty" name:"PrivateKey"` + + // HTTPS协议的CC防护状态,取值[0(关闭), 1(开启)] + CCEnable *uint64 `json:"CCEnable,omitempty" name:"CCEnable"` + + // 是否开启Https协议使用Http回源,取值[0(关闭), 1(开启)],不填写默认是关闭 + // 注意:此字段可能返回 null,表示取不到有效值。 + HttpsToHttpEnable *uint64 `json:"HttpsToHttpEnable,omitempty" name:"HttpsToHttpEnable"` + + // 证书来源,当转发协议为https时必须填,取值[2(腾讯云托管证书)],当转发协议为http时也可以填0 + CertType *uint64 `json:"CertType,omitempty" name:"CertType"` + + // 当证书来源为自有证书时,此字段必须填写证书内容;(因已不再支持自有证书,此字段已弃用,请不用填写此字段) + Cert *string `json:"Cert,omitempty" name:"Cert"` + + // HTTPS协议的CC防护等级 + CCLevel *string `json:"CCLevel,omitempty" name:"CCLevel"` + + // 规则描述 + RuleName *string `json:"RuleName,omitempty" name:"RuleName"` + + // cc防护状态,取值[0(关闭), 1(开启)] + CCStatus *uint64 `json:"CCStatus,omitempty" name:"CCStatus"` + + // 接入端口值 + // 注意:此字段可能返回 null,表示取不到有效值。 + VirtualPort *uint64 `json:"VirtualPort,omitempty" name:"VirtualPort"` + + // 当证书来源为腾讯云托管证书时,此字段必须填写托管证书ID + SSLId *string `json:"SSLId,omitempty" name:"SSLId"` + + // 同ruleId + Id *string `json:"Id,omitempty" name:"Id"` +} + +type Layer4Rule struct { + + // 源站端口,取值1~65535 + BackendPort *uint64 `json:"BackendPort,omitempty" name:"BackendPort"` + + // 转发端口,取值1~65535 + FrontendPort *uint64 `json:"FrontendPort,omitempty" name:"FrontendPort"` + + // 转发协议,取值[ + // TCP(TCP协议) + // UDP(UDP协议) + // ] + Protocol *string `json:"Protocol,omitempty" name:"Protocol"` + + // 源站列表 + RealServers []*SourceServer `json:"RealServers,omitempty" name:"RealServers"` + + // 规则所属的资源实例 + InstanceDetails []*InstanceRelation `json:"InstanceDetails,omitempty" name:"InstanceDetails"` +} + +type Layer7Rule struct { + + // 域名 + Domain *string `json:"Domain,omitempty" name:"Domain"` + + // 转发类型列表 + ProxyTypeList []*ProxyTypeInfo `json:"ProxyTypeList,omitempty" name:"ProxyTypeList"` + + // 源站列表 + RealServers []*SourceServer `json:"RealServers,omitempty" name:"RealServers"` + + // 规则所属的资源实例 + InstanceDetails []*InstanceRelation `json:"InstanceDetails,omitempty" name:"InstanceDetails"` +} + +type ListenerCcThreholdConfig struct { + + // 域名 + Domain *string `json:"Domain,omitempty" name:"Domain"` + + // 协议(可取值htttps) + Protocol *string `json:"Protocol,omitempty" name:"Protocol"` + + // 开关状态(0:关闭,1:开启) + CCEnable *int64 `json:"CCEnable,omitempty" name:"CCEnable"` + + // cc防护阈值 + CCThreshold *int64 `json:"CCThreshold,omitempty" name:"CCThreshold"` +} + +type ModifyDDoSGeoIPBlockConfigRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // DDoS区域封禁配置,填写参数时配置ID不能为空 + DDoSGeoIPBlockConfig *DDoSGeoIPBlockConfig `json:"DDoSGeoIPBlockConfig,omitempty" name:"DDoSGeoIPBlockConfig"` +} + +func (r *ModifyDDoSGeoIPBlockConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyDDoSGeoIPBlockConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "DDoSGeoIPBlockConfig") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyDDoSGeoIPBlockConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type ModifyDDoSGeoIPBlockConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *ModifyDDoSGeoIPBlockConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyDDoSGeoIPBlockConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type ModifyDDoSSpeedLimitConfigRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 访问限速配置,填写参数时配置ID不能为空 + DDoSSpeedLimitConfig *DDoSSpeedLimitConfig `json:"DDoSSpeedLimitConfig,omitempty" name:"DDoSSpeedLimitConfig"` +} + +func (r *ModifyDDoSSpeedLimitConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyDDoSSpeedLimitConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "DDoSSpeedLimitConfig") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyDDoSSpeedLimitConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type ModifyDDoSSpeedLimitConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *ModifyDDoSSpeedLimitConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyDDoSSpeedLimitConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type ModifyDomainUsrNameRequest struct { + *tchttp.BaseRequest + + // 用户CNAME + DomainName *string `json:"DomainName,omitempty" name:"DomainName"` + + // 域名名称 + DomainUserName *string `json:"DomainUserName,omitempty" name:"DomainUserName"` +} + +func (r *ModifyDomainUsrNameRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyDomainUsrNameRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DomainName") + delete(f, "DomainUserName") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyDomainUsrNameRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type ModifyDomainUsrNameResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *ModifyDomainUsrNameResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyDomainUsrNameResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type ModifyL7RulesEdgeRequest struct { + *tchttp.BaseRequest + + // 大禹子产品代号(edge表示边界防护产品) + Business *string `json:"Business,omitempty" name:"Business"` + + // 资源ID + Id *string `json:"Id,omitempty" name:"Id"` + + // 规则 + Rule *L7RuleEntry `json:"Rule,omitempty" name:"Rule"` +} + +func (r *ModifyL7RulesEdgeRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyL7RulesEdgeRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Business") + delete(f, "Id") + delete(f, "Rule") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyL7RulesEdgeRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type ModifyL7RulesEdgeResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 成功码 + Success *SuccessCode `json:"Success,omitempty" name:"Success"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *ModifyL7RulesEdgeResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyL7RulesEdgeResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type ModifyNewDomainRulesRequest struct { + *tchttp.BaseRequest + + // 大禹子产品代号(bgpip表示高防IP) + Business *string `json:"Business,omitempty" name:"Business"` + + // 资源ID + Id *string `json:"Id,omitempty" name:"Id"` + + // 域名转发规则 + Rule *NewL7RuleEntry `json:"Rule,omitempty" name:"Rule"` +} + +func (r *ModifyNewDomainRulesRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyNewDomainRulesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Business") + delete(f, "Id") + delete(f, "Rule") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyNewDomainRulesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type ModifyNewDomainRulesResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 成功码 + Success *SuccessCode `json:"Success,omitempty" name:"Success"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *ModifyNewDomainRulesResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyNewDomainRulesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type ModifyPacketFilterConfigRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 特征过滤配置 + PacketFilterConfig *PacketFilterConfig `json:"PacketFilterConfig,omitempty" name:"PacketFilterConfig"` +} + +func (r *ModifyPacketFilterConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyPacketFilterConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "PacketFilterConfig") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyPacketFilterConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type ModifyPacketFilterConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *ModifyPacketFilterConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyPacketFilterConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type NewL7RuleEntry struct { + + // 会话保持时间,单位秒 + KeepTime *uint64 `json:"KeepTime,omitempty" name:"KeepTime"` + + // 负载均衡方式,取值[1(加权轮询)] + LbType *uint64 `json:"LbType,omitempty" name:"LbType"` + + // 回源列表 + SourceList []*L4RuleSource `json:"SourceList,omitempty" name:"SourceList"` + + // 会话保持开关,取值[0(会话保持关闭),1(会话保持开启)] + KeepEnable *uint64 `json:"KeepEnable,omitempty" name:"KeepEnable"` + + // 转发域名 + Domain *string `json:"Domain,omitempty" name:"Domain"` + + // 转发协议,取值[http, https] + Protocol *string `json:"Protocol,omitempty" name:"Protocol"` + + // 回源方式,取值[1(域名回源),2(IP回源)] + SourceType *uint64 `json:"SourceType,omitempty" name:"SourceType"` + + // 是否开启Https协议使用Http回源,取值[0(关闭), 1(开启)],不填写默认是关闭 + HttpsToHttpEnable *uint64 `json:"HttpsToHttpEnable,omitempty" name:"HttpsToHttpEnable"` + + // 规则状态,取值[0(规则配置成功),1(规则配置生效中),2(规则配置失败),3(规则删除生效中),5(规则删除失败),6(规则等待配置),7(规则等待删除),8(规则待配置证书)] + Status *uint64 `json:"Status,omitempty" name:"Status"` + + // HTTPS协议的CC防护等级 + CCLevel *string `json:"CCLevel,omitempty" name:"CCLevel"` + + // HTTPS协议的CC防护状态,取值[0(关闭), 1(开启)] + CCEnable *uint64 `json:"CCEnable,omitempty" name:"CCEnable"` + + // HTTPS协议的CC防护阈值 + CCThreshold *uint64 `json:"CCThreshold,omitempty" name:"CCThreshold"` + + // 区域码 + Region *uint64 `json:"Region,omitempty" name:"Region"` + + // 规则描述 + RuleName *string `json:"RuleName,omitempty" name:"RuleName"` + + // 当证书来源为自有证书时,此字段必须填写证书内容;(因已不再支持自有证书,此字段已弃用,请不用填写此字段) + Cert *string `json:"Cert,omitempty" name:"Cert"` + + // 修改时间 + ModifyTime *string `json:"ModifyTime,omitempty" name:"ModifyTime"` + + // 规则ID,当添加新规则时可以不用填写此字段;当修改或者删除规则时需要填写此字段; + RuleId *string `json:"RuleId,omitempty" name:"RuleId"` + + // 资源Ip + Ip *string `json:"Ip,omitempty" name:"Ip"` + + // 当证书来源为自有证书时,此字段必须填写证书密钥;(因已不再支持自有证书,此字段已弃用,请不用填写此字段) + PrivateKey *string `json:"PrivateKey,omitempty" name:"PrivateKey"` + + // 证书来源,当转发协议为https时必须填,取值[2(腾讯云托管证书)],当转发协议为http时也可以填0 + CertType *uint64 `json:"CertType,omitempty" name:"CertType"` + + // 接入端口值 + // 注意:此字段可能返回 null,表示取不到有效值。 + VirtualPort *uint64 `json:"VirtualPort,omitempty" name:"VirtualPort"` + + // cc防护状态,取值[0(关闭), 1(开启)] + CCStatus *uint64 `json:"CCStatus,omitempty" name:"CCStatus"` + + // 当证书来源为腾讯云托管证书时,此字段必须填写托管证书ID + SSLId *string `json:"SSLId,omitempty" name:"SSLId"` + + // 资源Id + Id *string `json:"Id,omitempty" name:"Id"` +} + +type PackInfo struct { + + // 套餐包的类型,取值[ + // staticpack:高防IP三网套餐包 + // insurance:保险套餐包 + // ] + PackType *string `json:"PackType,omitempty" name:"PackType"` + + // 套餐包的ID + PackId *string `json:"PackId,omitempty" name:"PackId"` +} + +type PacketFilterConfig struct { + + // 协议,取值[tcp udp icmp all] + Protocol *string `json:"Protocol,omitempty" name:"Protocol"` + + // 起始源端口,取值0~65535 + SportStart *int64 `json:"SportStart,omitempty" name:"SportStart"` + + // 结束源端口,取值1~65535,必须大于等于起始源端口 + SportEnd *int64 `json:"SportEnd,omitempty" name:"SportEnd"` + + // 起始目的端口,取值0~65535 + DportStart *int64 `json:"DportStart,omitempty" name:"DportStart"` + + // 结束目的端口,取值1~65535,必须大于等于起始目的端口 + DportEnd *int64 `json:"DportEnd,omitempty" name:"DportEnd"` + + // 最小报文长度,取值1-1500 + PktlenMin *int64 `json:"PktlenMin,omitempty" name:"PktlenMin"` + + // 最大报文长度,取值1-1500,必须大于等于最小报文长度 + PktlenMax *int64 `json:"PktlenMax,omitempty" name:"PktlenMax"` + + // 动作,取值[ + // drop(丢弃) + // transmit(放行) + // drop_black(丢弃并拉黑) + // drop_rst(拦截) + // drop_black_rst(拦截并拉黑) + // forward(继续防护) + // ] + Action *string `json:"Action,omitempty" name:"Action"` + + // 检测位置,取值[ + // begin_l3(IP头) + // begin_l4(TCP/UDP头) + // begin_l5(T载荷) + // no_match(不匹配) + // ] + MatchBegin *string `json:"MatchBegin,omitempty" name:"MatchBegin"` + + // 检测类型,取值[ + // sunday(关键字) + // pcre(正则表达式) + // ] + MatchType *string `json:"MatchType,omitempty" name:"MatchType"` + + // 检测值,关键字符串或正则表达式,取值[ + // 当检测类型为sunday时,请填写字符串或者16进制字节码,例如\x313233对应的是字符串"123"的16进制字节码; + // 当检测类型为pcre时, 请填写正则表达式字符串; + // ] + Str *string `json:"Str,omitempty" name:"Str"` + + // 从检测位置开始的检测深度,取值[0,1500] + Depth *int64 `json:"Depth,omitempty" name:"Depth"` + + // 从检测位置开始的偏移量,取值范围[0,Depth] + Offset *int64 `json:"Offset,omitempty" name:"Offset"` + + // 是否包含检测值,取值[ + // 0(包含) + // 1(不包含) + // ] + IsNot *int64 `json:"IsNot,omitempty" name:"IsNot"` + + // 当有第二个检测条件时,与第一检测条件的且或关系,取值[ + // and(且的关系) + // none(当没有第二个检测条件时填写此值) + // ] + MatchLogic *string `json:"MatchLogic,omitempty" name:"MatchLogic"` + + // 第二个检测位置,取值[ + // begin_l5(载荷) + // no_match(不匹配) + // ] + MatchBegin2 *string `json:"MatchBegin2,omitempty" name:"MatchBegin2"` + + // 第二个检测类型,取值[ + // sunday(关键字) + // pcre(正则表达式) + // ] + MatchType2 *string `json:"MatchType2,omitempty" name:"MatchType2"` + + // 第二个检测值,关键字符串或正则表达式,取值[ + // 当检测类型为sunday时,请填写字符串或者16进制字节码,例如\x313233对应的是字符串"123"的16进制字节码; + // 当检测类型为pcre时, 请填写正则表达式字符串; + // ] + Str2 *string `json:"Str2,omitempty" name:"Str2"` + + // 从第二个检测位置开始的第二个检测深度,取值[0,1500] + Depth2 *int64 `json:"Depth2,omitempty" name:"Depth2"` + + // 从第二个检测位置开始的偏移量,取值范围[0,Depth2] + Offset2 *int64 `json:"Offset2,omitempty" name:"Offset2"` + + // 第二个检测是否包含检测值,取值[ + // 0(包含) + // 1(不包含) + // ] + IsNot2 *int64 `json:"IsNot2,omitempty" name:"IsNot2"` + + // 特征过滤配置添加成功后自动生成的规则ID,当添加新特征过滤配置时,此字段不用填写; + Id *string `json:"Id,omitempty" name:"Id"` +} + +type PacketFilterRelation struct { + + // 特征过滤配置 + PacketFilterConfig *PacketFilterConfig `json:"PacketFilterConfig,omitempty" name:"PacketFilterConfig"` + + // 特征过滤配置所属的实例 + InstanceDetailList []*InstanceRelation `json:"InstanceDetailList,omitempty" name:"InstanceDetailList"` +} + +type PortSegment struct { + + // 起始端口,取值1~65535 + BeginPort *uint64 `json:"BeginPort,omitempty" name:"BeginPort"` + + // 结束端口,取值1~65535,必须不小于起始端口 + EndPort *uint64 `json:"EndPort,omitempty" name:"EndPort"` +} + +type ProtectThresholdRelation struct { + + // DDoS防护等级,取值[ + // low(宽松) + // middle(适中) + // high(严格) + // ] + DDoSLevel *string `json:"DDoSLevel,omitempty" name:"DDoSLevel"` + + // DDoS清洗阈值,单位Mbps + DDoSThreshold *uint64 `json:"DDoSThreshold,omitempty" name:"DDoSThreshold"` + + // DDoS的AI防护开关,取值[ + // on(开启) + // off(关闭) + // ] + DDoSAI *string `json:"DDoSAI,omitempty" name:"DDoSAI"` + + // CC清洗开关,取值[ + // 0(关闭) + // 1(开启) + // ] + CCEnable *uint64 `json:"CCEnable,omitempty" name:"CCEnable"` + + // CC清洗阈值,单位QPS + CCThreshold *uint64 `json:"CCThreshold,omitempty" name:"CCThreshold"` + + // 所属的资源实例 + InstanceDetailList []*InstanceRelation `json:"InstanceDetailList,omitempty" name:"InstanceDetailList"` + + // 域名与协议纬度的防护阈值 + ListenerCcThresholdList []*ListenerCcThreholdConfig `json:"ListenerCcThresholdList,omitempty" name:"ListenerCcThresholdList"` +} + +type ProtocolBlockConfig struct { + + // TCP封禁,取值[0(封禁关),1(封禁开)] + DropTcp *int64 `json:"DropTcp,omitempty" name:"DropTcp"` + + // UDP封禁,取值[0(封禁关),1(封禁开)] + DropUdp *int64 `json:"DropUdp,omitempty" name:"DropUdp"` + + // ICMP封禁,取值[0(封禁关),1(封禁开)] + DropIcmp *int64 `json:"DropIcmp,omitempty" name:"DropIcmp"` + + // 其他协议封禁,取值[0(封禁关),1(封禁开)] + DropOther *int64 `json:"DropOther,omitempty" name:"DropOther"` + + // 异常空连接防护,取值[0(防护关),1(防护开)] + CheckExceptNullConnect *int64 `json:"CheckExceptNullConnect,omitempty" name:"CheckExceptNullConnect"` +} + +type ProtocolBlockRelation struct { + + // 协议封禁配置 + ProtocolBlockConfig *ProtocolBlockConfig `json:"ProtocolBlockConfig,omitempty" name:"ProtocolBlockConfig"` + + // 协议封禁配置所属的实例 + InstanceDetailList []*InstanceRelation `json:"InstanceDetailList,omitempty" name:"InstanceDetailList"` +} + +type ProtocolPort struct { + + // 协议(tcp;udp) + Protocol *string `json:"Protocol,omitempty" name:"Protocol"` + + // 端口 + Port *uint64 `json:"Port,omitempty" name:"Port"` +} + +type ProxyTypeInfo struct { + + // 转发监听端口列表,端口取值1~65535 + ProxyPorts []*int64 `json:"ProxyPorts,omitempty" name:"ProxyPorts"` + + // 转发协议,取值[ + // http(HTTP协议) + // https(HTTPS协议) + // ] + ProxyType *string `json:"ProxyType,omitempty" name:"ProxyType"` +} + +type RegionInfo struct { + + // 地域名称,例如,ap-guangzhou + Region *string `json:"Region,omitempty" name:"Region"` +} + +type SchedulingDomainInfo struct { + + // 调度域名 + Domain *string `json:"Domain,omitempty" name:"Domain"` + + // 线路IP列表 + LineIPList []*IPLineInfo `json:"LineIPList,omitempty" name:"LineIPList"` + + // 调度方式,当前仅支持优先级的方式,取值[priority] + Method *string `json:"Method,omitempty" name:"Method"` + + // 调度域名解析记录的TTL值 + TTL *uint64 `json:"TTL,omitempty" name:"TTL"` + + // 运行状态,取值[ + // 0:未运行 + // 1:运行中 + // 2:运行异常 + // ] + Status *uint64 `json:"Status,omitempty" name:"Status"` + + // 创建时间 + CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` + + // 最后修改时间 + ModifyTime *string `json:"ModifyTime,omitempty" name:"ModifyTime"` + + // 域名名称 + // 注意:此字段可能返回 null,表示取不到有效值。 + UsrDomainName *string `json:"UsrDomainName,omitempty" name:"UsrDomainName"` +} + +type SourceServer struct { + + // 源站的地址(IP或者域名) + RealServer *string `json:"RealServer,omitempty" name:"RealServer"` + + // 源站的地址类型,取值[ + // 1(域名地址) + // 2(IP地址) + // ] + RsType *int64 `json:"RsType,omitempty" name:"RsType"` + + // 源站的回源权重,取值1~100 + Weight *int64 `json:"Weight,omitempty" name:"Weight"` +} + +type SpeedValue struct { + + // 限速值类型,取值[ + // 1(包速率pps) + // 2(带宽bps) + // ] + Type *uint64 `json:"Type,omitempty" name:"Type"` + + // 值大小 + Value *uint64 `json:"Value,omitempty" name:"Value"` +} + +type StaticPackRelation struct { + + // 保底带宽 + // 注意:此字段可能返回 null,表示取不到有效值。 + ProtectBandwidth *uint64 `json:"ProtectBandwidth,omitempty" name:"ProtectBandwidth"` + + // 业务带宽 + // 注意:此字段可能返回 null,表示取不到有效值。 + NormalBandwidth *uint64 `json:"NormalBandwidth,omitempty" name:"NormalBandwidth"` + + // 转发规则 + // 注意:此字段可能返回 null,表示取不到有效值。 + ForwardRulesLimit *uint64 `json:"ForwardRulesLimit,omitempty" name:"ForwardRulesLimit"` + + // 自动续费标记 + // 注意:此字段可能返回 null,表示取不到有效值。 + AutoRenewFlag *uint64 `json:"AutoRenewFlag,omitempty" name:"AutoRenewFlag"` + + // 到期时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + CurDeadline *string `json:"CurDeadline,omitempty" name:"CurDeadline"` +} + +type SuccessCode struct { + + // 描述 + Message *string `json:"Message,omitempty" name:"Message"` + + // 成功/错误码 + Code *string `json:"Code,omitempty" name:"Code"` +} + +type SwitchWaterPrintConfigRequest struct { + *tchttp.BaseRequest + + // 资源实例ID + InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` + + // 水印开启/关闭状态,1表示开启;0表示关闭 + OpenStatus *int64 `json:"OpenStatus,omitempty" name:"OpenStatus"` +} + +func (r *SwitchWaterPrintConfigRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *SwitchWaterPrintConfigRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "InstanceId") + delete(f, "OpenStatus") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SwitchWaterPrintConfigRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +type SwitchWaterPrintConfigResponse struct { + *tchttp.BaseResponse + Response *struct { + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + } `json:"Response"` +} + +func (r *SwitchWaterPrintConfigResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *SwitchWaterPrintConfigResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type WaterPrintConfig struct { + + // 水印偏移量,取值范围[0, 100) + Offset *int64 `json:"Offset,omitempty" name:"Offset"` + + // 是否开启,取值[ + // 0(手动开启) + // 1(立即运行) + // ] + OpenStatus *int64 `json:"OpenStatus,omitempty" name:"OpenStatus"` + + // 水印所属的转发监听器列表 + Listeners []*ForwardListener `json:"Listeners,omitempty" name:"Listeners"` + + // 水印添加成功后生成的水印密钥列表,一条水印最少1个密钥,最多2个密钥 + Keys []*WaterPrintKey `json:"Keys,omitempty" name:"Keys"` + + // 水印检查模式, 取值[ + // checkall(普通模式) + // shortfpcheckall(精简模式) + // ] + Verify *string `json:"Verify,omitempty" name:"Verify"` +} + +type WaterPrintKey struct { + + // 密钥版本号 + KeyVersion *string `json:"KeyVersion,omitempty" name:"KeyVersion"` + + // 密钥内容 + KeyContent *string `json:"KeyContent,omitempty" name:"KeyContent"` + + // 密钥ID + KeyId *string `json:"KeyId,omitempty" name:"KeyId"` + + // 密钥启用状态,只有一个取值1(启用) + KeyOpenStatus *int64 `json:"KeyOpenStatus,omitempty" name:"KeyOpenStatus"` + + // 密钥生成时间 + CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` +} + +type WaterPrintRelation struct { + + // 水印配置 + WaterPrintConfig *WaterPrintConfig `json:"WaterPrintConfig,omitempty" name:"WaterPrintConfig"` + + // 水印配置所属的资源实例 + InstanceDetailList []*InstanceRelation `json:"InstanceDetailList,omitempty" name:"InstanceDetailList"` +} diff --git a/vendor/modules.txt b/vendor/modules.txt index f535c85070..c7a16edf06 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -529,6 +529,8 @@ github.com/stretchr/testify/mock github.com/subosito/gotenv # github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2 github.com/tdakkota/asciicheck +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos v1.0.334 +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/v20200309 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/api v1.0.285 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/api/v20201106 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway v1.0.199 From b4fdae0748e901eb43d6a71bce36d3a7aa3fa313 Mon Sep 17 00:00:00 2001 From: mikatong Date: Wed, 26 Jan 2022 20:36:32 +0800 Subject: [PATCH 2/4] feat: support ddos_v2 l3l4l7 --- tencentcloud/basic_test.go | 4 +- tencentcloud/connectivity/client.go | 15 + tencentcloud/data_source_tc_dayu_eip.go | 184 ++++++++++ tencentcloud/data_source_tc_dayu_eip_test.go | 41 +++ .../data_source_tc_dayu_l4_rules_v2.go | 6 +- .../data_source_tc_dayu_l7_rules_test.go | 78 ++-- .../data_source_tc_dayu_l7_rules_v2.go | 268 ++++++++++++++ tencentcloud/extension_ddos.go | 18 + tencentcloud/provider.go | 14 + tencentcloud/resource_tc_dayu_eip.go | 200 ++++++++++ tencentcloud/resource_tc_dayu_eip_test.go | 111 ++++++ tencentcloud/resource_tc_dayu_l4_rule_test.go | 3 - tencentcloud/resource_tc_dayu_l7_rule_v2.go | 346 ++++++++++++++++++ .../resource_tc_dayu_l7_rule_v2_test.go | 140 +++++++ tencentcloud/service_tencentcloud_antiddos.go | 148 ++++++++ tencentcloud/service_tencentcloud_dayu.go | 195 ++++++++++ website/docs/d/dayu_eip.html.markdown | 38 ++ website/docs/d/dayu_l4_rules_v2.html.markdown | 51 +++ website/docs/d/dayu_l7_rules_v2.html.markdown | 65 ++++ website/docs/r/dayu_eip.html.markdown | 51 +++ website/docs/r/dayu_l4_rule.html.markdown | 2 +- website/docs/r/dayu_l7_rule_v2.html.markdown | 72 ++++ website/tencentcloud.erb | 33 ++ 23 files changed, 2030 insertions(+), 53 deletions(-) create mode 100644 tencentcloud/data_source_tc_dayu_eip.go create mode 100644 tencentcloud/data_source_tc_dayu_eip_test.go create mode 100644 tencentcloud/data_source_tc_dayu_l7_rules_v2.go create mode 100644 tencentcloud/extension_ddos.go create mode 100644 tencentcloud/resource_tc_dayu_eip.go create mode 100644 tencentcloud/resource_tc_dayu_eip_test.go create mode 100644 tencentcloud/resource_tc_dayu_l7_rule_v2.go create mode 100644 tencentcloud/resource_tc_dayu_l7_rule_v2_test.go create mode 100644 tencentcloud/service_tencentcloud_antiddos.go create mode 100644 website/docs/d/dayu_eip.html.markdown create mode 100644 website/docs/d/dayu_l4_rules_v2.html.markdown create mode 100644 website/docs/d/dayu_l7_rules_v2.html.markdown create mode 100644 website/docs/r/dayu_eip.html.markdown create mode 100644 website/docs/r/dayu_l7_rule_v2.html.markdown diff --git a/tencentcloud/basic_test.go b/tencentcloud/basic_test.go index 3a1d453451..97e1a2974a 100644 --- a/tencentcloud/basic_test.go +++ b/tencentcloud/basic_test.go @@ -39,7 +39,9 @@ const ( defaultSecurityGroup = "sg-ijato2x1" defaultSecurityGroup2 = "sg-51rgzop1" - defaultProjectId = "1250480" + defaultProjectId = "1250480" + defaultDayuBgpIdV2 = "bgpip-000004x0" + defaultDayuBgpIpV2 = "119.28.217.253" ) /* diff --git a/tencentcloud/connectivity/client.go b/tencentcloud/connectivity/client.go index e2a34892bb..4617aefea1 100644 --- a/tencentcloud/connectivity/client.go +++ b/tencentcloud/connectivity/client.go @@ -13,6 +13,7 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" + antiddos "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/v20200309" api "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/api/v20201106" apigateway "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway/v20180808" as "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as/v20180419" @@ -104,6 +105,7 @@ type TencentCloudClient struct { clsConn *cls.Client dnsPodConn *dnspod.Client privateDnsConn *privatedns.Client + antiddosConn *antiddos.Client } // NewClientProfile returns a new ClientProfile @@ -678,3 +680,16 @@ func (me *TencentCloudClient) UsePrivateDnsClient() *privatedns.Client { return me.privateDnsConn } + +// UseAntiddosClient returns antiddos client for service +func (me *TencentCloudClient) UseAntiddosClient() *antiddos.Client { + if me.antiddosConn != nil { + return me.antiddosConn + } + + cpf := me.NewClientProfile(300) + me.antiddosConn, _ = antiddos.NewClient(me.Credential, me.Region, cpf) + me.antiddosConn.WithHttpTransport(&LogRoundTripper{}) + + return me.antiddosConn +} diff --git a/tencentcloud/data_source_tc_dayu_eip.go b/tencentcloud/data_source_tc_dayu_eip.go new file mode 100644 index 0000000000..166711af18 --- /dev/null +++ b/tencentcloud/data_source_tc_dayu_eip.go @@ -0,0 +1,184 @@ +/* +Use this data source to query dayu eip rules + +Example Usage + +```hcl +data "tencentcloud_dayu_eip" "test" { + resource_id="bgpip-000004xg" +} +``` +*/ +package tencentcloud + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func dataSourceTencentCloudDayuEip() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudDayuEipRead, + Schema: map[string]*schema.Schema{ + "resource_id": { + Type: schema.TypeString, + Required: true, + Description: "Id of the resource.", + }, + "bind_status": { + Type: schema.TypeList, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validateAllowedStringValue(DDOS_EIP_BIND_STATUS), + }, + Optional: true, + Description: "The binding state of the instance, value range [BINDING, BIND, UNBINDING, UNBIND], default is [BINDING, BIND, UNBINDING, UNBIND].", + }, + "offset": { + Type: schema.TypeInt, + Optional: true, + Default: 0, + Description: "The page start offset, default is `0`.", + }, + "limit": { + Type: schema.TypeInt, + Optional: true, + Default: 10, + Description: "The number of pages, default is `10`.", + }, + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + "list": { + Type: schema.TypeList, + Computed: true, + Description: "A list of layer 4 rules. Each element contains the following attributes:", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "eip_list": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + Description: "", + }, + }, + "instance_id": { + Type: schema.TypeString, + Optional: true, + Description: "ID of the resource instance.", + }, + "eip_bound_rsc_ins": { + Type: schema.TypeString, + Optional: true, + Description: "The ID of the resource instance for the binding.", + }, + "eip_bound_rsc_eni": { + Type: schema.TypeString, + Required: true, + Description: "The ID of the bound ENI.", + }, + "eip_bound_rsc_vip": { + Type: schema.TypeString, + Required: true, + Description: "Bind the resource intranet IP.", + }, + "created_time": { + Type: schema.TypeString, + Required: true, + Description: "The created time of resource.", + }, + "expired_time": { + Type: schema.TypeString, + Required: true, + Description: "The expired time of resource.", + }, + "modify_time": { + Type: schema.TypeString, + Required: true, + Description: "The modify time of resource.", + }, + "protection_status": { + Type: schema.TypeString, + Required: true, + Description: "The protection status of the asset instance.", + }, + "eip_address_status": { + Type: schema.TypeString, + Required: true, + Description: "Eip PUBLIC IP status.", + }, + "region": { + Type: schema.TypeString, + Required: true, + Description: "The region where the asset instance is located.", + }, + }, + }, + }, + }, + } +} + +func dataSourceTencentCloudDayuEipRead(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("data_source.tencentcloud_dayu_l4_rules.read")() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + resourceId := d.Get("resource_id").(string) + var bindStatus []string + if v, ok := d.GetOk("bind_status"); ok { + tmpBindStatusList := v.([]interface{}) + for _, tmpBindStatus := range tmpBindStatusList { + bindStatus = append(bindStatus, tmpBindStatus.(string)) + } + } else { + bindStatus = DDOS_EIP_BIND_STATUS + } + offset := d.Get("offset").(int) + limit := d.Get("limit").(int) + + antiddosService := AntiddosService{client: meta.(*TencentCloudClient).apiV3Conn} + result, err := antiddosService.DescribeListBGPIPInstances(ctx, resourceId, bindStatus, offset, limit) + if err != nil { + return err + } + resultList := make([]map[string]interface{}, 0) + for _, eipItem := range result { + tmpEipInfo := make(map[string]interface{}) + eipList := make([]string, 0) + for _, eip := range eipItem.InstanceDetail.EipList { + eipList = append(eipList, *eip) + } + tmpEipInfo["eip_list"] = eipList + tmpEipInfo["instance_id"] = *eipItem.InstanceDetail.InstanceId + tmpEipInfo["region"] = *eipItem.Region.Region + tmpEipInfo["eip_bound_rsc_ins"] = *eipItem.EipAddressInfo.EipBoundRscIns + tmpEipInfo["eip_bound_rsc_eni"] = *eipItem.EipAddressInfo.EipBoundRscEni + tmpEipInfo["eip_bound_rsc_vip"] = *eipItem.EipAddressInfo.EipBoundRscVip + tmpEipInfo["eip_address_status"] = *eipItem.EipAddressStatus + tmpEipInfo["protection_status"] = *eipItem.Status + tmpEipInfo["created_time"] = *eipItem.CreatedTime + tmpEipInfo["expired_time"] = *eipItem.ExpiredTime + tmpEipInfo["modify_time"] = *eipItem.EipAddressInfo.ModifyTime + + resultList = append(resultList, tmpEipInfo) + } + ids := make([]string, 0, len(resultList)) + for _, listItem := range resultList { + ids = append(ids, listItem["instance_id"].(string)) + } + d.SetId(helper.DataResourceIdsHash(ids)) + _ = d.Set("list", resultList) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + return writeToFile(output.(string), resultList) + } + return nil + +} diff --git a/tencentcloud/data_source_tc_dayu_eip_test.go b/tencentcloud/data_source_tc_dayu_eip_test.go new file mode 100644 index 0000000000..e2d36947ca --- /dev/null +++ b/tencentcloud/data_source_tc_dayu_eip_test.go @@ -0,0 +1,41 @@ +package tencentcloud + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +var testDataDayuEip = "data.tencentcloud_dayu_eip.test" + +func TestAccTencentCloudDataDayuEip(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckDayuEipDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTencentCloudDataDayuEip, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckDayuEipExists("tencentcloud_dayu_eip.test_eip"), + resource.TestCheckResourceAttr(testDataDayuEip, "list.#", "1"), + ), + }, + }, + }) +} + +const testAccTencentCloudDataDayuEip = ` +resource "tencentcloud_dayu_eip" "test_eip" { + resource_id = "bgpip-000004xg" + eip = "162.62.163.50" + bind_resource_id = "ins-4m0jvxic" + bind_resource_region = "hk" + bind_resource_type = "cvm" + } + +data "tencentcloud_dayu_eip" "test" { + resource_id = tencentcloud_dayu_eip.test_eip.resource_id +} +` diff --git a/tencentcloud/data_source_tc_dayu_l4_rules_v2.go b/tencentcloud/data_source_tc_dayu_l4_rules_v2.go index 970524e107..6ce72cf8d5 100644 --- a/tencentcloud/data_source_tc_dayu_l4_rules_v2.go +++ b/tencentcloud/data_source_tc_dayu_l4_rules_v2.go @@ -1,5 +1,5 @@ /* -Use this data source to query dayu layer 4 rules +Use this data source to query dayu new layer 4 rules Example Usage @@ -208,7 +208,9 @@ func dataSourceTencentCloudDayuL4RulesReadV2(d *schema.ResourceData, meta interf list = append(list, tmpRule) } ids := make([]string, 0, len(list)) - + for _, listItem := range list { + ids = append(ids, listItem["rule_id"].(string)) + } d.SetId(helper.DataResourceIdsHash(ids)) if e := d.Set("list", list); e != nil { log.Printf("[CRITAL]%s provider set rules fail, reason:%s\n", logId, e.Error()) diff --git a/tencentcloud/data_source_tc_dayu_l7_rules_test.go b/tencentcloud/data_source_tc_dayu_l7_rules_test.go index 7bc4ae8486..eb03548b21 100644 --- a/tencentcloud/data_source_tc_dayu_l7_rules_test.go +++ b/tencentcloud/data_source_tc_dayu_l7_rules_test.go @@ -1,71 +1,57 @@ package tencentcloud import ( - "fmt" "testing" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -var testDataDayuL7RulesName = "data.tencentcloud_dayu_l7_rules.id_test" +var testDataDayuL7RulesV2Name = "data.tencentcloud_dayu_l7_rules_v2.test" func TestAccTencentCloudDataDayuL7Rules(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckDayuL7RuleDestroy, + CheckDestroy: testAccCheckDayuL7RuleV2Destroy, Steps: []resource.TestStep{ { - Config: fmt.Sprintf(testAccTencentCloudDataDayuL7RulesBaic, defaultDayuBgpIp, defaultSshCertificate), + Config: testAccTencentCloudDataDayuL7RulesV2Baic, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckDayuL7RuleExists("tencentcloud_dayu_l7_rule.test_rule"), - resource.TestCheckResourceAttr(testDataDayuL7RulesName, "list.#", "1"), - resource.TestCheckResourceAttr(testDataDayuL7RulesName, "list.0.name", "rule_test"), - resource.TestCheckResourceAttr(testDataDayuL7RulesName, "list.0.switch", "true"), - resource.TestCheckResourceAttr(testDataDayuL7RulesName, "list.0.domain", "zhaoshaona.com"), - resource.TestCheckResourceAttr(testDataDayuL7RulesName, "list.0.source_type", "2"), - resource.TestCheckResourceAttr(testDataDayuL7RulesName, "list.0.protocol", "https"), - resource.TestCheckResourceAttr(testDataDayuL7RulesName, "list.0.ssl_id", defaultSshCertificate), - resource.TestCheckResourceAttrSet(testDataDayuL7RulesName, "list.0.status"), - resource.TestCheckResourceAttr(testDataDayuL7RulesName, "list.0.source_list.#", "2"), - resource.TestCheckResourceAttr(testDataDayuL7RulesName, "list.0.health_check_switch", "true"), - resource.TestCheckResourceAttr(testDataDayuL7RulesName, "list.0.health_check_interval", "30"), - resource.TestCheckResourceAttr(testDataDayuL7RulesName, "list.0.health_check_code", "31"), - resource.TestCheckResourceAttr(testDataDayuL7RulesName, "list.0.health_check_health_num", "5"), - resource.TestCheckResourceAttr(testDataDayuL7RulesName, "list.0.health_check_unhealth_num", "10"), - resource.TestCheckResourceAttr(testDataDayuL7RulesName, "list.0.health_check_path", "/"), - resource.TestCheckResourceAttr(testDataDayuL7RulesName, "list.0.health_check_method", "GET"), + testAccCheckDayuL7RuleV2Exists("tencentcloud_dayu_l7_rule_v2.test_rule"), + resource.TestCheckResourceAttr(testDataDayuL7RulesV2Name, "list.#", "1"), ), }, }, }) } -const testAccTencentCloudDataDayuL7RulesBaic = ` -resource "tencentcloud_dayu_l7_rule" "test_rule" { - resource_type = "bgpip" - resource_id = "%s" - name = "rule_test" - domain = "zhaoshaona.com" - protocol = "https" - switch = true - source_type = 2 - source_list = ["1.1.1.1:80","2.2.2.2"] - ssl_id = "%s" - health_check_switch = true - health_check_code = 31 - health_check_interval = 30 - health_check_method = "GET" - health_check_path = "/" - health_check_health_num = 5 - health_check_unhealth_num = 10 -} - -data "tencentcloud_dayu_l7_rules" "id_test" { - resource_type = tencentcloud_dayu_l7_rule.test_rule.resource_type - resource_id = tencentcloud_dayu_l7_rule.test_rule.resource_id - domain = tencentcloud_dayu_l7_rule.test_rule.domain - +const testAccTencentCloudDataDayuL7RulesV2Baic = ` +resource "tencentcloud_dayu_l7_rule_v2" "test_rule" { + resource_type="bgpip" + resource_id="bgpip-000004xe" + resource_ip="119.28.217.162" + rule { + keep_enable=0 + keeptime=0 + source_list { + source="1.2.3.5" + weight=100 + } + source_list { + source="1.2.3.6" + weight=100 + } + lb_type=1 + protocol="http" + source_type=2 + domain="github.com" + } + } +data "tencentcloud_dayu_l7_rules_v2" "test" { + business = "bgpip" + domain = tencentcloud_dayu_l7_rule_v2.test_rule.rule.0.domain + offset = 0 + limit = 10 } ` diff --git a/tencentcloud/data_source_tc_dayu_l7_rules_v2.go b/tencentcloud/data_source_tc_dayu_l7_rules_v2.go new file mode 100644 index 0000000000..d960bf75ef --- /dev/null +++ b/tencentcloud/data_source_tc_dayu_l7_rules_v2.go @@ -0,0 +1,268 @@ +/* +Use this data source to query new dayu layer 7 rules + +Example Usage + +```hcl +data "tencentcloud_dayu_l7_rules_v2" "test" { + business = "bgpip" + offset = 0 + limit = 10 +} +``` +*/ +package tencentcloud + +import ( + "context" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func dataSourceTencentCloudDayuL7RulesV2() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudDayuL7RulesReadV2, + Schema: map[string]*schema.Schema{ + "business": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validateAllowedStringValue(DAYU_RESOURCE_TYPE), + Description: "Type of the resource that the layer 4 rule works for, valid values are `bgpip`, `bgp`, `bgp-multip` and `net`.", + }, + "domain": { + Type: schema.TypeString, + Optional: true, + Description: "Domain of resource.", + }, + "protocol": { + Type: schema.TypeString, + Optional: true, + Description: "Protocol of resource, value range [`http`, `https`].", + }, + "ip": { + Type: schema.TypeString, + Optional: true, + Description: "Ip of the resource.", + }, + "offset": { + Type: schema.TypeInt, + Optional: true, + Default: 0, + Description: "The page start offset, default is `0`.", + }, + "limit": { + Type: schema.TypeInt, + Optional: true, + Default: 10, + Description: "The number of pages, default is `10`.", + }, + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + "list": { + Type: schema.TypeList, + Computed: true, + Description: "A list of layer 4 rules. Each element contains the following attributes:", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "keep_time": { + Type: schema.TypeInt, + Computed: true, + Description: "Session hold time, in seconds.", + }, + "lb_type": { + Type: schema.TypeInt, + Computed: true, + Description: "Load balancing mode, the value is [1 (weighted round-robin)].", + }, + "source_list": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "source": { + Type: schema.TypeString, + Computed: true, + Description: "Back-to-source IP or domain name.", + }, + "weight": { + Type: schema.TypeInt, + Computed: true, + Description: "Weight value, take value [0,100].", + }, + }, + }, + Description: "Source list of the rule.", + }, + "keep_enable": { + Type: schema.TypeInt, + Computed: true, + Description: "Session keep switch, value [0 (session keep closed), 1 (session keep open)].", + }, + "domain": { + Type: schema.TypeString, + Computed: true, + Description: "Domain of resource.", + }, + "protocol": { + Type: schema.TypeString, + Computed: true, + Description: "Protocol of resource, value range [`http`, `https`].", + }, + "source_type": { + Type: schema.TypeInt, + Computed: true, + Description: "Back-to-origin method, value [1 (domain name back-to-source), 2 (IP back-to-source)].", + }, + "https_to_http_enable": { + Type: schema.TypeInt, + Computed: true, + Description: "Whether to enable the Https protocol to use Http back-to-source, take the value [0 (off), 1 (on)], default is off.", + }, + "status": { + Type: schema.TypeInt, + Computed: true, + Description: "Rule status, value [0 (rule configuration is successful), 1 (rule configuration is in effect), 2 (rule configuration fails), 3 (rule deletion is in effect), 5 (rule deletion fails), 6 (rule is waiting to be configured), 7 (rule pending deletion), 8 (rule pending configuration certificate)].", + }, + "cc_level": { + Type: schema.TypeString, + Computed: true, + Description: "CC protection level of HTTPS protocol.", + }, + "cc_enable": { + Type: schema.TypeInt, + Computed: true, + Description: "CC protection status of HTTPS protocol, the value is [0 (off), 1 (on)].", + }, + "cc_threshold": { + Type: schema.TypeInt, + Computed: true, + Description: "CC protection threshold of HTTPS protocol.", + }, + "region": { + Type: schema.TypeInt, + Computed: true, + Description: "The area code.", + }, + "rule_name": { + Type: schema.TypeString, + Computed: true, + Description: "Rule description.", + }, + "modify_time": { + Type: schema.TypeString, + Computed: true, + Description: "Modify time of resource.", + }, + "virtual_port": { + Type: schema.TypeInt, + Computed: true, + Description: "Virtual port of resource.", + }, + "cc_status": { + Type: schema.TypeInt, + Computed: true, + Description: "CC protection status, value [0(off), 1(on)].", + }, + "ip": { + Type: schema.TypeString, + Computed: true, + Description: "Ip of the resource.", + }, + "ssl_id": { + Type: schema.TypeString, + Computed: true, + Description: "SSL id of the resource.", + }, + "cert_type": { + Type: schema.TypeInt, + Computed: true, + Description: "The source of the certificate.", + }, + "id": { + Type: schema.TypeString, + Computed: true, + Description: "Id of the resource.", + }, + }, + }, + }, + }, + } +} + +func dataSourceTencentCloudDayuL7RulesReadV2(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("data_source.tencentcloud_dayu_l4_rules_v2.read")() + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := DayuService{ + client: meta.(*TencentCloudClient).apiV3Conn, + } + + business := d.Get("business").(string) + offset := d.Get("offset").(int) + limit := d.Get("limit").(int) + domain := d.Get("domain").(string) + protocol := d.Get("protocol").(string) + + extendParams := make(map[string]interface{}) + extendParams["domain"] = domain + extendParams["protocol"] = protocol + + rules, _, err := service.DescribeL7RulesV2(ctx, business, offset, limit, extendParams) + if err != nil { + return err + } + + resultList := make([]map[string]interface{}, 0) + for _, rule := range rules { + tmpResultItem := make(map[string]interface{}) + tmpResultItem["keep_time"] = *rule.KeepTime + tmpResultItem["lb_type"] = *rule.LbType + sourceList := make([]map[string]interface{}, 0) + for _, source := range rule.SourceList { + tmpSource := make(map[string]interface{}) + tmpSource["source"] = *source.Source + tmpSource["weight"] = *source.Weight + sourceList = append(sourceList, tmpSource) + } + tmpResultItem["source_list"] = sourceList + tmpResultItem["keep_enable"] = *rule.KeepEnable + tmpResultItem["domain"] = *rule.Domain + tmpResultItem["protocol"] = *rule.Protocol + tmpResultItem["source_type"] = *rule.SourceType + tmpResultItem["https_to_http_enable"] = *rule.HttpsToHttpEnable + tmpResultItem["status"] = *rule.Status + tmpResultItem["cc_level"] = *rule.CCLevel + tmpResultItem["cc_enable"] = *rule.CCEnable + tmpResultItem["cc_threshold"] = *rule.CCThreshold + tmpResultItem["region"] = *rule.Region + tmpResultItem["rule_name"] = *rule.RuleName + tmpResultItem["modify_time"] = *rule.ModifyTime + tmpResultItem["virtual_port"] = *rule.VirtualPort + tmpResultItem["cc_status"] = *rule.CCStatus + tmpResultItem["ip"] = *rule.Ip + tmpResultItem["cert_type"] = *rule.CertType + tmpResultItem["id"] = *rule.Id + resultList = append(resultList, tmpResultItem) + } + ids := make([]string, 0, len(resultList)) + for _, listItem := range resultList { + ids = append(ids, listItem["id"].(string)) + } + d.SetId(helper.DataResourceIdsHash(ids)) + if e := d.Set("list", resultList); e != nil { + log.Printf("[CRITAL]%s provider set rules fail, reason:%s\n", logId, e.Error()) + return e + } + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + return writeToFile(output.(string), resultList) + } + return nil +} diff --git a/tencentcloud/extension_ddos.go b/tencentcloud/extension_ddos.go new file mode 100644 index 0000000000..07cf157101 --- /dev/null +++ b/tencentcloud/extension_ddos.go @@ -0,0 +1,18 @@ +package tencentcloud + +const ( + DDOS_EIP_BIND_STATUS_BINDING = "BINDING" + DDOS_EIP_BIND_STATUS_BIND = "BIND" + DDOS_EIP_BIND_STATUS_UNBINDING = "UNBINDING" + DDOS_EIP_BIND_STATUS_UNBIND = "UNBIND" +) + +var DDOS_EIP_BIND_STATUS = []string{DDOS_EIP_BIND_STATUS_BINDING, DDOS_EIP_BIND_STATUS_BIND, DDOS_EIP_BIND_STATUS_UNBINDING, DDOS_EIP_BIND_STATUS_UNBIND} + +const ( + DDOS_EIP_BIND_RESOURCE_TYPE_CVM = "cvm" + DDOS_EIP_BIND_RESOURCE_TYPE_CLB = "clb" + s +) + +var DDOS_EIP_BIND_RESOURCE_TYPE = []string{DDOS_EIP_BIND_RESOURCE_TYPE_CVM, DDOS_EIP_BIND_RESOURCE_TYPE_CLB} diff --git a/tencentcloud/provider.go b/tencentcloud/provider.go index a9323ed642..eac0f1c613 100644 --- a/tencentcloud/provider.go +++ b/tencentcloud/provider.go @@ -44,6 +44,16 @@ Provider Data Sources tencentcloud_availability_regions tencentcloud_availability_zones_by_product tencentcloud_availability_zones +Anti-DDoS(DayuV2) + Data Source + tencentcloud_dayu_eip + tencentcloud_dayu_l4_rules_v2 + tencentcloud_dayu_l7_rules_v2 + + Resource + tencentcloud_dayu_eip + tencentcloud_dayu_l4_rule + tencentcloud_dayu_l7_rule_v2 Anti-DDoS(Dayu) Data Source @@ -768,6 +778,7 @@ func Provider() terraform.ResourceProvider { "tencentcloud_dayu_l4_rules": dataSourceTencentCloudDayuL4Rules(), "tencentcloud_dayu_l4_rules_v2": dataSourceTencentCloudDayuL4RulesV2(), "tencentcloud_dayu_l7_rules": dataSourceTencentCloudDayuL7Rules(), + "tencentcloud_dayu_l7_rules_v2": dataSourceTencentCloudDayuL7RulesV2(), "tencentcloud_gaap_proxies": dataSourceTencentCloudGaapProxies(), "tencentcloud_gaap_realservers": dataSourceTencentCloudGaapRealservers(), "tencentcloud_gaap_layer4_listeners": dataSourceTencentCloudGaapLayer4Listeners(), @@ -849,6 +860,7 @@ func Provider() terraform.ResourceProvider { "tencentcloud_ssm_secrets": dataSourceTencentCloudSsmSecrets(), "tencentcloud_ssm_secret_versions": dataSourceTencentCloudSsmSecretVersions(), "tencentcloud_cdh_instances": dataSourceTencentCloudCdhInstances(), + "tencentcloud_dayu_eip": dataSourceTencentCloudDayuEip(), }, ResourcesMap: map[string]*schema.Resource{ @@ -945,6 +957,8 @@ func Provider() terraform.ResourceProvider { "tencentcloud_dayu_l4_rule": resourceTencentCloudDayuL4Rule(), "tencentcloud_dayu_l4_rule_v2": resourceTencentCloudDayuL4RuleV2(), "tencentcloud_dayu_l7_rule": resourceTencentCloudDayuL7Rule(), + "tencentcloud_dayu_l7_rule_v2": resourceTencentCloudDayuL7RuleV2(), + "tencentcloud_dayu_eip": resourceTencentCloudDayuEip(), "tencentcloud_gaap_proxy": resourceTencentCloudGaapProxy(), "tencentcloud_gaap_realserver": resourceTencentCloudGaapRealserver(), "tencentcloud_gaap_layer4_listener": resourceTencentCloudGaapLayer4Listener(), diff --git a/tencentcloud/resource_tc_dayu_eip.go b/tencentcloud/resource_tc_dayu_eip.go new file mode 100644 index 0000000000..194304219e --- /dev/null +++ b/tencentcloud/resource_tc_dayu_eip.go @@ -0,0 +1,200 @@ +/* +Use this resource to create dayu eip rule + +Example Usage + +```hcl +resource "tencentcloud_dayu_eip" "test" { + resource_id = "bgpip-000004xg" + eip = "162.62.163.50" + bind_resource_id = "ins-4m0jvxic" + bind_resource_region = "hk" + bind_resource_type = "cvm" +} +``` +*/ +package tencentcloud + +import ( + "context" + "fmt" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func resourceTencentCloudDayuEip() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudDayuEipCreate, + Read: resourceTencentCloudDayuEipRead, + Delete: resourceTencentCloudDayuEipDelete, + + Schema: map[string]*schema.Schema{ + "resource_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "ID of the resource.", + }, + "eip": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Eip of the resource.", + }, + "bind_resource_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Resource id to bind.", + }, + "bind_resource_region": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Resource region to bind.", + }, + "bind_resource_type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validateAllowedStringValue(DDOS_EIP_BIND_RESOURCE_TYPE), + Description: "Resource type to bind, value range [`clb`, `cvm`].", + }, + "resource_region": { + Type: schema.TypeString, + Computed: true, + Description: "Region of the resource instance.", + }, + "eip_bound_rsc_ins": { + Type: schema.TypeString, + Computed: true, + Description: "Eip bound rsc ins of the resource instance.", + }, + "eip_bound_rsc_eni": { + Type: schema.TypeString, + Computed: true, + Description: "Eip bound rsc eni of the resource instance.", + }, + "eip_bound_rsc_vip": { + Type: schema.TypeString, + Computed: true, + Description: "Eip bound rsc vip of the resource instance.", + }, + "eip_address_status": { + Type: schema.TypeString, + Computed: true, + Description: "Eip address status of the resource instance.", + }, + "protection_status": { + Type: schema.TypeString, + Computed: true, + Description: "Protection status of the resource instance.", + }, + "created_time": { + Type: schema.TypeString, + Computed: true, + Description: "Created time of the resource instance.", + }, + "expired_time": { + Type: schema.TypeString, + Computed: true, + Description: "Expired time of the resource instance.", + }, + "modify_time": { + Type: schema.TypeString, + Computed: true, + Description: "Modify time of the resource instance.", + }, + }, + } +} + +func resourceTencentCloudDayuEipCreate(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_dayu_l4_rule.create")() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + antiddosService := AntiddosService{client: meta.(*TencentCloudClient).apiV3Conn} + bindResourceType := d.Get("bind_resource_type").(string) + resourceId := d.Get("resource_id").(string) + eip := d.Get("eip").(string) + bindResourceId := d.Get("bind_resource_id").(string) + bindResourceRegion := d.Get("bind_resource_region").(string) + if bindResourceType == DDOS_EIP_BIND_RESOURCE_TYPE_CLB { + err := antiddosService.AssociateDDoSEipLoadBalancer(ctx, resourceId, eip, bindResourceId, bindResourceRegion) + if err != nil { + return err + } + } + + if bindResourceType == DDOS_EIP_BIND_RESOURCE_TYPE_CVM { + err := antiddosService.AssociateDDoSEipAddress(ctx, resourceId, eip, bindResourceId, bindResourceRegion) + if err != nil { + return err + } + } + + for { + bgpIPInstances, err := antiddosService.DescribeListBGPIPInstances(ctx, resourceId, DDOS_EIP_BIND_STATUS, 0, 10) + if err != nil { + return err + } + if len(bgpIPInstances) != 0 { + break + } + } + d.SetId(resourceId + FILED_SP + eip) + return resourceTencentCloudDayuEipRead(d, meta) +} + +func resourceTencentCloudDayuEipRead(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_dayu_l4_rule.read")() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + items := strings.Split(d.Id(), FILED_SP) + if len(items) < 2 { + return fmt.Errorf("broken ID of dayu eip.") + } + resourceId := items[0] + antiddosService := AntiddosService{client: meta.(*TencentCloudClient).apiV3Conn} + bgpIPInstances, err := antiddosService.DescribeListBGPIPInstances(ctx, resourceId, DDOS_EIP_BIND_STATUS, 0, 10) + if err != nil { + return err + } + if len(bgpIPInstances) != 0 { + posBGPIPInstance := bgpIPInstances[0] + _ = d.Set("resource_region", *posBGPIPInstance.Region.Region) + _ = d.Set("eip_bound_rsc_ins", *posBGPIPInstance.EipAddressInfo.EipBoundRscIns) + _ = d.Set("eip_bound_rsc_eni", *posBGPIPInstance.EipAddressInfo.EipBoundRscEni) + _ = d.Set("eip_bound_rsc_vip", *posBGPIPInstance.EipAddressInfo.EipBoundRscVip) + _ = d.Set("eip_address_status", *posBGPIPInstance.EipAddressStatus) + _ = d.Set("protection_status", *posBGPIPInstance.Status) + _ = d.Set("created_time", *posBGPIPInstance.CreatedTime) + _ = d.Set("expired_time", *posBGPIPInstance.ExpiredTime) + _ = d.Set("modify_time", *posBGPIPInstance.EipAddressInfo.ModifyTime) + } + + return nil +} + +func resourceTencentCloudDayuEipDelete(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_dayu_l4_rule.delete")() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + items := strings.Split(d.Id(), FILED_SP) + if len(items) < 2 { + return fmt.Errorf("broken ID of dayu eip.") + } + resourceId := items[0] + eip := items[1] + antiddosService := AntiddosService{client: meta.(*TencentCloudClient).apiV3Conn} + err := antiddosService.DisassociateDDoSEipAddress(ctx, resourceId, eip) + if err != nil { + return err + } + return nil +} diff --git a/tencentcloud/resource_tc_dayu_eip_test.go b/tencentcloud/resource_tc_dayu_eip_test.go new file mode 100644 index 0000000000..e10fbd37d3 --- /dev/null +++ b/tencentcloud/resource_tc_dayu_eip_test.go @@ -0,0 +1,111 @@ +package tencentcloud + +import ( + "context" + "fmt" + "strings" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +var testDayuEipResourceName = "tencentcloud_dayu_eip" +var testDayuEipResourceKey = testDayuEipResourceName + ".test" + +func TestAccTencentCloudDayuEipResource(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckDayuEipDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDayuEipResource, + Check: resource.ComposeTestCheckFunc( + testAccCheckDayuEipExists(testDayuEipResourceKey), + resource.TestCheckResourceAttr(testDayuEipResourceKey, "bind_resource_id", "ins-4m0jvxic"), + resource.TestCheckResourceAttr(testDayuEipResourceKey, "bind_resource_region", "hk"), + resource.TestCheckResourceAttr(testDayuEipResourceKey, "eip", "162.62.163.50"), + resource.TestCheckResourceAttr(testDayuEipResourceKey, "eip_address_status", "BINDING"), + resource.TestCheckResourceAttr(testDayuEipResourceKey, "resource_id", "bgpip-000004xg"), + resource.TestCheckResourceAttr(testDayuEipResourceKey, "resource_region", "ap-hongkong"), + ), + }, + }, + }) +} + +func testAccCheckDayuEipDestroy(s *terraform.State) error { + for _, rs := range s.RootModule().Resources { + if rs.Type != testDayuL4RuleResourceName { + continue + } + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + items := strings.Split(rs.Primary.ID, FILED_SP) + if len(items) < 2 { + return fmt.Errorf("broken ID of eip") + } + resourceId := items[0] + eip := items[1] + + service := AntiddosService{client: testAccProvider.Meta().(*TencentCloudClient).apiV3Conn} + + result, err := service.DescribeListBGPIPInstances(ctx, resourceId, DDOS_EIP_BIND_STATUS, 0, 10) + if err != nil { + return err + } + if len(result) > 0 { + err := service.DisassociateDDoSEipAddress(ctx, resourceId, eip) + if err != nil { + return err + } + } else { + return fmt.Errorf("delete L4 rule %s fail, still on server", rs.Primary.ID) + } + } + return nil +} + +func testAccCheckDayuEipExists(n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("resource %s is not found", n) + } + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + items := strings.Split(rs.Primary.ID, FILED_SP) + if len(items) < 2 { + return fmt.Errorf("broken ID of eip") + } + resourceId := items[0] + + service := AntiddosService{client: testAccProvider.Meta().(*TencentCloudClient).apiV3Conn} + + result, err := service.DescribeListBGPIPInstances(ctx, resourceId, DDOS_EIP_BIND_STATUS, 0, 10) + + if err != nil { + return err + } + if len(result) > 0 { + return nil + } else { + return fmt.Errorf("eip rule %s not found on server", rs.Primary.ID) + + } + } +} + +const testAccDayuEipResource string = ` +resource "tencentcloud_dayu_eip" "test" { + resource_id = "bgpip-000004xg" + eip = "162.62.163.50" + bind_resource_id = "ins-4m0jvxic" + bind_resource_region = "hk" + bind_resource_type = "cvm" + } +` diff --git a/tencentcloud/resource_tc_dayu_l4_rule_test.go b/tencentcloud/resource_tc_dayu_l4_rule_test.go index 47cc24aeb0..2e18aed697 100644 --- a/tencentcloud/resource_tc_dayu_l4_rule_test.go +++ b/tencentcloud/resource_tc_dayu_l4_rule_test.go @@ -157,9 +157,6 @@ func testAccCheckDayuL4RuleExists(n string) resource.TestCheckFunc { service := DayuService{client: testAccProvider.Meta().(*TencentCloudClient).apiV3Conn} _, _, has, err := service.DescribeL4Rule(ctx, resourceType, resourceId, ruleId) - if err != nil { - _, _, has, err = service.DescribeL4Rule(ctx, resourceType, resourceId, ruleId) - } if err != nil { return err } diff --git a/tencentcloud/resource_tc_dayu_l7_rule_v2.go b/tencentcloud/resource_tc_dayu_l7_rule_v2.go new file mode 100644 index 0000000000..133523cd7b --- /dev/null +++ b/tencentcloud/resource_tc_dayu_l7_rule_v2.go @@ -0,0 +1,346 @@ +/* +Use this resource to create dayu new layer 7 rule + +~> **NOTE:** This resource only support resource Anti-DDoS of type `bgpip` + +Example Usage + +```hcl +resource "tencentcloud_dayu_l7_rule_v2" "tencentcloud_dayu_l7_rule_v2" { + resource_type="bgpip" + resource_id="bgpip-000004xe" + resource_ip="119.28.217.162" + rule { + keep_enable=false + keeptime=0 + source_list { + source="1.2.3.5" + weight=100 + } + source_list { + source="1.2.3.6" + weight=100 + } + lb_type=1 + protocol="http" + source_type=2 + domain="github.com" + } +} +``` +*/ +package tencentcloud + +import ( + "context" + "fmt" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + dayu "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dayu/v20180709" +) + +func resourceTencentCloudDayuL7RuleV2() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudDayuL7RuleCreateV2, + Read: resourceTencentCloudDayuL7RuleReadV2, + Update: resourceTencentCloudDayuL7RuleUpdateV2, + Delete: resourceTencentCloudDayuL7RuleDeleteV2, + + Schema: map[string]*schema.Schema{ + "resource_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "ID of the resource that the layer 7 rule works for.", + }, + "resource_ip": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Ip of the resource that the layer 7 rule works for.", + }, + "resource_type": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validateAllowedStringValue(DAYU_RESOURCE_TYPE), + ForceNew: true, + Description: "Type of the resource that the layer 7 rule works for, valid value is `bgpip`.", + }, + "rule": { + Type: schema.TypeList, + MaxItems: 1, + Required: true, + Description: "A list of layer 7 rules. Each element contains the following attributes:", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "keeptime": { + Type: schema.TypeInt, + Required: true, + Description: "The keeptime of the layer 4 rule.", + }, + "domain": { + Type: schema.TypeString, + Required: true, + Description: "Domain of the rule.", + }, + "protocol": { + Type: schema.TypeString, + Required: true, + Description: "Protocol of the rule.", + }, + "source_type": { + Type: schema.TypeInt, + Required: true, + Description: "Source type, `1` for source of host, `2` for source of IP.", + }, + "lb_type": { + Type: schema.TypeInt, + Required: true, + Description: "LB type of the rule, `1` for weight cycling and `2` for IP hash.", + }, + "cert_type": { + Type: schema.TypeInt, + Optional: true, + Default: 0, + Description: "The source of the certificate must be filled in when the forwarding protocol is https, the value [2 (Tencent Cloud Hosting Certificate)], and 0 when the forwarding protocol is http.", + }, + "ssl_id": { + Type: schema.TypeString, + Optional: true, + Description: "When the certificate source is a Tencent Cloud managed certificate, this field must be filled in with the managed certificate ID.", + }, + "source_list": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "source": { + Type: schema.TypeString, + Required: true, + Description: "Source IP or domain.", + }, + "weight": { + Type: schema.TypeInt, + Required: true, + Description: "Weight of the source.", + }, + }, + }, + }, + "keep_enable": { + Type: schema.TypeInt, + Required: true, + Description: "session hold switch.", + }, + "cc_enable": { + Type: schema.TypeInt, + Optional: true, + Default: 0, + Description: "HTTPS protocol CC protection status, value [0 (off), 1 (on)], defaule is 0.", + }, + "https_to_http_enable": { + Type: schema.TypeInt, + Optional: true, + Default: 0, + Description: "Whether to enable the Https protocol to use Http back-to-source, take the value [0 (off), 1 (on)], do not fill in the default is off, defaule is 0.", + }, + }, + }, + }, + }, + } +} + +func resourceTencentCloudDayuL7RuleCreateV2(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_dayu_l7_rule.create")() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + resourceId := d.Get("resource_id").(string) + resourceIp := d.Get("resource_ip").(string) + resourceType := d.Get("resource_type").(string) + rule := d.Get("rule").([]interface{}) + ruleItem := rule[0].(map[string]interface{}) + domain := ruleItem["domain"].(string) + protocol := ruleItem["protocol"].(string) + dayuService := DayuService{client: meta.(*TencentCloudClient).apiV3Conn} + err := dayuService.CreateL7RuleV2(ctx, resourceType, resourceId, resourceIp, rule) + if err != nil { + return err + } + d.SetId(resourceType + FILED_SP + domain + FILED_SP + protocol) + return resourceTencentCloudDayuL7RuleReadV2(d, meta) +} + +func resourceTencentCloudDayuL7RuleUpdateV2(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_dayu_l7_rule.create")() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + dayuService := DayuService{client: meta.(*TencentCloudClient).apiV3Conn} + + items := strings.Split(d.Id(), FILED_SP) + if len(items) < 3 { + return fmt.Errorf("broken ID of dayu L7 rule") + } + business := items[0] + domain := items[1] + protocol := items[2] + extendParams := make(map[string]interface{}) + extendParams["domain"] = domain + extendParams["protocol"] = protocol + rules, _, err := dayuService.DescribeL7RulesV2(ctx, business, 0, 10, extendParams) + if err != nil { + return err + } + if len(rules) == 0 { + err := fmt.Errorf("Create l7 rule failed.") + return err + } + ruleItem := rules[0] + resourceId := *ruleItem.Id + if d.HasChange("rule.0.protocol") { + protocol = d.Get("protocol").(string) + ruleItem.Protocol = &protocol + } + + if d.HasChange("rule.0.source_type") { + sourceType := uint64(d.Get("source_type").(int)) + ruleItem.SourceType = &sourceType + } + if d.HasChange("rule.0.ssl_id") { + ruleConfig := d.Get("rule").([]interface{}) + ruleConfigItem := ruleConfig[0].(map[string]interface{}) + sslId := ruleConfigItem["ssl_id"].(string) + ruleItem.SSLId = &sslId + } + if d.HasChange("rule.0.cert_type") { + ruleConfig := d.Get("rule").([]interface{}) + ruleConfigItem := ruleConfig[0].(map[string]interface{}) + certType := uint64(ruleConfigItem["cert_type"].(int)) + ruleItem.CertType = &certType + } + if d.HasChange("rule.0.https_to_http_enable") { + ruleConfig := d.Get("rule").([]interface{}) + ruleConfigItem := ruleConfig[0].(map[string]interface{}) + httpsToHttpEnable := uint64(ruleConfigItem["https_to_http_enable"].(int)) + ruleItem.HttpsToHttpEnable = &httpsToHttpEnable + } + if d.HasChange("rule.0.cc_enable") { + ruleConfig := d.Get("rule").([]interface{}) + ruleConfigItem := ruleConfig[0].(map[string]interface{}) + ccEnable := uint64(ruleConfigItem["cc_enable"].(int)) + ruleItem.CCEnable = &ccEnable + } + if d.HasChange("rule.0.source_list") { + ruleConfig := d.Get("rule").([]interface{}) + ruleConfigItem := ruleConfig[0].(map[string]interface{}) + sourceList := ruleConfigItem["source_list"].([]interface{}) + sources := make([]*dayu.L4RuleSource, 0) + for _, source := range sourceList { + sourceItem := source.(map[string]interface{}) + weight := uint64(sourceItem["weight"].(int)) + subSource := sourceItem["source"].(string) + tmpSource := dayu.L4RuleSource{ + Source: &subSource, + Weight: &weight, + } + sources = append(sources, &tmpSource) + } + ruleItem.SourceList = sources + } + + err = dayuService.ModifyL7RuleV2(ctx, business, resourceId, ruleItem) + if err != nil { + return err + } + d.SetId(business + FILED_SP + domain + FILED_SP + protocol) + return resourceTencentCloudDayuL7RuleReadV2(d, meta) +} + +func resourceTencentCloudDayuL7RuleReadV2(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_dayu_l7_rule.read")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + items := strings.Split(d.Id(), FILED_SP) + if len(items) < 3 { + return fmt.Errorf("broken ID of dayu L7 rule") + } + business := items[0] + domain := items[1] + protocol := items[2] + extendParams := make(map[string]interface{}) + extendParams["domain"] = domain + extendParams["protocol"] = protocol + offset := 0 + limit := 10 + dayuService := DayuService{client: meta.(*TencentCloudClient).apiV3Conn} + for { + rules, _, err := dayuService.DescribeL7RulesV2(ctx, business, offset, limit, extendParams) + if err != nil { + return err + } + if len(rules) == 0 { + err := fmt.Errorf("Create l7 rule failed.") + return err + } + if *rules[0].Status == uint64(0) { + _ = d.Set("resource_id", *rules[0].Id) + + return nil + } else { + continue + } + } +} + +func resourceTencentCloudDayuL7RuleDeleteV2(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_dayu_l7_rule.delete")() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + items := strings.Split(d.Id(), FILED_SP) + if len(items) < 3 { + return fmt.Errorf("broken ID of L7 rule") + } + business := items[0] + domain := items[1] + protocol := items[2] + + dayuService := DayuService{client: meta.(*TencentCloudClient).apiV3Conn} + extendParams := make(map[string]interface{}) + extendParams["domain"] = domain + extendParams["protocol"] = protocol + rules, _, err := dayuService.DescribeL7RulesV2(ctx, business, 0, 10, extendParams) + if err != nil { + return err + } + if len(rules) == 0 { + err := fmt.Errorf("Create l7 rule failed.") + return err + } + ruleItem := rules[0] + resourceId := *ruleItem.Id + resourceIp := *ruleItem.Ip + ruleId := *ruleItem.RuleId + err = resource.Retry(writeRetryTimeout, func() *resource.RetryError { + e := dayuService.DeleteL7RulesV2(ctx, business, resourceId, resourceIp, ruleId) + if e != nil { + return retryError(e) + } + return nil + }) + + if err != nil { + return err + } + + return nil +} diff --git a/tencentcloud/resource_tc_dayu_l7_rule_v2_test.go b/tencentcloud/resource_tc_dayu_l7_rule_v2_test.go new file mode 100644 index 0000000000..4794f3482d --- /dev/null +++ b/tencentcloud/resource_tc_dayu_l7_rule_v2_test.go @@ -0,0 +1,140 @@ +package tencentcloud + +import ( + "context" + "fmt" + "strings" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +var testDayuL7RuleV2ResourceName = "tencentcloud_dayu_l7_rule_v2" +var testDayuL7RuleV2ResourceKey = testDayuL7RuleV2ResourceName + ".test_rule" + +func TestAccTencentCloudDayuL7RuleV2Resource(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckDayuL7RuleV2Destroy, + Steps: []resource.TestStep{ + { + Config: testAccDayuL7RuleV2, + Check: resource.ComposeTestCheckFunc( + testAccCheckDayuL7RuleV2Exists(testDayuL7RuleV2ResourceKey), + resource.TestCheckResourceAttr(testDayuL7RuleV2ResourceKey, "rule.#", "1"), + resource.TestCheckResourceAttr(testDayuL7RuleV2ResourceKey, "resource_type", "bgpip"), + resource.TestCheckResourceAttr(testDayuL7RuleV2ResourceKey, "resource_id", "bgpip-000004xe"), + resource.TestCheckResourceAttr(testDayuL7RuleV2ResourceKey, "resource_ip", "119.28.217.162"), + ), + }, + }, + }) +} + +func testAccCheckDayuL7RuleV2Destroy(s *terraform.State) error { + for _, rs := range s.RootModule().Resources { + if rs.Type != testDayuL4RuleV2ResourceNameTCP { + continue + } + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + items := strings.Split(rs.Primary.ID, FILED_SP) + if len(items) < 3 { + return fmt.Errorf("broken ID of dayu L7 rule") + } + business := items[0] + domain := items[1] + protocol := items[2] + + extendParams := make(map[string]interface{}) + extendParams["domain"] = domain + extendParams["protocol"] = protocol + dayuService := DayuService{client: testAccProvider.Meta().(*TencentCloudClient).apiV3Conn} + rules, _, err := dayuService.DescribeL7RulesV2(ctx, business, 0, 10, extendParams) + if err != nil { + return err + } + if len(rules) == 0 { + err := fmt.Errorf("Create l7 rule failed.") + return err + } + ruleItem := rules[0] + resourceId := *ruleItem.Id + resourceIp := *ruleItem.Ip + ruleId := *ruleItem.RuleId + err = resource.Retry(writeRetryTimeout, func() *resource.RetryError { + e := dayuService.DeleteL7RulesV2(ctx, business, resourceId, resourceIp, ruleId) + if e != nil { + return retryError(e) + } + return nil + }) + + if err != nil { + return err + } + } + return nil +} + +func testAccCheckDayuL7RuleV2Exists(n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("resource %s is not found", n) + } + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + items := strings.Split(rs.Primary.ID, FILED_SP) + if len(items) < 3 { + return fmt.Errorf("broken ID of dayu L7 rule") + } + business := items[0] + domain := items[1] + protocol := items[2] + + extendParams := make(map[string]interface{}) + extendParams["domain"] = domain + extendParams["protocol"] = protocol + dayuService := DayuService{client: testAccProvider.Meta().(*TencentCloudClient).apiV3Conn} + rules, _, err := dayuService.DescribeL7RulesV2(ctx, business, 0, 10, extendParams) + + if err != nil { + return err + } + if len(rules) > 0 { + return nil + } else { + return fmt.Errorf("L7 rule %s not found on server", rs.Primary.ID) + + } + } +} + +const testAccDayuL7RuleV2 string = ` +resource "tencentcloud_dayu_l7_rule_v2" "test_rule" { + resource_type="bgpip" + resource_id="bgpip-000004xe" + resource_ip="119.28.217.162" + rule { + keep_enable=0 + keeptime=0 + source_list { + source="1.2.3.5" + weight=100 + } + source_list { + source="1.2.3.6" + weight=100 + } + lb_type=1 + protocol="http" + source_type=2 + domain="github.com" + } + } +` diff --git a/tencentcloud/service_tencentcloud_antiddos.go b/tencentcloud/service_tencentcloud_antiddos.go new file mode 100644 index 0000000000..507f055884 --- /dev/null +++ b/tencentcloud/service_tencentcloud_antiddos.go @@ -0,0 +1,148 @@ +package tencentcloud + +import ( + "context" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + antiddos "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/antiddos/v20200309" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/connectivity" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/ratelimit" +) + +type AntiddosService struct { + client *connectivity.TencentCloudClient +} + +func (me *AntiddosService) DescribeListBGPIPInstances(ctx context.Context, instanceId string, status []string, offset int, limit int) (result []*antiddos.BGPIPInstance, err error) { + logId := getLogId(ctx) + request := antiddos.NewDescribeListBGPIPInstancesRequest() + request.FilterInstanceId = &instanceId + eipType := int64(1) + request.FilterEipType = &eipType + filterEipEipAddressStatus := make([]*string, 0) + for _, singleStatus := range status { + status := singleStatus + filterEipEipAddressStatus = append(filterEipEipAddressStatus, &status) + } + request.FilterEipEipAddressStatus = filterEipEipAddressStatus + offsetInt64 := uint64(offset) + request.Offset = &offsetInt64 + limitInt64 := uint64(limit) + request.Limit = &limitInt64 + ratelimit.Check(request.GetAction()) + var response *antiddos.DescribeListBGPIPInstancesResponse + err = resource.Retry(readRetryTimeout, func() *resource.RetryError { + response, err = me.client.UseAntiddosClient().DescribeListBGPIPInstances(request) + + if e, ok := err.(*errors.TencentCloudSDKError); ok { + if e.GetCode() == "InternalError.ClusterNotFound" { + return nil + } + } + if err != nil { + return resource.RetryableError(err) + } + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", + logId, request.GetAction(), request.ToJsonString(), err.Error()) + return + } + result = response.Response.InstanceList + return +} + +func (me *AntiddosService) AssociateDDoSEipAddress(ctx context.Context, instanceId string, eip string, cvmInstanceID string, cvmRegion string) (err error) { + logId := getLogId(ctx) + request := antiddos.NewAssociateDDoSEipAddressRequest() + + request.InstanceId = common.StringPtr(instanceId) + request.Eip = common.StringPtr(eip) + request.CvmInstanceID = common.StringPtr(cvmInstanceID) + request.CvmRegion = common.StringPtr(cvmRegion) + + err = resource.Retry(writeRetryTimeout, func() *resource.RetryError { + _, err := me.client.UseAntiddosClient().AssociateDDoSEipAddress(request) + + if e, ok := err.(*errors.TencentCloudSDKError); ok { + if e.GetCode() == "InternalError.ClusterNotFound" { + return nil + } + } + if err != nil { + return resource.RetryableError(err) + } + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", + logId, request.GetAction(), request.ToJsonString(), err.Error()) + return + } + return + +} + +func (me *AntiddosService) AssociateDDoSEipLoadBalancer(ctx context.Context, instanceId string, eip string, loadBalancerID string, loadBalancerRegion string) (err error) { + logId := getLogId(ctx) + request := antiddos.NewAssociateDDoSEipLoadBalancerRequest() + + request.InstanceId = common.StringPtr(instanceId) + request.Eip = common.StringPtr(eip) + request.LoadBalancerID = common.StringPtr(loadBalancerID) + request.LoadBalancerRegion = common.StringPtr(loadBalancerRegion) + + err = resource.Retry(writeRetryTimeout, func() *resource.RetryError { + _, err := me.client.UseAntiddosClient().AssociateDDoSEipLoadBalancer(request) + + if e, ok := err.(*errors.TencentCloudSDKError); ok { + if e.GetCode() == "InternalError.ClusterNotFound" { + return nil + } + } + if err != nil { + return resource.RetryableError(err) + } + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", + logId, request.GetAction(), request.ToJsonString(), err.Error()) + return + } + return + +} + +func (me *AntiddosService) DisassociateDDoSEipAddress(ctx context.Context, instanceId string, eip string) (err error) { + logId := getLogId(ctx) + request := antiddos.NewDisassociateDDoSEipAddressRequest() + + request.InstanceId = common.StringPtr(instanceId) + request.Eip = common.StringPtr(eip) + + err = resource.Retry(writeRetryTimeout, func() *resource.RetryError { + _, err := me.client.UseAntiddosClient().DisassociateDDoSEipAddress(request) + + if e, ok := err.(*errors.TencentCloudSDKError); ok { + if e.GetCode() == "InternalError.ClusterNotFound" { + return nil + } + } + if err != nil { + return resource.RetryableError(err) + } + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", + logId, request.GetAction(), request.ToJsonString(), err.Error()) + return + } + return + +} diff --git a/tencentcloud/service_tencentcloud_dayu.go b/tencentcloud/service_tencentcloud_dayu.go index 64c243867f..4d855e3eda 100644 --- a/tencentcloud/service_tencentcloud_dayu.go +++ b/tencentcloud/service_tencentcloud_dayu.go @@ -6,6 +6,7 @@ import ( "log" "net/url" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/pkg/errors" "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" sdkError "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors" @@ -1825,3 +1826,197 @@ func (me *DayuService) SetSession(ctx context.Context, resourceType string, reso return } + +func (me *DayuService) DescribeL7RulesV2(ctx context.Context, business string, offset int, limit int, extendParams map[string]interface{}) (rules []*dayu.NewL7RuleEntry, healths []*dayu.L7RuleHealth, errRet error) { + logId := getLogId(ctx) + request := dayu.NewDescribleNewL7RulesRequest() + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail,reason[%s]", logId, request.GetAction(), errRet.Error()) + } + }() + + request.Business = &business + if v, ok := extendParams["protocol"]; ok { + protocol := v.(string) + if protocol != "" { + request.ProtocolList = []*string{&protocol} + } + } + if v, ok := extendParams["domain"]; ok { + domain := v.(string) + if domain != "" { + request.Domain = &domain + } + } + offsetUint64 := uint64(offset) + request.Offset = &offsetUint64 + limitUint64 := uint64(limit) + request.Limit = &limitUint64 + var response *dayu.DescribleNewL7RulesResponse + errRet = resource.Retry(readRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + response, errRet = me.client.UseDayuClient().DescribleNewL7Rules(request) + + if e, ok := errRet.(*sdkError.TencentCloudSDKError); ok { + if e.GetCode() == "InternalError.ClusterNotFound" { + return nil + } + } + if errRet != nil { + return resource.RetryableError(errRet) + } + return nil + }) + if errRet != nil { + return + } + rules = response.Response.Rules + healths = response.Response.Healths + return + +} + +func (me *DayuService) CreateL7RuleV2(ctx context.Context, business string, resourceId string, resourceIp string, ruleList []interface{}) (errRet error) { + logId := getLogId(ctx) + request := dayu.NewCreateNewL7RulesRequest() + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail,reason[%s]", logId, request.GetAction(), errRet.Error()) + } + }() + rule := ruleList[0].(map[string]interface{}) + keeptime := uint64(rule["keeptime"].(int)) + domain := rule["domain"].(string) + protocol := rule["protocol"].(string) + sourceType := uint64(rule["source_type"].(int)) + lbType := uint64(rule["lb_type"].(int)) + keepEnable := uint64(rule["keep_enable"].(int)) + certType := uint64(rule["cert_type"].(int)) + sslId := rule["ssl_id"].(string) + ccEnable := uint64(rule["cc_enable"].(int)) + httpsToHttpEnable := uint64(rule["https_to_http_enable"].(int)) + + sourceList := rule["source_list"].([]interface{}) + sources := make([]*dayu.L4RuleSource, 0) + for _, source := range sourceList { + sourceItem := source.(map[string]interface{}) + weight := uint64(sourceItem["weight"].(int)) + subSource := sourceItem["source"].(string) + tmpSource := dayu.L4RuleSource{ + Source: &subSource, + Weight: &weight, + } + sources = append(sources, &tmpSource) + } + + ruleEntry := dayu.L7RuleEntry{ + KeepTime: &keeptime, + Domain: &domain, + Protocol: &protocol, + SourceType: &sourceType, + LbType: &lbType, + KeepEnable: &keepEnable, + SourceList: sources, + CertType: &certType, + SSLId: &sslId, + CCEnable: &ccEnable, + HttpsToHttpEnable: &httpsToHttpEnable, + } + + request.IdList = []*string{&resourceId} + request.VipList = []*string{&resourceIp} + request.Business = &business + request.Rules = []*dayu.L7RuleEntry{&ruleEntry} + errRet = resource.Retry(writeRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + response, errRet := me.client.UseDayuClient().CreateNewL7Rules(request) + + if e, ok := errRet.(*sdkError.TencentCloudSDKError); ok { + if e.GetCode() == "InternalError.ClusterNotFound" { + return nil + } + } + if errRet != nil { + return resource.RetryableError(errRet) + } + if *response.Response.Success.Code != "Success" { + errRet = fmt.Errorf("TencentCloud SDK return %s response,%s", *response.Response.Success.Code, *response.Response.Success.Message) + return resource.RetryableError(errRet) + } + return nil + }) + return +} + +func (me *DayuService) ModifyL7RuleV2(ctx context.Context, resourceType string, resourceId string, rule *dayu.NewL7RuleEntry) (errRet error) { + logId := getLogId(ctx) + request := dayu.NewModifyNewDomainRulesRequest() + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail,reason[%s]", logId, request.GetAction(), errRet.Error()) + } + }() + request.Id = &resourceId + request.Business = &resourceType + request.Rule = rule + + errRet = resource.Retry(writeRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + response, errRet := me.client.UseDayuClient().ModifyNewDomainRules(request) + + if e, ok := errRet.(*sdkError.TencentCloudSDKError); ok { + if e.GetCode() == "InternalError.ClusterNotFound" { + return nil + } + } + if errRet != nil { + return resource.RetryableError(errRet) + } + if *response.Response.Success.Code != "Success" { + errRet = fmt.Errorf("TencentCloud SDK return %s response,%s", *response.Response.Success.Code, *response.Response.Success.Message) + return resource.RetryableError(errRet) + } + return nil + }) + + return +} + +func (me *DayuService) DeleteL7RulesV2(ctx context.Context, resourceType string, resourceId string, resourceIp string, ruleId string) (errRet error) { + logId := getLogId(ctx) + request := dayu.NewDeleteNewL7RulesRequest() + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail,reason[%s]", logId, request.GetAction(), errRet.Error()) + } + }() + request.Business = &resourceType + request.Rule = []*dayu.L4DelRule{ + { + Id: &resourceId, + Ip: &resourceIp, + RuleIdList: []*string{&ruleId}, + }, + } + errRet = resource.Retry(writeRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + response, errRet := me.client.UseDayuClient().DeleteNewL7Rules(request) + + if e, ok := errRet.(*sdkError.TencentCloudSDKError); ok { + if e.GetCode() == "InternalError.ClusterNotFound" { + return nil + } + } + if errRet != nil { + return resource.RetryableError(errRet) + } + if *response.Response.Success.Code != "Success" { + errRet = fmt.Errorf("TencentCloud SDK return %s response,%s", *response.Response.Success.Code, *response.Response.Success.Message) + return resource.RetryableError(errRet) + } + return nil + }) + return +} diff --git a/website/docs/d/dayu_eip.html.markdown b/website/docs/d/dayu_eip.html.markdown new file mode 100644 index 0000000000..54bc7454f0 --- /dev/null +++ b/website/docs/d/dayu_eip.html.markdown @@ -0,0 +1,38 @@ +--- +subcategory: "Anti-DDoS(DayuV2)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dayu_eip" +sidebar_current: "docs-tencentcloud-datasource-dayu_eip" +description: |- + Use this data source to query dayu eip rules +--- + +# tencentcloud_dayu_eip + +Use this data source to query dayu eip rules + +## Example Usage + +```hcl +data "tencentcloud_dayu_eip" "test" { + resource_id = "bgpip-000004xg" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `resource_id` - (Required) Id of the resource. +* `bind_status` - (Optional) The binding state of the instance, value range [BINDING, BIND, UNBINDING, UNBIND], default is [BINDING, BIND, UNBINDING, UNBIND]. +* `limit` - (Optional) The number of pages, default is `10`. +* `offset` - (Optional) The page start offset, default is `0`. +* `result_output_file` - (Optional) Used to save results. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `list` - A list of layer 4 rules. Each element contains the following attributes: + + diff --git a/website/docs/d/dayu_l4_rules_v2.html.markdown b/website/docs/d/dayu_l4_rules_v2.html.markdown new file mode 100644 index 0000000000..38719765de --- /dev/null +++ b/website/docs/d/dayu_l4_rules_v2.html.markdown @@ -0,0 +1,51 @@ +--- +subcategory: "Anti-DDoS(DayuV2)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dayu_l4_rules_v2" +sidebar_current: "docs-tencentcloud-datasource-dayu_l4_rules_v2" +description: |- + Use this data source to query dayu new layer 4 rules +--- + +# tencentcloud_dayu_l4_rules_v2 + +Use this data source to query dayu new layer 4 rules + +## Example Usage + +```hcl +data "tencentcloud_dayu_l4_rules_v2" "tencentcloud_dayu_l4_rules_v2" { + business = "bgpip" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `business` - (Required) Type of the resource that the layer 4 rule works for, valid values are `bgpip`, `bgp`, `bgp-multip` and `net`. +* `ip` - (Optional) Ip of the resource. +* `result_output_file` - (Optional) Used to save results. +* `virtual_port` - (Optional) Virtual port of resource. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `list` - A list of layer 4 rules. Each element contains the following attributes: + * `id` - Bind the resource ID information. + * `ip` - Bind the resource IP information. + * `keep_enable` - session hold switch. + * `keeptime` - The keeptime of the layer 4 rule. + * `lb_type` - LB type of the rule, `1` for weight cycling and `2` for IP hash. + * `modify_time` - Rule modification time. + * `protocol` - Protocol of the rule. + * `region` - Corresponding regional information. + * `remove_switch` - Remove the watermark state. + * `rule_id` - ID of the 4 layer rule. + * `rule_name` - Name of the rule. + * `source_port` - The source port of the layer 4 rule. + * `source_type` - Source type, `1` for source of host, `2` for source of IP. + * `virtual_port` - The virtual port of the layer 4 rule. + + diff --git a/website/docs/d/dayu_l7_rules_v2.html.markdown b/website/docs/d/dayu_l7_rules_v2.html.markdown new file mode 100644 index 0000000000..1a081df8df --- /dev/null +++ b/website/docs/d/dayu_l7_rules_v2.html.markdown @@ -0,0 +1,65 @@ +--- +subcategory: "Anti-DDoS(DayuV2)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dayu_l7_rules_v2" +sidebar_current: "docs-tencentcloud-datasource-dayu_l7_rules_v2" +description: |- + Use this data source to query new dayu layer 7 rules +--- + +# tencentcloud_dayu_l7_rules_v2 + +Use this data source to query new dayu layer 7 rules + +## Example Usage + +```hcl +data "tencentcloud_dayu_l7_rules_v2" "test" { + business = "bgpip" + offset = 0 + limit = 10 +} +``` + +## Argument Reference + +The following arguments are supported: + +* `business` - (Required) Type of the resource that the layer 4 rule works for, valid values are `bgpip`, `bgp`, `bgp-multip` and `net`. +* `domain` - (Optional) Domain of resource. +* `ip` - (Optional) Ip of the resource. +* `limit` - (Optional) The number of pages, default is `10`. +* `offset` - (Optional) The page start offset, default is `0`. +* `protocol` - (Optional) Protocol of resource, value range [`http`, `https`]. +* `result_output_file` - (Optional) Used to save results. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `list` - A list of layer 4 rules. Each element contains the following attributes: + * `cc_enable` - CC protection status of HTTPS protocol, the value is [0 (off), 1 (on)]. + * `cc_level` - CC protection level of HTTPS protocol. + * `cc_status` - CC protection status, value [0(off), 1(on)]. + * `cc_threshold` - CC protection threshold of HTTPS protocol. + * `cert_type` - The source of the certificate. + * `domain` - Domain of resource. + * `https_to_http_enable` - Whether to enable the Https protocol to use Http back-to-source, take the value [0 (off), 1 (on)], default is off. + * `id` - Id of the resource. + * `ip` - Ip of the resource. + * `keep_enable` - Session keep switch, value [0 (session keep closed), 1 (session keep open)]. + * `keep_time` - Session hold time, in seconds. + * `lb_type` - Load balancing mode, the value is [1 (weighted round-robin)]. + * `modify_time` - Modify time of resource. + * `protocol` - Protocol of resource, value range [`http`, `https`]. + * `region` - The area code. + * `rule_name` - Rule description. + * `source_list` - Source list of the rule. + * `source` - Back-to-source IP or domain name. + * `weight` - Weight value, take value [0,100]. + * `source_type` - Back-to-origin method, value [1 (domain name back-to-source), 2 (IP back-to-source)]. + * `ssl_id` - SSL id of the resource. + * `status` - Rule status, value [0 (rule configuration is successful), 1 (rule configuration is in effect), 2 (rule configuration fails), 3 (rule deletion is in effect), 5 (rule deletion fails), 6 (rule is waiting to be configured), 7 (rule pending deletion), 8 (rule pending configuration certificate)]. + * `virtual_port` - Virtual port of resource. + + diff --git a/website/docs/r/dayu_eip.html.markdown b/website/docs/r/dayu_eip.html.markdown new file mode 100644 index 0000000000..24f3309d4d --- /dev/null +++ b/website/docs/r/dayu_eip.html.markdown @@ -0,0 +1,51 @@ +--- +subcategory: "Anti-DDoS(DayuV2)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dayu_eip" +sidebar_current: "docs-tencentcloud-resource-dayu_eip" +description: |- + Use this resource to create dayu eip rule +--- + +# tencentcloud_dayu_eip + +Use this resource to create dayu eip rule + +## Example Usage + +```hcl +resource "tencentcloud_dayu_eip" "test" { + resource_id = "bgpip-000004xg" + eip = "162.62.163.50" + bind_resource_id = "ins-4m0jvxic" + bind_resource_region = "hk" + bind_resource_type = "cvm" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `bind_resource_id` - (Required, ForceNew) Resource id to bind. +* `bind_resource_region` - (Required, ForceNew) Resource region to bind. +* `bind_resource_type` - (Required, ForceNew) Resource type to bind, value range [`clb`, `cvm`]. +* `eip` - (Required, ForceNew) Eip of the resource. +* `resource_id` - (Required, ForceNew) ID of the resource. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. +* `created_time` - Created time of the resource instance. +* `eip_address_status` - Eip address status of the resource instance. +* `eip_bound_rsc_eni` - Eip bound rsc eni of the resource instance. +* `eip_bound_rsc_ins` - Eip bound rsc ins of the resource instance. +* `eip_bound_rsc_vip` - Eip bound rsc vip of the resource instance. +* `expired_time` - Expired time of the resource instance. +* `modify_time` - Modify time of the resource instance. +* `protection_status` - Protection status of the resource instance. +* `resource_region` - Region of the resource instance. + + diff --git a/website/docs/r/dayu_l4_rule.html.markdown b/website/docs/r/dayu_l4_rule.html.markdown index 4dd1fee1b8..585fa8a30d 100644 --- a/website/docs/r/dayu_l4_rule.html.markdown +++ b/website/docs/r/dayu_l4_rule.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "Anti-DDoS(Dayu)" +subcategory: "Anti-DDoS(DayuV2)" layout: "tencentcloud" page_title: "TencentCloud: tencentcloud_dayu_l4_rule" sidebar_current: "docs-tencentcloud-resource-dayu_l4_rule" diff --git a/website/docs/r/dayu_l7_rule_v2.html.markdown b/website/docs/r/dayu_l7_rule_v2.html.markdown new file mode 100644 index 0000000000..b9c5a19ef5 --- /dev/null +++ b/website/docs/r/dayu_l7_rule_v2.html.markdown @@ -0,0 +1,72 @@ +--- +subcategory: "Anti-DDoS(DayuV2)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dayu_l7_rule_v2" +sidebar_current: "docs-tencentcloud-resource-dayu_l7_rule_v2" +description: |- + Use this resource to create dayu new layer 7 rule +--- + +# tencentcloud_dayu_l7_rule_v2 + +Use this resource to create dayu new layer 7 rule + +~> **NOTE:** This resource only support resource Anti-DDoS of type `bgpip` + +## Example Usage + +```hcl +resource "tencentcloud_dayu_l7_rule_v2" "tencentcloud_dayu_l7_rule_v2" { + resource_type = "bgpip" + resource_id = "bgpip-000004xe" + resource_ip = "119.28.217.162" + rule { + keep_enable = false + keeptime = 0 + source_list { + source = "1.2.3.5" + weight = 100 + } + source_list { + source = "1.2.3.6" + weight = 100 + } + lb_type = 1 + protocol = "http" + source_type = 2 + domain = "github.com" + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `resource_id` - (Required, ForceNew) ID of the resource that the layer 7 rule works for. +* `resource_ip` - (Required, ForceNew) Ip of the resource that the layer 7 rule works for. +* `resource_type` - (Required, ForceNew) Type of the resource that the layer 7 rule works for, valid value is `bgpip`. +* `rule` - (Required) A list of layer 7 rules. Each element contains the following attributes: + +The `rule` object supports the following: + +* `domain` - (Required) Domain of the rule. +* `keep_enable` - (Required) session hold switch. +* `keeptime` - (Required) The keeptime of the layer 4 rule. +* `lb_type` - (Required) LB type of the rule, `1` for weight cycling and `2` for IP hash. +* `protocol` - (Required) Protocol of the rule. +* `source_list` - (Required) +* `source_type` - (Required) Source type, `1` for source of host, `2` for source of IP. +* `cc_enable` - (Optional) HTTPS protocol CC protection status, value [0 (off), 1 (on)], defaule is 0. +* `cert_type` - (Optional) The source of the certificate must be filled in when the forwarding protocol is https, the value [2 (Tencent Cloud Hosting Certificate)], and 0 when the forwarding protocol is http. +* `https_to_http_enable` - (Optional) Whether to enable the Https protocol to use Http back-to-source, take the value [0 (off), 1 (on)], do not fill in the default is off, defaule is 0. +* `ssl_id` - (Optional) When the certificate source is a Tencent Cloud managed certificate, this field must be filled in with the managed certificate ID. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index 687a5058f4..9232843666 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -153,6 +153,39 @@ +
  • + Anti-DDoS(DayuV2) + +
  • Audit