diff --git a/.changelog/2143.txt b/.changelog/2143.txt new file mode 100644 index 0000000000..1be5dde35a --- /dev/null +++ b/.changelog/2143.txt @@ -0,0 +1,11 @@ +```release-note:new-data-source +tencentcloud_cat_metric_data +``` + +```release-note:enhancement +datasource/tencentcloud_cat_node: Add computed `task_types` +``` + +```release-note:enhancement +resource/tencentcloud_cat_task_set: Support `suspend` and `resume` for dial test tasks +``` diff --git a/go.mod b/go.mod index 5b5c9b8d39..7c15057ea0 100644 --- a/go.mod +++ b/go.mod @@ -30,19 +30,20 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apm v1.0.624 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.756 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.409 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat v1.0.520 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat v1.0.760 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.591 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdb v1.0.699 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn v1.0.539 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdwch v1.0.745 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cfs v1.0.627 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cfw v1.0.759 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/chdfs v1.0.600 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ciam v1.0.695 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.748 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.693 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.544 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.711 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.759 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.760 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cwp v1.0.589 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.692 @@ -93,16 +94,14 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tsf v1.0.674 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vod v1.0.199 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.755 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/waf v1.0.759 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata v1.0.725 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wss v1.0.199 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cfw v1.0.759 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/waf v1.0.759 github.com/tencentyun/cos-go-sdk-v5 v0.7.42-0.20230629101357-7edd77448a0f github.com/yangwenmai/ratelimit v0.0.0-20180104140304-44221c2292e1 gopkg.in/yaml.v2 v2.4.0 ) - require ( 4d63.com/gocheckcompilerdirectives v1.2.1 // indirect 4d63.com/gochecknoglobals v0.2.1 // indirect diff --git a/go.sum b/go.sum index b1f19e5808..1c5eae565e 100644 --- a/go.sum +++ b/go.sum @@ -786,6 +786,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.409 h1:ToZpNh7 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.409/go.mod h1:U24yUxCDruJLayOsP/onO2E/7+9ljeNsNO+phu+PeiM= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat v1.0.520 h1:n4FN0PI+1MVWi+RGQbD/cElXjquZQK0K1h1Z1nNWNWw= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat v1.0.520/go.mod h1:gzI+2Qd/iUfPPQQjW30k0G3mJ3m7tXeXrydJMm8jsOo= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat v1.0.760 h1:oGY4IigfIw0iQKh3/cOY29KBeEeFbvJft69e0beyfdI= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat v1.0.760/go.mod h1:SoBOZr6fklP8zeHaq7XOnCd5xBypU2R94nOPafYX1J4= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.591 h1:TPGLjH6wqkA5Iirl6xCxFkWwrtCZ8ZmeF7ASzqUbsZA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.591/go.mod h1:nCAGfVTXZkVnurkbjF3b0FM6RwGztE9t8D9Ms1unaKo= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.592 h1:xowULQ7Mca1TjHyjAGe8RYjg37yhWpne5Q+TihFNHVA= @@ -878,6 +880,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.758 h1:T7Ry github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.758/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.759 h1:flWgFybB3MYWFxwRO4yXbdiPT3SNwjSLuXCXsfs6kN4= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.759/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.760 h1:OyUPYgXBZNh3erZZ4jhpFH+aGtcCB1TUUtYX4WbR+xg= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.760/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624 h1:nEZqsoqt1pEoaP9JjkHQy3/H00suCfzlHW1qOm2nYD8= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624/go.mod h1:+TXSVyeKwt1IhZRqKPbTREteBcP+K07Q846/ilNzLWA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cwp v1.0.589 h1:LZihgirMH0vsaGScYexxwY0fTss9vHaSZs/YOQUVESg= diff --git a/tencentcloud/data_source_tc_cat_metric_data.go b/tencentcloud/data_source_tc_cat_metric_data.go new file mode 100644 index 0000000000..498416e41d --- /dev/null +++ b/tencentcloud/data_source_tc_cat_metric_data.go @@ -0,0 +1,154 @@ +/* +Use this data source to query detailed information of cat metric_data +Example Usage +```hcl +data "tencentcloud_cat_metric_data" "metric_data" { + analyze_task_type = "AnalyzeTaskType_Network" + metric_type = "gauge" + field = "avg(\"ping_time\")" + filters = [ + "\"host\" = 'www.qq.com'", + "time >= now()-1h", + ] +} +``` +*/ +package tencentcloud + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + cat "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat/v20180409" + sdkErrors "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func dataSourceTencentCloudCatMetricData() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudCatMetricDataRead, + Schema: map[string]*schema.Schema{ + "analyze_task_type": { + Required: true, + Type: schema.TypeString, + Description: "Analysis of task type, supported types: `AnalyzeTaskType_Network`: network quality, `AnalyzeTaskType_Browse`: page performance, `AnalyzeTaskType_Transport`: port performance, `AnalyzeTaskType_UploadDownload`: file transport, `AnalyzeTaskType_MediaStream`: audiovisual experience.", + }, + + "metric_type": { + Required: true, + Type: schema.TypeString, + Description: "Metric type, metrics queries are passed with gauge by default.", + }, + + "field": { + Required: true, + Type: schema.TypeString, + Description: "Detailed fields of metrics, specified metrics can be passed or aggregate metrics, such as avg(ping_time) means entire delay.", + }, + + "filter": { + Optional: true, + Type: schema.TypeString, + Description: "Filter conditions can be passed as a single filter or multiple parameters concatenated together.", + }, + + "group_by": { + Optional: true, + Type: schema.TypeString, + Description: "Aggregation time, such as 1m, 1d, 30d, and so on.", + }, + + "filters": { + Required: true, + Type: schema.TypeSet, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Description: "Multiple condition filtering, supports combining multiple filtering conditions for query.", + }, + + "metric_set": { + Computed: true, + Type: schema.TypeString, + Description: "Return JSON string.", + }, + + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func dataSourceTencentCloudCatMetricDataRead(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("data_source.tencentcloud_cat_metric_data.read")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOk("analyze_task_type"); ok { + paramMap["AnalyzeTaskType"] = helper.String(v.(string)) + } + + if v, ok := d.GetOk("metric_type"); ok { + paramMap["MetricType"] = helper.String(v.(string)) + } + + if v, ok := d.GetOk("field"); ok { + paramMap["Field"] = helper.String(v.(string)) + } + + if v, ok := d.GetOk("filter"); ok { + paramMap["Filter"] = helper.String(v.(string)) + } + + if v, ok := d.GetOk("group_by"); ok { + paramMap["GroupBy"] = helper.String(v.(string)) + } + + if v, ok := d.GetOk("filters"); ok { + filtersSet := v.(*schema.Set).List() + paramMap["Filters"] = helper.InterfacesStringsPoint(filtersSet) + } + + service := CatService{client: meta.(*TencentCloudClient).apiV3Conn} + + var metric *cat.DescribeProbeMetricDataResponseParams + err := resource.Retry(readRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeCatMetricDataByFilter(ctx, paramMap) + if e != nil { + if sdkError, ok := e.(*sdkErrors.TencentCloudSDKError); ok { + if sdkError.Code == "FailedOperation.DbQueryFailed" { + return resource.NonRetryableError(e) + } + } + return retryError(e) + } + metric = result + return nil + }) + if err != nil { + return err + } + + var metricSet string + if metric != nil && metric.MetricSet != nil { + metricSet = *metric.MetricSet + _ = d.Set("metric_set", metric.MetricSet) + } + + d.SetId(helper.DataResourceIdsHash([]string{metricSet})) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := writeToFile(output.(string), metricSet); e != nil { + return e + } + } + return nil +} diff --git a/tencentcloud/data_source_tc_cat_metric_data_test.go b/tencentcloud/data_source_tc_cat_metric_data_test.go new file mode 100644 index 0000000000..a2827dc8ad --- /dev/null +++ b/tencentcloud/data_source_tc_cat_metric_data_test.go @@ -0,0 +1,83 @@ +package tencentcloud + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +// go test -test.run TestAccTencentCloudCatMetricDataDataSource_basic -v +func TestAccTencentCloudCatMetricDataDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCatMetricDataDataSource, + Check: resource.ComposeTestCheckFunc( + testAccCheckTencentCloudDataSourceID("data.tencentcloud_cat_metric_data.metric_data"), + resource.TestCheckResourceAttrSet("data.tencentcloud_cat_metric_data.metric_data", "metric_set"), + ), + }, + }, + }) +} + +const testAccCatMetricDataDataSource = ` +resource "tencentcloud_cat_task_set" "task_set" { + interval = 1 + nodes = [ + "12136", + "12137", + ] + parameters = jsonencode( + { + blackList = "" + filterIp = 0 + grabBag = 0 + ipType = 0 + netDigOn = 1 + netDnsNs = "" + netDnsOn = 1 + netDnsQuerymethod = 1 + netDnsServer = 2 + netDnsTimeout = 5 + netIcmpActivex = 0 + netIcmpActivexStr = "" + netIcmpDataCut = 1 + netIcmpInterval = 0.5 + netIcmpNum = 20 + netIcmpOn = 1 + netIcmpSize = 32 + netIcmpTimeout = 20 + netTracertNum = 30 + netTracertOn = 1 + netTracertTimeout = 60 + whiteList = "" + } + ) + tags = {} + task_category = 1 + task_type = 5 + + batch_tasks { + name = "terraform-test" + target_address = "www.baidu.com" + } +} + +data "tencentcloud_cat_metric_data" "metric_data" { + analyze_task_type = "AnalyzeTaskType_Network" + metric_type = "gauge" + field = "avg(\"ping_time\")" + filters = [ + "\"host\" = 'www.baidu.com'", + "time >= now()-1h", + ] + depends_on = [ tencentcloud_cat_task_set.task_set ] +} + +` diff --git a/tencentcloud/data_source_tc_cat_node.go b/tencentcloud/data_source_tc_cat_node.go index 6d14234f7e..bff9e7d957 100644 --- a/tencentcloud/data_source_tc_cat_node.go +++ b/tencentcloud/data_source_tc_cat_node.go @@ -113,6 +113,12 @@ func dataSourceTencentCloudCatNode() *schema.Resource { Computed: true, Description: "Node status: 1=running, 2=offline.", }, + "task_types": { + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeInt}, + Computed: true, + Description: "The task types supported by the node. `1`: page performance, `2`: file upload, `3`: file download, `4`: port performance, `5`: network quality, `6`: audio and video experience.", + }, }, }, }, @@ -158,7 +164,7 @@ func dataSourceTencentCloudCatNodeRead(d *schema.ResourceData, meta interface{}) var nodeSets []*cat.NodeDefine err := resource.Retry(readRetryTimeout, func() *resource.RetryError { - results, e := catService.DescribeCatNodeByFilter(ctx, paramMap) + results, e := catService.DescribeCatProbeNodeByFilter(ctx, paramMap) if e != nil { return retryError(e) } @@ -170,6 +176,20 @@ func dataSourceTencentCloudCatNodeRead(d *schema.ResourceData, meta interface{}) return err } + var nodeSetExt []*cat.NodeDefineExt + err = resource.Retry(readRetryTimeout, func() *resource.RetryError { + results, e := catService.DescribeCatNodeByFilter(ctx, paramMap) + if e != nil { + return retryError(e) + } + nodeSetExt = results + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s read Cat nodeSet failed, reason:%+v", logId, err) + return err + } + ids := make([]string, 0, len(nodeSets)) nodeSetList := make([]map[string]interface{}, 0, len(nodeSets)) if nodeSets != nil { @@ -205,6 +225,16 @@ func dataSourceTencentCloudCatNodeRead(d *schema.ResourceData, meta interface{}) if nodeSet.NodeDefineStatus != nil { nodeSetMap["node_define_status"] = nodeSet.NodeDefineStatus } + + for _, node := range nodeSetExt { + if *node.Code == *nodeSet.Code { + if node.TaskTypes != nil { + nodeSetMap["task_types"] = node.TaskTypes + } + break + } + } + ids = append(ids, *nodeSet.Name) nodeSetList = append(nodeSetList, nodeSetMap) } diff --git a/tencentcloud/data_source_tc_cat_node_test.go b/tencentcloud/data_source_tc_cat_node_test.go index cff43f99cb..799a97e961 100644 --- a/tencentcloud/data_source_tc_cat_node_test.go +++ b/tencentcloud/data_source_tc_cat_node_test.go @@ -6,6 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) +// go test -test.run TestAccTencentCloudCatNodeDataSource -v func TestAccTencentCloudCatNodeDataSource(t *testing.T) { t.Parallel() @@ -17,6 +18,18 @@ func TestAccTencentCloudCatNodeDataSource(t *testing.T) { Config: testAccDataSourceCatNode, Check: resource.ComposeTestCheckFunc( testAccCheckTencentCloudDataSourceID("data.tencentcloud_cat_node.node"), + resource.TestCheckResourceAttrSet("data.tencentcloud_cat_node.node", "node_define.#"), + resource.TestCheckResourceAttrSet("data.tencentcloud_cat_node.node", "node_define.0.city"), + resource.TestCheckResourceAttrSet("data.tencentcloud_cat_node.node", "node_define.0.code"), + // resource.TestCheckResourceAttrSet("data.tencentcloud_cat_node.node", "node_define.0.code_type"), + resource.TestCheckResourceAttrSet("data.tencentcloud_cat_node.node", "node_define.0.district"), + resource.TestCheckResourceAttrSet("data.tencentcloud_cat_node.node", "node_define.0.ip_type"), + resource.TestCheckResourceAttrSet("data.tencentcloud_cat_node.node", "node_define.0.location"), + // resource.TestCheckResourceAttrSet("data.tencentcloud_cat_node.node", "node_define.0.name"), + resource.TestCheckResourceAttrSet("data.tencentcloud_cat_node.node", "node_define.0.net_service"), + resource.TestCheckResourceAttrSet("data.tencentcloud_cat_node.node", "node_define.0.node_define_status"), + resource.TestCheckResourceAttrSet("data.tencentcloud_cat_node.node", "node_define.0.task_types.#"), + resource.TestCheckResourceAttrSet("data.tencentcloud_cat_node.node", "node_define.0.type"), ), }, }, @@ -27,8 +40,8 @@ const testAccDataSourceCatNode = ` data "tencentcloud_cat_node" "node"{ node_type = 1 - location = 2 - is_ipv6 = false + location = 2 + is_ipv6 = false } ` diff --git a/tencentcloud/provider.go b/tencentcloud/provider.go index ca2a5ba2e8..9c4c2ddef1 100644 --- a/tencentcloud/provider.go +++ b/tencentcloud/provider.go @@ -1275,6 +1275,7 @@ Cloud Automated Testing(CAT) Data Source tencentcloud_cat_probe_data tencentcloud_cat_node + tencentcloud_cat_metric_data Resource tencentcloud_cat_task_set @@ -2218,6 +2219,7 @@ func Provider() *schema.Provider { "tencentcloud_tdcpg_instances": dataSourceTencentCloudTdcpgInstances(), "tencentcloud_cat_probe_data": dataSourceTencentCloudCatProbeData(), "tencentcloud_cat_node": dataSourceTencentCloudCatNode(), + "tencentcloud_cat_metric_data": dataSourceTencentCloudCatMetricData(), "tencentcloud_rum_project": dataSourceTencentCloudRumProject(), "tencentcloud_rum_offline_log_config": dataSourceTencentCloudRumOfflineLogConfig(), "tencentcloud_rum_whitelist": dataSourceTencentCloudRumWhitelist(), diff --git a/tencentcloud/resource_tc_cat_task_set.go b/tencentcloud/resource_tc_cat_task_set.go index e028a6aefc..66470aca20 100644 --- a/tencentcloud/resource_tc_cat_task_set.go +++ b/tencentcloud/resource_tc_cat_task_set.go @@ -44,7 +44,6 @@ resource "tencentcloud_cat_task_set" "task_set" { "createdBy" = "terraform" } } - ``` Import @@ -142,6 +141,12 @@ func resourceTencentCloudCatTaskSet() *schema.Resource { Description: "Timer task cron expression.", }, + "operate": { + Type: schema.TypeString, + Optional: true, + Description: "The input is valid when the parameter is modified, `suspend`/`resume`, used to suspend/resume the dial test task.", + }, + "status": { Type: schema.TypeInt, Computed: true, @@ -379,10 +384,6 @@ func resourceTencentCloudCatTaskSetUpdate(d *schema.ResourceData, meta interface } } - if d.HasChange("batch_tasks") { - return fmt.Errorf("`batch_tasks` do not support change now.") - } - if d.HasChange("task_type") { return fmt.Errorf("`task_type` do not support change now.") } @@ -391,6 +392,42 @@ func resourceTencentCloudCatTaskSetUpdate(d *schema.ResourceData, meta interface return fmt.Errorf("`task_category` do not support change now.") } + if d.HasChange("batch_tasks") { + oldInterface, newInterface := d.GetChange("batch_tasks") + oldMap := make(map[string]interface{}) + newMap := make(map[string]interface{}) + for _, item := range oldInterface.([]interface{}) { + oldMap = item.(map[string]interface{}) + } + for _, item := range newInterface.([]interface{}) { + newMap = item.(map[string]interface{}) + } + replace, _ := diffTags(oldMap, newMap) + + if _, ok := replace["target_address"]; ok { + return fmt.Errorf("`target_address` do not support change now.") + } + + if v, ok := replace["name"]; ok { + requestTaskAttributes := cat.NewUpdateProbeTaskAttributesRequest() + requestTaskAttributes.TaskId = &taskId + requestTaskAttributes.Name = &v + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseCatClient().UpdateProbeTaskAttributes(requestTaskAttributes) + if e != nil { + return retryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s Suspend cat task failed, reason:%+v", logId, err) + return err + } + } + } + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { result, e := meta.(*TencentCloudClient).apiV3Conn.UseCatClient().UpdateProbeTaskConfigurationList(request) if e != nil { @@ -407,6 +444,47 @@ func resourceTencentCloudCatTaskSetUpdate(d *schema.ResourceData, meta interface return err } + if d.HasChange("operate") { + if v, ok := d.GetOk("operate"); ok { + operate := v.(string) + if operate == "suspend" { + requestSuspend := cat.NewSuspendProbeTaskRequest() + requestSuspend.TaskIds = append(requestSuspend.TaskIds, &taskId) + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseCatClient().SuspendProbeTask(requestSuspend) + if e != nil { + return retryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s Suspend cat task failed, reason:%+v", logId, err) + return err + } + } else if operate == "resume" { + requestResume := cat.NewResumeProbeTaskRequest() + requestResume.TaskIds = append(requestResume.TaskIds, &taskId) + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseCatClient().ResumeProbeTask(requestResume) + if e != nil { + return retryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s Resume cat task failed, reason:%+v", logId, err) + return err + } + } else { + return fmt.Errorf("`operate` only allows the input of suspend/resume.") + } + } + } + if d.HasChange("tags") { tcClient := meta.(*TencentCloudClient).apiV3Conn tagService := &TagService{client: tcClient} diff --git a/tencentcloud/resource_tc_cat_task_set_test.go b/tencentcloud/resource_tc_cat_task_set_test.go index 8a8adee722..af93f32005 100644 --- a/tencentcloud/resource_tc_cat_task_set_test.go +++ b/tencentcloud/resource_tc_cat_task_set_test.go @@ -6,6 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) +// go test -i; go test -test.run TestAccTencentCloudCatTaskSet_basic -v func TestAccTencentCloudCatTaskSet_basic(t *testing.T) { t.Parallel() @@ -17,6 +18,16 @@ func TestAccTencentCloudCatTaskSet_basic(t *testing.T) { Config: testAccCatTaskSet, Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet("tencentcloud_cat_task_set.task_set", "id"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "batch_tasks.#", "1"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "batch_tasks.0.name", "demo"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "batch_tasks.0.target_address", "http://www.baidu.com"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "task_type", "5"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "nodes.#", "5"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "interval", "6"), + resource.TestCheckResourceAttrSet("tencentcloud_cat_task_set.task_set", "parameters"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "task_category", "1"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "cron", "* 0-6 * * *"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "tags.createdBy", "terraform"), ), }, { @@ -24,6 +35,29 @@ func TestAccTencentCloudCatTaskSet_basic(t *testing.T) { ImportState: true, ImportStateVerify: true, }, + { + Config: testAccCatTaskSetUp, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_cat_task_set.task_set", "id"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "batch_tasks.0.name", "demo_test"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "batch_tasks.0.target_address", "http://www.baidu.com"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "task_type", "5"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "nodes.#", "5"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "interval", "6"), + resource.TestCheckResourceAttrSet("tencentcloud_cat_task_set.task_set", "parameters"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "task_category", "1"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "cron", "* 0-6 * * *"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "tags.createdBy", "terraform"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "status", "4"), + ), + }, + { + Config: testAccCatTaskSetResume, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_cat_task_set.task_set", "id"), + resource.TestCheckResourceAttr("tencentcloud_cat_task_set.task_set", "status", "10"), + ), + }, }, }) } @@ -72,3 +106,95 @@ resource "tencentcloud_cat_task_set" "task_set" { } ` + +const testAccCatTaskSetUp = ` + +resource "tencentcloud_cat_task_set" "task_set" { + batch_tasks { + name = "demo_test" + target_address = "http://www.baidu.com" + } + task_type = 5 + nodes = ["12136", "12137", "12138", "12141", "12144"] + interval = 6 + parameters = jsonencode( + { + "ipType" = 0, + "grabBag" = 0, + "filterIp" = 0, + "netIcmpOn" = 1, + "netIcmpActivex" = 0, + "netIcmpTimeout" = 20, + "netIcmpInterval" = 0.5, + "netIcmpNum" = 20, + "netIcmpSize" = 32, + "netIcmpDataCut" = 1, + "netDnsOn" = 1, + "netDnsTimeout" = 5, + "netDnsQuerymethod" = 1, + "netDnsNs" = "", + "netDigOn" = 1, + "netDnsServer" = 2, + "netTracertOn" = 1, + "netTracertTimeout" = 60, + "netTracertNum" = 30, + "whiteList" = "", + "blackList" = "", + "netIcmpActivexStr" = "" + } + ) + task_category = 1 + cron = "* 0-6 * * *" + tags = { + "createdBy" = "terraform" + } + operate = "suspend" +} + +` + +const testAccCatTaskSetResume = ` + +resource "tencentcloud_cat_task_set" "task_set" { + batch_tasks { + name = "demo_test" + target_address = "http://www.baidu.com" + } + task_type = 5 + nodes = ["12136", "12137", "12138", "12141", "12144"] + interval = 6 + parameters = jsonencode( + { + "ipType" = 0, + "grabBag" = 0, + "filterIp" = 0, + "netIcmpOn" = 1, + "netIcmpActivex" = 0, + "netIcmpTimeout" = 20, + "netIcmpInterval" = 0.5, + "netIcmpNum" = 20, + "netIcmpSize" = 32, + "netIcmpDataCut" = 1, + "netDnsOn" = 1, + "netDnsTimeout" = 5, + "netDnsQuerymethod" = 1, + "netDnsNs" = "", + "netDigOn" = 1, + "netDnsServer" = 2, + "netTracertOn" = 1, + "netTracertTimeout" = 60, + "netTracertNum" = 30, + "whiteList" = "", + "blackList" = "", + "netIcmpActivexStr" = "" + } + ) + task_category = 1 + cron = "* 0-6 * * *" + tags = { + "createdBy" = "terraform" + } + operate = "resume" +} + +` diff --git a/tencentcloud/service_tencentcloud_cat.go b/tencentcloud/service_tencentcloud_cat.go index 10856e5c3a..3d0cf90ed7 100644 --- a/tencentcloud/service_tencentcloud_cat.go +++ b/tencentcloud/service_tencentcloud_cat.go @@ -91,7 +91,7 @@ func (me *CatService) DeleteCatTaskSetById(ctx context.Context, taskId string) ( return } -func (me *CatService) DescribeCatNodeByFilter(ctx context.Context, param map[string]interface{}) (node []*cat.NodeDefine, errRet error) { +func (me *CatService) DescribeCatProbeNodeByFilter(ctx context.Context, param map[string]interface{}) (node []*cat.NodeDefine, errRet error) { var ( logId = getLogId(ctx) request = cat.NewDescribeProbeNodesRequest() @@ -143,6 +143,59 @@ func (me *CatService) DescribeCatNodeByFilter(ctx context.Context, param map[str return } +// DescribeNodes interface is an alternative interface to DescribeProbeNodes, but it lacks the NodeDefineStatus field, so both interfaces are used at the same time. +func (me *CatService) DescribeCatNodeByFilter(ctx context.Context, param map[string]interface{}) (node []*cat.NodeDefineExt, errRet error) { + var ( + logId = getLogId(ctx) + request = cat.NewDescribeNodesRequest() + ) + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", + logId, "query object", request.ToJsonString(), errRet.Error()) + } + }() + + for k, v := range param { + if k == "node_type" { + request.NodeType = v.(*int64) + } + + if k == "location" { + request.Location = v.(*int64) + } + + if k == "is_ipv6" { + request.IsIPv6 = v.(*bool) + } + + if k == "node_name" { + request.NodeName = v.(*string) + } + + if k == "pay_mode" { + request.PayMode = v.(*int64) + } + + } + + ratelimit.Check(request.GetAction()) + response, err := me.client.UseCatClient().DescribeNodes(request) + if err != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", + logId, request.GetAction(), request.ToJsonString(), err.Error()) + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", + logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + node = append(node, response.Response.NodeSet...) + + return +} + func (me *CatService) DescribeCatProbeDataByFilter(ctx context.Context, param map[string]interface{}) (probeData []*cat.DetailedSingleDataDefine, errRet error) { var ( logId = getLogId(ctx) @@ -237,3 +290,53 @@ func (me *CatService) DescribeCatProbeDataByFilter(ctx context.Context, param ma return } + +func (me *CatService) DescribeCatMetricDataByFilter(ctx context.Context, param map[string]interface{}) (metricData *cat.DescribeProbeMetricDataResponseParams, errRet error) { + var ( + logId = getLogId(ctx) + request = cat.NewDescribeProbeMetricDataRequest() + ) + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + for k, v := range param { + if k == "AnalyzeTaskType" { + request.AnalyzeTaskType = v.(*string) + } + if k == "MetricType" { + request.MetricType = v.(*string) + } + if k == "Field" { + request.Field = v.(*string) + } + if k == "Filter" { + request.Filter = v.(*string) + } + if k == "GroupBy" { + request.GroupBy = v.(*string) + } + if k == "Filters" { + request.Filters = v.([]*string) + } + } + + ratelimit.Check(request.GetAction()) + response, err := me.client.UseCatClient().DescribeProbeMetricData(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + if response == nil || response.Response == nil { + return + } + + metricData = response.Response + + return +} diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat/v20180409/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat/v20180409/client.go index 5db0fa27b9..1b160dd0ab 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat/v20180409/client.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat/v20180409/client.go @@ -345,6 +345,7 @@ func NewDescribeProbeMetricDataResponse() (response *DescribeProbeMetricDataResp // 查询云拨测指标数据,指标支持使用sum,avg,max,min聚合函数进行指标数据查询 // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" // FAILEDOPERATION_DBQUERYFAILED = "FailedOperation.DbQueryFailed" func (c *Client) DescribeProbeMetricData(request *DescribeProbeMetricDataRequest) (response *DescribeProbeMetricDataResponse, err error) { return c.DescribeProbeMetricDataWithContext(context.Background(), request) @@ -354,6 +355,7 @@ func (c *Client) DescribeProbeMetricData(request *DescribeProbeMetricDataRequest // 查询云拨测指标数据,指标支持使用sum,avg,max,min聚合函数进行指标数据查询 // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" // FAILEDOPERATION_DBQUERYFAILED = "FailedOperation.DbQueryFailed" func (c *Client) DescribeProbeMetricDataWithContext(ctx context.Context, request *DescribeProbeMetricDataRequest) (response *DescribeProbeMetricDataResponse, err error) { if request == nil { @@ -619,6 +621,72 @@ func (c *Client) SuspendProbeTaskWithContext(ctx context.Context, request *Suspe return } +func NewUpdateProbeTaskAttributesRequest() (request *UpdateProbeTaskAttributesRequest) { + request = &UpdateProbeTaskAttributesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("cat", APIVersion, "UpdateProbeTaskAttributes") + + + return +} + +func NewUpdateProbeTaskAttributesResponse() (response *UpdateProbeTaskAttributesResponse) { + response = &UpdateProbeTaskAttributesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return +} + +// UpdateProbeTaskAttributes +// 更新探测任务属性 +// +// 可能返回的错误码: +// FAILEDOPERATION_DBQUERYFAILED = "FailedOperation.DbQueryFailed" +// FAILEDOPERATION_DBRECORDCREATEFAILED = "FailedOperation.DbRecordCreateFailed" +// FAILEDOPERATION_DBRECORDUPDATEFAILED = "FailedOperation.DbRecordUpdateFailed" +// FAILEDOPERATION_NOVALIDNODES = "FailedOperation.NoValidNodes" +// FAILEDOPERATION_RESOURCENOTFOUND = "FailedOperation.ResourceNotFound" +// FAILEDOPERATION_TASKNOTRUNNING = "FailedOperation.TaskNotRunning" +// FAILEDOPERATION_TASKNOTSUSPENDED = "FailedOperation.TaskNotSuspended" +// FAILEDOPERATION_TASKOPERATIONNOTALLOW = "FailedOperation.TaskOperationNotAllow" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +func (c *Client) UpdateProbeTaskAttributes(request *UpdateProbeTaskAttributesRequest) (response *UpdateProbeTaskAttributesResponse, err error) { + return c.UpdateProbeTaskAttributesWithContext(context.Background(), request) +} + +// UpdateProbeTaskAttributes +// 更新探测任务属性 +// +// 可能返回的错误码: +// FAILEDOPERATION_DBQUERYFAILED = "FailedOperation.DbQueryFailed" +// FAILEDOPERATION_DBRECORDCREATEFAILED = "FailedOperation.DbRecordCreateFailed" +// FAILEDOPERATION_DBRECORDUPDATEFAILED = "FailedOperation.DbRecordUpdateFailed" +// FAILEDOPERATION_NOVALIDNODES = "FailedOperation.NoValidNodes" +// FAILEDOPERATION_RESOURCENOTFOUND = "FailedOperation.ResourceNotFound" +// FAILEDOPERATION_TASKNOTRUNNING = "FailedOperation.TaskNotRunning" +// FAILEDOPERATION_TASKNOTSUSPENDED = "FailedOperation.TaskNotSuspended" +// FAILEDOPERATION_TASKOPERATIONNOTALLOW = "FailedOperation.TaskOperationNotAllow" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +func (c *Client) UpdateProbeTaskAttributesWithContext(ctx context.Context, request *UpdateProbeTaskAttributesRequest) (response *UpdateProbeTaskAttributesResponse, err error) { + if request == nil { + request = NewUpdateProbeTaskAttributesRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("UpdateProbeTaskAttributes require credential") + } + + request.SetContext(ctx) + + response = NewUpdateProbeTaskAttributesResponse() + err = c.Send(request, response) + return +} + func NewUpdateProbeTaskConfigurationListRequest() (request *UpdateProbeTaskConfigurationListRequest) { request = &UpdateProbeTaskConfigurationListRequest{ BaseRequest: &tchttp.BaseRequest{}, diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat/v20180409/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat/v20180409/models.go index e9ceffecc4..441ef3b8d3 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat/v20180409/models.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat/v20180409/models.go @@ -15,86 +15,86 @@ package v20180409 import ( - "encoding/json" tcerr "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors" tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/json" ) // Predefined struct for user type CreateProbeTasksRequestParams struct { // 批量任务名-地址 - BatchTasks []*ProbeTaskBasicConfiguration `json:"BatchTasks,omitempty" name:"BatchTasks"` + BatchTasks []*ProbeTaskBasicConfiguration `json:"BatchTasks,omitnil" name:"BatchTasks"` // 任务类型 - TaskType *int64 `json:"TaskType,omitempty" name:"TaskType"` + TaskType *int64 `json:"TaskType,omitnil" name:"TaskType"` // 拨测节点 - Nodes []*string `json:"Nodes,omitempty" name:"Nodes"` + Nodes []*string `json:"Nodes,omitnil" name:"Nodes"` // 拨测间隔 - Interval *int64 `json:"Interval,omitempty" name:"Interval"` + Interval *int64 `json:"Interval,omitnil" name:"Interval"` // 拨测参数 - Parameters *string `json:"Parameters,omitempty" name:"Parameters"` + Parameters *string `json:"Parameters,omitnil" name:"Parameters"` // 任务分类 //
  • 1 = PC
  • //
  • 2 = Mobile
  • - TaskCategory *int64 `json:"TaskCategory,omitempty" name:"TaskCategory"` + TaskCategory *int64 `json:"TaskCategory,omitnil" name:"TaskCategory"` // 定时任务cron表达式 - Cron *string `json:"Cron,omitempty" name:"Cron"` + Cron *string `json:"Cron,omitnil" name:"Cron"` // 资源标签值 - Tag []*Tag `json:"Tag,omitempty" name:"Tag"` + Tag []*Tag `json:"Tag,omitnil" name:"Tag"` // 测试类型,包含定时测试与即时测试 - ProbeType *uint64 `json:"ProbeType,omitempty" name:"ProbeType"` + ProbeType *uint64 `json:"ProbeType,omitnil" name:"ProbeType"` // 插件类型 - PluginSource *string `json:"PluginSource,omitempty" name:"PluginSource"` + PluginSource *string `json:"PluginSource,omitnil" name:"PluginSource"` // 客户端ID - ClientNum *string `json:"ClientNum,omitempty" name:"ClientNum"` + ClientNum *string `json:"ClientNum,omitnil" name:"ClientNum"` } type CreateProbeTasksRequest struct { *tchttp.BaseRequest // 批量任务名-地址 - BatchTasks []*ProbeTaskBasicConfiguration `json:"BatchTasks,omitempty" name:"BatchTasks"` + BatchTasks []*ProbeTaskBasicConfiguration `json:"BatchTasks,omitnil" name:"BatchTasks"` // 任务类型 - TaskType *int64 `json:"TaskType,omitempty" name:"TaskType"` + TaskType *int64 `json:"TaskType,omitnil" name:"TaskType"` // 拨测节点 - Nodes []*string `json:"Nodes,omitempty" name:"Nodes"` + Nodes []*string `json:"Nodes,omitnil" name:"Nodes"` // 拨测间隔 - Interval *int64 `json:"Interval,omitempty" name:"Interval"` + Interval *int64 `json:"Interval,omitnil" name:"Interval"` // 拨测参数 - Parameters *string `json:"Parameters,omitempty" name:"Parameters"` + Parameters *string `json:"Parameters,omitnil" name:"Parameters"` // 任务分类 //
  • 1 = PC
  • //
  • 2 = Mobile
  • - TaskCategory *int64 `json:"TaskCategory,omitempty" name:"TaskCategory"` + TaskCategory *int64 `json:"TaskCategory,omitnil" name:"TaskCategory"` // 定时任务cron表达式 - Cron *string `json:"Cron,omitempty" name:"Cron"` + Cron *string `json:"Cron,omitnil" name:"Cron"` // 资源标签值 - Tag []*Tag `json:"Tag,omitempty" name:"Tag"` + Tag []*Tag `json:"Tag,omitnil" name:"Tag"` // 测试类型,包含定时测试与即时测试 - ProbeType *uint64 `json:"ProbeType,omitempty" name:"ProbeType"` + ProbeType *uint64 `json:"ProbeType,omitnil" name:"ProbeType"` // 插件类型 - PluginSource *string `json:"PluginSource,omitempty" name:"PluginSource"` + PluginSource *string `json:"PluginSource,omitnil" name:"PluginSource"` // 客户端ID - ClientNum *string `json:"ClientNum,omitempty" name:"ClientNum"` + ClientNum *string `json:"ClientNum,omitnil" name:"ClientNum"` } func (r *CreateProbeTasksRequest) ToJsonString() string { @@ -129,10 +129,10 @@ func (r *CreateProbeTasksRequest) FromJsonString(s string) error { // Predefined struct for user type CreateProbeTasksResponseParams struct { // 任务ID列表 - TaskIDs []*string `json:"TaskIDs,omitempty" name:"TaskIDs"` + TaskIDs []*string `json:"TaskIDs,omitnil" name:"TaskIDs"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` } type CreateProbeTasksResponse struct { @@ -154,14 +154,14 @@ func (r *CreateProbeTasksResponse) FromJsonString(s string) error { // Predefined struct for user type DeleteProbeTaskRequestParams struct { // 任务 ID - TaskIds []*string `json:"TaskIds,omitempty" name:"TaskIds"` + TaskIds []*string `json:"TaskIds,omitnil" name:"TaskIds"` } type DeleteProbeTaskRequest struct { *tchttp.BaseRequest // 任务 ID - TaskIds []*string `json:"TaskIds,omitempty" name:"TaskIds"` + TaskIds []*string `json:"TaskIds,omitnil" name:"TaskIds"` } func (r *DeleteProbeTaskRequest) ToJsonString() string { @@ -186,18 +186,18 @@ func (r *DeleteProbeTaskRequest) FromJsonString(s string) error { // Predefined struct for user type DeleteProbeTaskResponseParams struct { // 任务总量 - Total *int64 `json:"Total,omitempty" name:"Total"` + Total *int64 `json:"Total,omitnil" name:"Total"` // 任务成功量 // 注意:此字段可能返回 null,表示取不到有效值。 - SuccessCount *int64 `json:"SuccessCount,omitempty" name:"SuccessCount"` + SuccessCount *int64 `json:"SuccessCount,omitnil" name:"SuccessCount"` // 任务执行结果 // 注意:此字段可能返回 null,表示取不到有效值。 - Results []*TaskResult `json:"Results,omitempty" name:"Results"` + Results []*TaskResult `json:"Results,omitnil" name:"Results"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` } type DeleteProbeTaskResponse struct { @@ -219,10 +219,10 @@ func (r *DeleteProbeTaskResponse) FromJsonString(s string) error { // Predefined struct for user type DescribeDetailedSingleProbeDataRequestParams struct { // 开始时间戳(毫秒级) - BeginTime *uint64 `json:"BeginTime,omitempty" name:"BeginTime"` + BeginTime *uint64 `json:"BeginTime,omitnil" name:"BeginTime"` // 结束时间戳(毫秒级) - EndTime *uint64 `json:"EndTime,omitempty" name:"EndTime"` + EndTime *uint64 `json:"EndTime,omitnil" name:"EndTime"` // 任务类型 // AnalyzeTaskType_Network:网络质量 @@ -230,27 +230,27 @@ type DescribeDetailedSingleProbeDataRequestParams struct { // AnalyzeTaskType_UploadDownload:文件传输(含文件上传、文件下载) // AnalyzeTaskType_Transport:端口性能 // AnalyzeTaskType_MediaStream:音视频体验 - TaskType *string `json:"TaskType,omitempty" name:"TaskType"` + TaskType *string `json:"TaskType,omitnil" name:"TaskType"` // 待排序字段 // 可以填写 ProbeTime 拨测时间排序 // 也可填写SelectedFields 中的选中字段 - SortField *string `json:"SortField,omitempty" name:"SortField"` + SortField *string `json:"SortField,omitnil" name:"SortField"` // true表示升序 - Ascending *bool `json:"Ascending,omitempty" name:"Ascending"` + Ascending *bool `json:"Ascending,omitnil" name:"Ascending"` // 选中字段 - SelectedFields []*string `json:"SelectedFields,omitempty" name:"SelectedFields"` + SelectedFields []*string `json:"SelectedFields,omitnil" name:"SelectedFields"` // 起始取数位置 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` + Offset *int64 `json:"Offset,omitnil" name:"Offset"` // 取数数量 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` + Limit *int64 `json:"Limit,omitnil" name:"Limit"` // 任务ID - TaskID []*string `json:"TaskID,omitempty" name:"TaskID"` + TaskID []*string `json:"TaskID,omitnil" name:"TaskID"` // 拨测点运营商 // @@ -259,7 +259,7 @@ type DescribeDetailedSingleProbeDataRequestParams struct { // 电信:中国电信 // 移动:中国移动 // 联通:中国联通 - Operators []*string `json:"Operators,omitempty" name:"Operators"` + Operators []*string `json:"Operators,omitnil" name:"Operators"` // 拨测点地区 // @@ -268,10 +268,10 @@ type DescribeDetailedSingleProbeDataRequestParams struct { // 国内一般是省级单位,如广东、广西、中国香港、新疆;直辖市则填北京、上海 // // 境外一般是国家名,如澳大利亚、新加坡 - Districts []*string `json:"Districts,omitempty" name:"Districts"` + Districts []*string `json:"Districts,omitnil" name:"Districts"` // 错误类型 - ErrorTypes []*string `json:"ErrorTypes,omitempty" name:"ErrorTypes"` + ErrorTypes []*string `json:"ErrorTypes,omitnil" name:"ErrorTypes"` // 城市 // 这里实际按拨测结果中的城市来填写即可 @@ -282,17 +282,17 @@ type DescribeDetailedSingleProbeDataRequestParams struct { // 武汉市 // 首尔 // 多伦多 - City []*string `json:"City,omitempty" name:"City"` + City []*string `json:"City,omitnil" name:"City"` } type DescribeDetailedSingleProbeDataRequest struct { *tchttp.BaseRequest // 开始时间戳(毫秒级) - BeginTime *uint64 `json:"BeginTime,omitempty" name:"BeginTime"` + BeginTime *uint64 `json:"BeginTime,omitnil" name:"BeginTime"` // 结束时间戳(毫秒级) - EndTime *uint64 `json:"EndTime,omitempty" name:"EndTime"` + EndTime *uint64 `json:"EndTime,omitnil" name:"EndTime"` // 任务类型 // AnalyzeTaskType_Network:网络质量 @@ -300,27 +300,27 @@ type DescribeDetailedSingleProbeDataRequest struct { // AnalyzeTaskType_UploadDownload:文件传输(含文件上传、文件下载) // AnalyzeTaskType_Transport:端口性能 // AnalyzeTaskType_MediaStream:音视频体验 - TaskType *string `json:"TaskType,omitempty" name:"TaskType"` + TaskType *string `json:"TaskType,omitnil" name:"TaskType"` // 待排序字段 // 可以填写 ProbeTime 拨测时间排序 // 也可填写SelectedFields 中的选中字段 - SortField *string `json:"SortField,omitempty" name:"SortField"` + SortField *string `json:"SortField,omitnil" name:"SortField"` // true表示升序 - Ascending *bool `json:"Ascending,omitempty" name:"Ascending"` + Ascending *bool `json:"Ascending,omitnil" name:"Ascending"` // 选中字段 - SelectedFields []*string `json:"SelectedFields,omitempty" name:"SelectedFields"` + SelectedFields []*string `json:"SelectedFields,omitnil" name:"SelectedFields"` // 起始取数位置 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` + Offset *int64 `json:"Offset,omitnil" name:"Offset"` // 取数数量 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` + Limit *int64 `json:"Limit,omitnil" name:"Limit"` // 任务ID - TaskID []*string `json:"TaskID,omitempty" name:"TaskID"` + TaskID []*string `json:"TaskID,omitnil" name:"TaskID"` // 拨测点运营商 // @@ -329,7 +329,7 @@ type DescribeDetailedSingleProbeDataRequest struct { // 电信:中国电信 // 移动:中国移动 // 联通:中国联通 - Operators []*string `json:"Operators,omitempty" name:"Operators"` + Operators []*string `json:"Operators,omitnil" name:"Operators"` // 拨测点地区 // @@ -338,10 +338,10 @@ type DescribeDetailedSingleProbeDataRequest struct { // 国内一般是省级单位,如广东、广西、中国香港、新疆;直辖市则填北京、上海 // // 境外一般是国家名,如澳大利亚、新加坡 - Districts []*string `json:"Districts,omitempty" name:"Districts"` + Districts []*string `json:"Districts,omitnil" name:"Districts"` // 错误类型 - ErrorTypes []*string `json:"ErrorTypes,omitempty" name:"ErrorTypes"` + ErrorTypes []*string `json:"ErrorTypes,omitnil" name:"ErrorTypes"` // 城市 // 这里实际按拨测结果中的城市来填写即可 @@ -352,7 +352,7 @@ type DescribeDetailedSingleProbeDataRequest struct { // 武汉市 // 首尔 // 多伦多 - City []*string `json:"City,omitempty" name:"City"` + City []*string `json:"City,omitnil" name:"City"` } func (r *DescribeDetailedSingleProbeDataRequest) ToJsonString() string { @@ -389,13 +389,13 @@ func (r *DescribeDetailedSingleProbeDataRequest) FromJsonString(s string) error // Predefined struct for user type DescribeDetailedSingleProbeDataResponseParams struct { // 单次详情数据 - DataSet []*DetailedSingleDataDefine `json:"DataSet,omitempty" name:"DataSet"` + DataSet []*DetailedSingleDataDefine `json:"DataSet,omitnil" name:"DataSet"` // 符合条件的数据总数 - TotalNumber *int64 `json:"TotalNumber,omitempty" name:"TotalNumber"` + TotalNumber *int64 `json:"TotalNumber,omitnil" name:"TotalNumber"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` } type DescribeDetailedSingleProbeDataResponse struct { @@ -420,24 +420,24 @@ type DescribeNodesRequestParams struct { //
  • 1 = IDC
  • //
  • 2 = LastMile
  • //
  • 3 = Mobile
  • - NodeType *int64 `json:"NodeType,omitempty" name:"NodeType"` + NodeType *int64 `json:"NodeType,omitnil" name:"NodeType"` // 节点区域 //
  • 1 = 中国大陆
  • //
  • 2 = 港澳台
  • //
  • 3 = 境外
  • - Location *int64 `json:"Location,omitempty" name:"Location"` + Location *int64 `json:"Location,omitnil" name:"Location"` // 是否IPv6 - IsIPv6 *bool `json:"IsIPv6,omitempty" name:"IsIPv6"` + IsIPv6 *bool `json:"IsIPv6,omitnil" name:"IsIPv6"` // 名字模糊搜索 - NodeName *string `json:"NodeName,omitempty" name:"NodeName"` + NodeName *string `json:"NodeName,omitnil" name:"NodeName"` // 付费模式 //
  • 1 = 试用版本
  • //
  • 2 = 付费版本
  • - PayMode *int64 `json:"PayMode,omitempty" name:"PayMode"` + PayMode *int64 `json:"PayMode,omitnil" name:"PayMode"` // 任务类型 //
  • 1 = 页面性能
  • @@ -446,7 +446,7 @@ type DescribeNodesRequestParams struct { //
  • 4 = 端口性能
  • //
  • 5 = 网络质量
  • //
  • 6 = 音视频体验
  • - TaskType *int64 `json:"TaskType,omitempty" name:"TaskType"` + TaskType *int64 `json:"TaskType,omitnil" name:"TaskType"` } type DescribeNodesRequest struct { @@ -456,24 +456,24 @@ type DescribeNodesRequest struct { //
  • 1 = IDC
  • //
  • 2 = LastMile
  • //
  • 3 = Mobile
  • - NodeType *int64 `json:"NodeType,omitempty" name:"NodeType"` + NodeType *int64 `json:"NodeType,omitnil" name:"NodeType"` // 节点区域 //
  • 1 = 中国大陆
  • //
  • 2 = 港澳台
  • //
  • 3 = 境外
  • - Location *int64 `json:"Location,omitempty" name:"Location"` + Location *int64 `json:"Location,omitnil" name:"Location"` // 是否IPv6 - IsIPv6 *bool `json:"IsIPv6,omitempty" name:"IsIPv6"` + IsIPv6 *bool `json:"IsIPv6,omitnil" name:"IsIPv6"` // 名字模糊搜索 - NodeName *string `json:"NodeName,omitempty" name:"NodeName"` + NodeName *string `json:"NodeName,omitnil" name:"NodeName"` // 付费模式 //
  • 1 = 试用版本
  • //
  • 2 = 付费版本
  • - PayMode *int64 `json:"PayMode,omitempty" name:"PayMode"` + PayMode *int64 `json:"PayMode,omitnil" name:"PayMode"` // 任务类型 //
  • 1 = 页面性能
  • @@ -482,7 +482,7 @@ type DescribeNodesRequest struct { //
  • 4 = 端口性能
  • //
  • 5 = 网络质量
  • //
  • 6 = 音视频体验
  • - TaskType *int64 `json:"TaskType,omitempty" name:"TaskType"` + TaskType *int64 `json:"TaskType,omitnil" name:"TaskType"` } func (r *DescribeNodesRequest) ToJsonString() string { @@ -513,10 +513,10 @@ func (r *DescribeNodesRequest) FromJsonString(s string) error { type DescribeNodesResponseParams struct { // 节点列表 // 注意:此字段可能返回 null,表示取不到有效值。 - NodeSet []*NodeDefineExt `json:"NodeSet,omitempty" name:"NodeSet"` + NodeSet []*NodeDefineExt `json:"NodeSet,omitnil" name:"NodeSet"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` } type DescribeNodesResponse struct { @@ -543,23 +543,23 @@ type DescribeProbeMetricDataRequestParams struct { // AnalyzeTaskType_Transport:端口性能 // AnalyzeTaskType_UploadDownload:文件传输 // AnalyzeTaskType_MediaStream:音视频体验 - AnalyzeTaskType *string `json:"AnalyzeTaskType,omitempty" name:"AnalyzeTaskType"` + AnalyzeTaskType *string `json:"AnalyzeTaskType,omitnil" name:"AnalyzeTaskType"` // 指标类型,指标查询默认传gauge - MetricType *string `json:"MetricType,omitempty" name:"MetricType"` + MetricType *string `json:"MetricType,omitnil" name:"MetricType"` // 指标详细字段,可以传递传具体的指标也可以对指标进行聚合查询例如:"avg(ping_time)"代表整体时延(ms) - Field *string `json:"Field,omitempty" name:"Field"` + Field *string `json:"Field,omitnil" name:"Field"` // 过滤条件可以传单个过滤条件也可以拼接多个参数 - Filter *string `json:"Filter,omitempty" name:"Filter"` + Filter *string `json:"Filter,omitnil" name:"Filter"` // 聚合时间, 1m、1d、30d 等等 - GroupBy *string `json:"GroupBy,omitempty" name:"GroupBy"` + GroupBy *string `json:"GroupBy,omitnil" name:"GroupBy"` // 多条件过滤,支持多个过滤条件组合查询 // 例如:[""host" = 'www.test.com'", "time >= now()-1h"] - Filters []*string `json:"Filters,omitempty" name:"Filters"` + Filters []*string `json:"Filters,omitnil" name:"Filters"` } type DescribeProbeMetricDataRequest struct { @@ -571,23 +571,23 @@ type DescribeProbeMetricDataRequest struct { // AnalyzeTaskType_Transport:端口性能 // AnalyzeTaskType_UploadDownload:文件传输 // AnalyzeTaskType_MediaStream:音视频体验 - AnalyzeTaskType *string `json:"AnalyzeTaskType,omitempty" name:"AnalyzeTaskType"` + AnalyzeTaskType *string `json:"AnalyzeTaskType,omitnil" name:"AnalyzeTaskType"` // 指标类型,指标查询默认传gauge - MetricType *string `json:"MetricType,omitempty" name:"MetricType"` + MetricType *string `json:"MetricType,omitnil" name:"MetricType"` // 指标详细字段,可以传递传具体的指标也可以对指标进行聚合查询例如:"avg(ping_time)"代表整体时延(ms) - Field *string `json:"Field,omitempty" name:"Field"` + Field *string `json:"Field,omitnil" name:"Field"` // 过滤条件可以传单个过滤条件也可以拼接多个参数 - Filter *string `json:"Filter,omitempty" name:"Filter"` + Filter *string `json:"Filter,omitnil" name:"Filter"` // 聚合时间, 1m、1d、30d 等等 - GroupBy *string `json:"GroupBy,omitempty" name:"GroupBy"` + GroupBy *string `json:"GroupBy,omitnil" name:"GroupBy"` // 多条件过滤,支持多个过滤条件组合查询 // 例如:[""host" = 'www.test.com'", "time >= now()-1h"] - Filters []*string `json:"Filters,omitempty" name:"Filters"` + Filters []*string `json:"Filters,omitnil" name:"Filters"` } func (r *DescribeProbeMetricDataRequest) ToJsonString() string { @@ -618,10 +618,10 @@ func (r *DescribeProbeMetricDataRequest) FromJsonString(s string) error { type DescribeProbeMetricDataResponseParams struct { // 返回指标 JSON 序列化后的字符串,具体如下所示: // "[{\"name\":\"task_navigate_request_gauge\",\"columns\":[\"time\",\"avg(first_screen_time) / 1000\"],\"values\":[[1641571200,6.756600000000001]],\"tags\":null}]" - MetricSet *string `json:"MetricSet,omitempty" name:"MetricSet"` + MetricSet *string `json:"MetricSet,omitnil" name:"MetricSet"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` } type DescribeProbeMetricDataResponse struct { @@ -646,24 +646,24 @@ type DescribeProbeNodesRequestParams struct { //
  • 1 = IDC
  • //
  • 2 = LastMile
  • //
  • 3 = Mobile
  • - NodeType *int64 `json:"NodeType,omitempty" name:"NodeType"` + NodeType *int64 `json:"NodeType,omitnil" name:"NodeType"` // 节点区域 //
  • 1 = 中国大陆
  • //
  • 2 = 港澳台
  • //
  • 3 = 海外
  • - Location *int64 `json:"Location,omitempty" name:"Location"` + Location *int64 `json:"Location,omitnil" name:"Location"` // 是否IPv6 - IsIPv6 *bool `json:"IsIPv6,omitempty" name:"IsIPv6"` + IsIPv6 *bool `json:"IsIPv6,omitnil" name:"IsIPv6"` // 名字模糊搜索 - NodeName *string `json:"NodeName,omitempty" name:"NodeName"` + NodeName *string `json:"NodeName,omitnil" name:"NodeName"` // 付费模式 //
  • 1 = 试用版本
  • //
  • 2 = 付费版本
  • - PayMode *int64 `json:"PayMode,omitempty" name:"PayMode"` + PayMode *int64 `json:"PayMode,omitnil" name:"PayMode"` } type DescribeProbeNodesRequest struct { @@ -673,24 +673,24 @@ type DescribeProbeNodesRequest struct { //
  • 1 = IDC
  • //
  • 2 = LastMile
  • //
  • 3 = Mobile
  • - NodeType *int64 `json:"NodeType,omitempty" name:"NodeType"` + NodeType *int64 `json:"NodeType,omitnil" name:"NodeType"` // 节点区域 //
  • 1 = 中国大陆
  • //
  • 2 = 港澳台
  • //
  • 3 = 海外
  • - Location *int64 `json:"Location,omitempty" name:"Location"` + Location *int64 `json:"Location,omitnil" name:"Location"` // 是否IPv6 - IsIPv6 *bool `json:"IsIPv6,omitempty" name:"IsIPv6"` + IsIPv6 *bool `json:"IsIPv6,omitnil" name:"IsIPv6"` // 名字模糊搜索 - NodeName *string `json:"NodeName,omitempty" name:"NodeName"` + NodeName *string `json:"NodeName,omitnil" name:"NodeName"` // 付费模式 //
  • 1 = 试用版本
  • //
  • 2 = 付费版本
  • - PayMode *int64 `json:"PayMode,omitempty" name:"PayMode"` + PayMode *int64 `json:"PayMode,omitnil" name:"PayMode"` } func (r *DescribeProbeNodesRequest) ToJsonString() string { @@ -720,10 +720,10 @@ func (r *DescribeProbeNodesRequest) FromJsonString(s string) error { type DescribeProbeNodesResponseParams struct { // 节点列表 // 注意:此字段可能返回 null,表示取不到有效值。 - NodeSet []*NodeDefine `json:"NodeSet,omitempty" name:"NodeSet"` + NodeSet []*NodeDefine `json:"NodeSet,omitnil" name:"NodeSet"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` } type DescribeProbeNodesResponse struct { @@ -745,13 +745,13 @@ func (r *DescribeProbeNodesResponse) FromJsonString(s string) error { // Predefined struct for user type DescribeProbeTasksRequestParams struct { // 任务 ID 列表 - TaskIDs []*string `json:"TaskIDs,omitempty" name:"TaskIDs"` + TaskIDs []*string `json:"TaskIDs,omitnil" name:"TaskIDs"` // 任务名 - TaskName *string `json:"TaskName,omitempty" name:"TaskName"` + TaskName *string `json:"TaskName,omitnil" name:"TaskName"` // 拨测目标 - TargetAddress *string `json:"TargetAddress,omitempty" name:"TargetAddress"` + TargetAddress *string `json:"TargetAddress,omitnil" name:"TargetAddress"` // 任务状态列表 //
  • 1 = 创建中
  • @@ -764,23 +764,23 @@ type DescribeProbeTasksRequestParams struct { //
  • 8 = 任务删除异常
  • //
  • 9 = 任务删除
  • //
  • 10 = 定时任务暂停中
  • - TaskStatus []*int64 `json:"TaskStatus,omitempty" name:"TaskStatus"` + TaskStatus []*int64 `json:"TaskStatus,omitnil" name:"TaskStatus"` // 偏移量,默认为0 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` + Offset *int64 `json:"Offset,omitnil" name:"Offset"` // 返回数量,默认为20,最大值为100 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` + Limit *int64 `json:"Limit,omitnil" name:"Limit"` // 付费模式 //
  • 1 = 试用版本
  • //
  • 2 = 付费版本
  • - PayMode *int64 `json:"PayMode,omitempty" name:"PayMode"` + PayMode *int64 `json:"PayMode,omitnil" name:"PayMode"` // 订单状态 //
  • 1 = 正常
  • //
  • 2 = 欠费
  • - OrderState *int64 `json:"OrderState,omitempty" name:"OrderState"` + OrderState *int64 `json:"OrderState,omitnil" name:"OrderState"` // 拨测类型 //
  • 1 = 页面浏览
  • @@ -791,32 +791,32 @@ type DescribeProbeTasksRequestParams struct { //
  • 6 =流媒体
  • // // 即使拨测只支持页面浏览,网络质量,文件下载 - TaskType []*int64 `json:"TaskType,omitempty" name:"TaskType"` + TaskType []*int64 `json:"TaskType,omitnil" name:"TaskType"` // 节点类型 - TaskCategory []*int64 `json:"TaskCategory,omitempty" name:"TaskCategory"` + TaskCategory []*int64 `json:"TaskCategory,omitnil" name:"TaskCategory"` // 排序的列 - OrderBy *string `json:"OrderBy,omitempty" name:"OrderBy"` + OrderBy *string `json:"OrderBy,omitnil" name:"OrderBy"` // 是否正序 - Ascend *bool `json:"Ascend,omitempty" name:"Ascend"` + Ascend *bool `json:"Ascend,omitnil" name:"Ascend"` // 资源标签值 - TagFilters []*KeyValuePair `json:"TagFilters,omitempty" name:"TagFilters"` + TagFilters []*KeyValuePair `json:"TagFilters,omitnil" name:"TagFilters"` } type DescribeProbeTasksRequest struct { *tchttp.BaseRequest // 任务 ID 列表 - TaskIDs []*string `json:"TaskIDs,omitempty" name:"TaskIDs"` + TaskIDs []*string `json:"TaskIDs,omitnil" name:"TaskIDs"` // 任务名 - TaskName *string `json:"TaskName,omitempty" name:"TaskName"` + TaskName *string `json:"TaskName,omitnil" name:"TaskName"` // 拨测目标 - TargetAddress *string `json:"TargetAddress,omitempty" name:"TargetAddress"` + TargetAddress *string `json:"TargetAddress,omitnil" name:"TargetAddress"` // 任务状态列表 //
  • 1 = 创建中
  • @@ -829,23 +829,23 @@ type DescribeProbeTasksRequest struct { //
  • 8 = 任务删除异常
  • //
  • 9 = 任务删除
  • //
  • 10 = 定时任务暂停中
  • - TaskStatus []*int64 `json:"TaskStatus,omitempty" name:"TaskStatus"` + TaskStatus []*int64 `json:"TaskStatus,omitnil" name:"TaskStatus"` // 偏移量,默认为0 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` + Offset *int64 `json:"Offset,omitnil" name:"Offset"` // 返回数量,默认为20,最大值为100 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` + Limit *int64 `json:"Limit,omitnil" name:"Limit"` // 付费模式 //
  • 1 = 试用版本
  • //
  • 2 = 付费版本
  • - PayMode *int64 `json:"PayMode,omitempty" name:"PayMode"` + PayMode *int64 `json:"PayMode,omitnil" name:"PayMode"` // 订单状态 //
  • 1 = 正常
  • //
  • 2 = 欠费
  • - OrderState *int64 `json:"OrderState,omitempty" name:"OrderState"` + OrderState *int64 `json:"OrderState,omitnil" name:"OrderState"` // 拨测类型 //
  • 1 = 页面浏览
  • @@ -856,19 +856,19 @@ type DescribeProbeTasksRequest struct { //
  • 6 =流媒体
  • // // 即使拨测只支持页面浏览,网络质量,文件下载 - TaskType []*int64 `json:"TaskType,omitempty" name:"TaskType"` + TaskType []*int64 `json:"TaskType,omitnil" name:"TaskType"` // 节点类型 - TaskCategory []*int64 `json:"TaskCategory,omitempty" name:"TaskCategory"` + TaskCategory []*int64 `json:"TaskCategory,omitnil" name:"TaskCategory"` // 排序的列 - OrderBy *string `json:"OrderBy,omitempty" name:"OrderBy"` + OrderBy *string `json:"OrderBy,omitnil" name:"OrderBy"` // 是否正序 - Ascend *bool `json:"Ascend,omitempty" name:"Ascend"` + Ascend *bool `json:"Ascend,omitnil" name:"Ascend"` // 资源标签值 - TagFilters []*KeyValuePair `json:"TagFilters,omitempty" name:"TagFilters"` + TagFilters []*KeyValuePair `json:"TagFilters,omitnil" name:"TagFilters"` } func (r *DescribeProbeTasksRequest) ToJsonString() string { @@ -906,13 +906,13 @@ func (r *DescribeProbeTasksRequest) FromJsonString(s string) error { type DescribeProbeTasksResponseParams struct { // 任务列表 // 注意:此字段可能返回 null,表示取不到有效值。 - TaskSet []*ProbeTask `json:"TaskSet,omitempty" name:"TaskSet"` + TaskSet []*ProbeTask `json:"TaskSet,omitnil" name:"TaskSet"` // 任务总数 - Total *int64 `json:"Total,omitempty" name:"Total"` + Total *int64 `json:"Total,omitnil" name:"Total"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` } type DescribeProbeTasksResponse struct { @@ -933,209 +933,229 @@ func (r *DescribeProbeTasksResponse) FromJsonString(s string) error { type DetailedSingleDataDefine struct { // 拨测时间戳 - ProbeTime *uint64 `json:"ProbeTime,omitempty" name:"ProbeTime"` + ProbeTime *uint64 `json:"ProbeTime,omitnil" name:"ProbeTime"` // 储存所有string类型字段 - Labels []*Label `json:"Labels,omitempty" name:"Labels"` + Labels []*Label `json:"Labels,omitnil" name:"Labels"` // 储存所有float类型字段 - Fields []*Field `json:"Fields,omitempty" name:"Fields"` + Fields []*Field `json:"Fields,omitnil" name:"Fields"` } type Field struct { // 自定义字段编号 - ID *uint64 `json:"ID,omitempty" name:"ID"` + ID *uint64 `json:"ID,omitnil" name:"ID"` // 自定义字段名称/说明 - Name *string `json:"Name,omitempty" name:"Name"` + Name *string `json:"Name,omitnil" name:"Name"` // 字段值 - Value *float64 `json:"Value,omitempty" name:"Value"` + Value *float64 `json:"Value,omitnil" name:"Value"` } type KeyValuePair struct { // 健 - Key *string `json:"Key,omitempty" name:"Key"` + Key *string `json:"Key,omitnil" name:"Key"` // 值 - Value *string `json:"Value,omitempty" name:"Value"` + Value *string `json:"Value,omitnil" name:"Value"` } type Label struct { // 自定义字段编号 - ID *uint64 `json:"ID,omitempty" name:"ID"` + ID *uint64 `json:"ID,omitnil" name:"ID"` // 自定义字段名称/说明 - Name *string `json:"Name,omitempty" name:"Name"` + Name *string `json:"Name,omitnil" name:"Name"` // 字段值 - Value *string `json:"Value,omitempty" name:"Value"` + Value *string `json:"Value,omitnil" name:"Value"` } type NodeDefine struct { // 节点名称 - Name *string `json:"Name,omitempty" name:"Name"` + Name *string `json:"Name,omitnil" name:"Name"` // 节点代码 - Code *string `json:"Code,omitempty" name:"Code"` + Code *string `json:"Code,omitnil" name:"Code"` // 节点类型 //
  • 1 = IDC
  • //
  • 2 = LastMile
  • //
  • 3 = Mobile
  • - Type *int64 `json:"Type,omitempty" name:"Type"` + Type *int64 `json:"Type,omitnil" name:"Type"` // 网络服务商 - NetService *string `json:"NetService,omitempty" name:"NetService"` + NetService *string `json:"NetService,omitnil" name:"NetService"` // 区域 - District *string `json:"District,omitempty" name:"District"` + District *string `json:"District,omitnil" name:"District"` // 城市 - City *string `json:"City,omitempty" name:"City"` + City *string `json:"City,omitnil" name:"City"` // IP 类型 //
  • 1 = IPv4
  • //
  • 2 = IPv6
  • // 注意:此字段可能返回 null,表示取不到有效值。 - IPType *int64 `json:"IPType,omitempty" name:"IPType"` + IPType *int64 `json:"IPType,omitnil" name:"IPType"` // 区域 //
  • 1 = 中国大陆
  • //
  • 2 = 港澳台
  • //
  • 3 = 国外
  • // 注意:此字段可能返回 null,表示取不到有效值。 - Location *int64 `json:"Location,omitempty" name:"Location"` + Location *int64 `json:"Location,omitnil" name:"Location"` // 节点类型 如果为base 则为可用性拨测点,为空则为高级拨测点 // 注意:此字段可能返回 null,表示取不到有效值。 - CodeType *string `json:"CodeType,omitempty" name:"CodeType"` + CodeType *string `json:"CodeType,omitnil" name:"CodeType"` // 节点状态:1-运行,2-下线 // 注意:此字段可能返回 null,表示取不到有效值。 - NodeDefineStatus *uint64 `json:"NodeDefineStatus,omitempty" name:"NodeDefineStatus"` + NodeDefineStatus *uint64 `json:"NodeDefineStatus,omitnil" name:"NodeDefineStatus"` } type NodeDefineExt struct { // 节点名称 - Name *string `json:"Name,omitempty" name:"Name"` + Name *string `json:"Name,omitnil" name:"Name"` // 节点代码 - Code *string `json:"Code,omitempty" name:"Code"` + Code *string `json:"Code,omitnil" name:"Code"` // 节点类型 //
  • 1 = IDC
  • //
  • 2 = LastMile
  • //
  • 3 = Mobile
  • - Type *int64 `json:"Type,omitempty" name:"Type"` + Type *int64 `json:"Type,omitnil" name:"Type"` // 网络服务商 - NetService *string `json:"NetService,omitempty" name:"NetService"` + NetService *string `json:"NetService,omitnil" name:"NetService"` // 区域 - District *string `json:"District,omitempty" name:"District"` + District *string `json:"District,omitnil" name:"District"` // 城市 - City *string `json:"City,omitempty" name:"City"` + City *string `json:"City,omitnil" name:"City"` // IP 类型 //
  • 1 = IPv4
  • //
  • 2 = IPv6
  • // 注意:此字段可能返回 null,表示取不到有效值。 - IPType *int64 `json:"IPType,omitempty" name:"IPType"` + IPType *int64 `json:"IPType,omitnil" name:"IPType"` // 区域 //
  • 1 = 中国大陆
  • //
  • 2 = 港澳台
  • //
  • 3 = 境外
  • // 注意:此字段可能返回 null,表示取不到有效值。 - Location *int64 `json:"Location,omitempty" name:"Location"` + Location *int64 `json:"Location,omitnil" name:"Location"` // 节点类型 如果为base 则为可用性拨测点,为空则为高级拨测点 // 注意:此字段可能返回 null,表示取不到有效值。 - CodeType *string `json:"CodeType,omitempty" name:"CodeType"` + CodeType *string `json:"CodeType,omitnil" name:"CodeType"` // 节点支持的任务类型。1: 页面性能 2: 文件上传 3: 文件下载 4: 端口性能 5: 网络质量 6: 音视频体验 // 注意:此字段可能返回 null,表示取不到有效值。 - TaskTypes []*int64 `json:"TaskTypes,omitempty" name:"TaskTypes"` + TaskTypes []*int64 `json:"TaskTypes,omitnil" name:"TaskTypes"` } type ProbeTask struct { // 任务名 // 注意:此字段可能返回 null,表示取不到有效值。 - Name *string `json:"Name,omitempty" name:"Name"` + Name *string `json:"Name,omitnil" name:"Name"` // 任务 ID - TaskId *string `json:"TaskId,omitempty" name:"TaskId"` + TaskId *string `json:"TaskId,omitnil" name:"TaskId"` - // 任务类型 - TaskType *int64 `json:"TaskType,omitempty" name:"TaskType"` + // 拨测类型 + //
  • 1 = 页面浏览
  • + //
  • 2 =文件上传
  • + //
  • 3 = 文件下载
  • + //
  • 4 = 端口性能
  • + //
  • 5 = 网络质量
  • + //
  • 6 =流媒体
  • + // + // 即时拨测只支持页面浏览,网络质量,文件下载 + TaskType *int64 `json:"TaskType,omitnil" name:"TaskType"` // 拨测节点列表 - Nodes []*string `json:"Nodes,omitempty" name:"Nodes"` + Nodes []*string `json:"Nodes,omitnil" name:"Nodes"` // 拨测间隔 - Interval *int64 `json:"Interval,omitempty" name:"Interval"` + Interval *int64 `json:"Interval,omitnil" name:"Interval"` // 拨测参数 - Parameters *string `json:"Parameters,omitempty" name:"Parameters"` + Parameters *string `json:"Parameters,omitnil" name:"Parameters"` // 任务状态 - Status *int64 `json:"Status,omitempty" name:"Status"` + //
  • 1 = 创建中
  • + //
  • 2 = 运行中
  • + //
  • 3 = 运行异常
  • + //
  • 4 = 暂停中
  • + //
  • 5 = 暂停异常
  • + //
  • 6 = 任务暂停
  • + //
  • 7 = 任务删除中
  • + //
  • 8 = 任务删除异常
  • + //
  • 9 = 任务删除
  • + //
  • 10 = 定时任务暂停中
  • + Status *int64 `json:"Status,omitnil" name:"Status"` // 目标地址 - TargetAddress *string `json:"TargetAddress,omitempty" name:"TargetAddress"` + TargetAddress *string `json:"TargetAddress,omitnil" name:"TargetAddress"` // 付费模式 //
  • 1 = 试用版本
  • //
  • 2 = 付费版本
  • - PayMode *int64 `json:"PayMode,omitempty" name:"PayMode"` + PayMode *int64 `json:"PayMode,omitnil" name:"PayMode"` // 订单状态 //
  • 1 = 正常
  • //
  • 2 = 欠费
  • - OrderState *int64 `json:"OrderState,omitempty" name:"OrderState"` + OrderState *int64 `json:"OrderState,omitnil" name:"OrderState"` // 任务分类 //
  • 1 = PC
  • //
  • 2 = Mobile
  • - TaskCategory *int64 `json:"TaskCategory,omitempty" name:"TaskCategory"` + TaskCategory *int64 `json:"TaskCategory,omitnil" name:"TaskCategory"` // 创建时间 - CreatedAt *string `json:"CreatedAt,omitempty" name:"CreatedAt"` + CreatedAt *string `json:"CreatedAt,omitnil" name:"CreatedAt"` // 定时任务cron表达式 // 注意:此字段可能返回 null,表示取不到有效值。 - Cron *string `json:"Cron,omitempty" name:"Cron"` + Cron *string `json:"Cron,omitnil" name:"Cron"` // 定时任务启动状态 + //
  • 1 = 定时任务表达式生效
  • + //
  • 2 = 定时任务表达式未生效(一般为任务手动暂停)
  • // 注意:此字段可能返回 null,表示取不到有效值。 - CronState *int64 `json:"CronState,omitempty" name:"CronState"` + CronState *int64 `json:"CronState,omitnil" name:"CronState"` // 任务当前绑定的标签 // 注意:此字段可能返回 null,表示取不到有效值。 - TagInfoList []*KeyValuePair `json:"TagInfoList,omitempty" name:"TagInfoList"` + TagInfoList []*KeyValuePair `json:"TagInfoList,omitnil" name:"TagInfoList"` } type ProbeTaskBasicConfiguration struct { // 拨测任务名称 - Name *string `json:"Name,omitempty" name:"Name"` + Name *string `json:"Name,omitnil" name:"Name"` // 拨测目标地址 - TargetAddress *string `json:"TargetAddress,omitempty" name:"TargetAddress"` + TargetAddress *string `json:"TargetAddress,omitnil" name:"TargetAddress"` } // Predefined struct for user type ResumeProbeTaskRequestParams struct { // 任务 ID - TaskIds []*string `json:"TaskIds,omitempty" name:"TaskIds"` + TaskIds []*string `json:"TaskIds,omitnil" name:"TaskIds"` } type ResumeProbeTaskRequest struct { *tchttp.BaseRequest // 任务 ID - TaskIds []*string `json:"TaskIds,omitempty" name:"TaskIds"` + TaskIds []*string `json:"TaskIds,omitnil" name:"TaskIds"` } func (r *ResumeProbeTaskRequest) ToJsonString() string { @@ -1160,18 +1180,18 @@ func (r *ResumeProbeTaskRequest) FromJsonString(s string) error { // Predefined struct for user type ResumeProbeTaskResponseParams struct { // 任务总量 - Total *int64 `json:"Total,omitempty" name:"Total"` + Total *int64 `json:"Total,omitnil" name:"Total"` // 任务成功量 // 注意:此字段可能返回 null,表示取不到有效值。 - SuccessCount *int64 `json:"SuccessCount,omitempty" name:"SuccessCount"` + SuccessCount *int64 `json:"SuccessCount,omitnil" name:"SuccessCount"` // 任务执行详情 // 注意:此字段可能返回 null,表示取不到有效值。 - Results []*TaskResult `json:"Results,omitempty" name:"Results"` + Results []*TaskResult `json:"Results,omitnil" name:"Results"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` } type ResumeProbeTaskResponse struct { @@ -1193,14 +1213,14 @@ func (r *ResumeProbeTaskResponse) FromJsonString(s string) error { // Predefined struct for user type SuspendProbeTaskRequestParams struct { // 任务 ID - TaskIds []*string `json:"TaskIds,omitempty" name:"TaskIds"` + TaskIds []*string `json:"TaskIds,omitnil" name:"TaskIds"` } type SuspendProbeTaskRequest struct { *tchttp.BaseRequest // 任务 ID - TaskIds []*string `json:"TaskIds,omitempty" name:"TaskIds"` + TaskIds []*string `json:"TaskIds,omitnil" name:"TaskIds"` } func (r *SuspendProbeTaskRequest) ToJsonString() string { @@ -1225,18 +1245,18 @@ func (r *SuspendProbeTaskRequest) FromJsonString(s string) error { // Predefined struct for user type SuspendProbeTaskResponseParams struct { // 任务总量 - Total *int64 `json:"Total,omitempty" name:"Total"` + Total *int64 `json:"Total,omitnil" name:"Total"` // 任务成功量 // 注意:此字段可能返回 null,表示取不到有效值。 - SuccessCount *int64 `json:"SuccessCount,omitempty" name:"SuccessCount"` + SuccessCount *int64 `json:"SuccessCount,omitnil" name:"SuccessCount"` // 任务执行结果 // 注意:此字段可能返回 null,表示取不到有效值。 - Results []*TaskResult `json:"Results,omitempty" name:"Results"` + Results []*TaskResult `json:"Results,omitnil" name:"Results"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` } type SuspendProbeTaskResponse struct { @@ -1257,68 +1277,129 @@ func (r *SuspendProbeTaskResponse) FromJsonString(s string) error { type Tag struct { // key - TagKey *string `json:"TagKey,omitempty" name:"TagKey"` + TagKey *string `json:"TagKey,omitnil" name:"TagKey"` // value - TagValue *string `json:"TagValue,omitempty" name:"TagValue"` + TagValue *string `json:"TagValue,omitnil" name:"TagValue"` } type TaskResult struct { // 任务 ID - TaskId *string `json:"TaskId,omitempty" name:"TaskId"` + TaskId *string `json:"TaskId,omitnil" name:"TaskId"` // 是否成功 // 注意:此字段可能返回 null,表示取不到有效值。 - Success *bool `json:"Success,omitempty" name:"Success"` + Success *bool `json:"Success,omitnil" name:"Success"` // 错误信息 // 注意:此字段可能返回 null,表示取不到有效值。 - ErrorMessage *string `json:"ErrorMessage,omitempty" name:"ErrorMessage"` + ErrorMessage *string `json:"ErrorMessage,omitnil" name:"ErrorMessage"` +} + +// Predefined struct for user +type UpdateProbeTaskAttributesRequestParams struct { + // 任务 ID + TaskId *string `json:"TaskId,omitnil" name:"TaskId"` + + // 任务名 + Name *string `json:"Name,omitnil" name:"Name"` +} + +type UpdateProbeTaskAttributesRequest struct { + *tchttp.BaseRequest + + // 任务 ID + TaskId *string `json:"TaskId,omitnil" name:"TaskId"` + + // 任务名 + Name *string `json:"Name,omitnil" name:"Name"` +} + +func (r *UpdateProbeTaskAttributesRequest) 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 *UpdateProbeTaskAttributesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "TaskId") + delete(f, "Name") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UpdateProbeTaskAttributesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type UpdateProbeTaskAttributesResponseParams struct { + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type UpdateProbeTaskAttributesResponse struct { + *tchttp.BaseResponse + Response *UpdateProbeTaskAttributesResponseParams `json:"Response"` +} + +func (r *UpdateProbeTaskAttributesResponse) 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 *UpdateProbeTaskAttributesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) } // Predefined struct for user type UpdateProbeTaskConfigurationListRequestParams struct { // 任务 ID - TaskIds []*string `json:"TaskIds,omitempty" name:"TaskIds"` + TaskIds []*string `json:"TaskIds,omitnil" name:"TaskIds"` // 拨测节点 - Nodes []*string `json:"Nodes,omitempty" name:"Nodes"` + Nodes []*string `json:"Nodes,omitnil" name:"Nodes"` // 拨测间隔 - Interval *int64 `json:"Interval,omitempty" name:"Interval"` + Interval *int64 `json:"Interval,omitnil" name:"Interval"` // 拨测参数 - Parameters *string `json:"Parameters,omitempty" name:"Parameters"` + Parameters *string `json:"Parameters,omitnil" name:"Parameters"` // 定时任务cron表达式 - Cron *string `json:"Cron,omitempty" name:"Cron"` + Cron *string `json:"Cron,omitnil" name:"Cron"` // 预付费套餐id // 需要与taskId对应 - ResourceIDs []*string `json:"ResourceIDs,omitempty" name:"ResourceIDs"` + ResourceIDs []*string `json:"ResourceIDs,omitnil" name:"ResourceIDs"` } type UpdateProbeTaskConfigurationListRequest struct { *tchttp.BaseRequest // 任务 ID - TaskIds []*string `json:"TaskIds,omitempty" name:"TaskIds"` + TaskIds []*string `json:"TaskIds,omitnil" name:"TaskIds"` // 拨测节点 - Nodes []*string `json:"Nodes,omitempty" name:"Nodes"` + Nodes []*string `json:"Nodes,omitnil" name:"Nodes"` // 拨测间隔 - Interval *int64 `json:"Interval,omitempty" name:"Interval"` + Interval *int64 `json:"Interval,omitnil" name:"Interval"` // 拨测参数 - Parameters *string `json:"Parameters,omitempty" name:"Parameters"` + Parameters *string `json:"Parameters,omitnil" name:"Parameters"` // 定时任务cron表达式 - Cron *string `json:"Cron,omitempty" name:"Cron"` + Cron *string `json:"Cron,omitnil" name:"Cron"` // 预付费套餐id // 需要与taskId对应 - ResourceIDs []*string `json:"ResourceIDs,omitempty" name:"ResourceIDs"` + ResourceIDs []*string `json:"ResourceIDs,omitnil" name:"ResourceIDs"` } func (r *UpdateProbeTaskConfigurationListRequest) ToJsonString() string { @@ -1348,7 +1429,7 @@ func (r *UpdateProbeTaskConfigurationListRequest) FromJsonString(s string) error // Predefined struct for user type UpdateProbeTaskConfigurationListResponseParams struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` } type UpdateProbeTaskConfigurationListResponse struct { diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go index c68073ddb2..2be7d85400 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go @@ -265,7 +265,7 @@ func CompleteCommonParams(request Request, region string, requestClient string) params["Action"] = request.GetAction() params["Timestamp"] = strconv.FormatInt(time.Now().Unix(), 10) params["Nonce"] = strconv.Itoa(rand.Int()) - params["RequestClient"] = "SDK_GO_1.0.759" + params["RequestClient"] = "SDK_GO_1.0.760" if requestClient != "" { params["RequestClient"] += ": " + requestClient } diff --git a/vendor/modules.txt b/vendor/modules.txt index f7695c6c49..a32e7e7783 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1058,7 +1058,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as/v20180419 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.409 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat v1.0.520 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat v1.0.760 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat/v20180409 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.591 @@ -1097,7 +1097,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit/v20190319 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.711 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls/v20201016 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.759 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.760 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors diff --git a/website/docs/d/cat_metric_data.html.markdown b/website/docs/d/cat_metric_data.html.markdown new file mode 100644 index 0000000000..de70a2cb80 --- /dev/null +++ b/website/docs/d/cat_metric_data.html.markdown @@ -0,0 +1,46 @@ +--- +subcategory: "Cloud Automated Testing(CAT)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_cat_metric_data" +sidebar_current: "docs-tencentcloud-datasource-cat_metric_data" +description: |- + Use this data source to query detailed information of cat metric_data +--- + +# tencentcloud_cat_metric_data + +Use this data source to query detailed information of cat metric_data + +## Example Usage + +```hcl +data "tencentcloud_cat_metric_data" "metric_data" { + analyze_task_type = "AnalyzeTaskType_Network" + metric_type = "gauge" + field = "avg(\"ping_time\")" + filters = [ + "\"host\" = 'www.qq.com'", + "time >= now()-1h", + ] +} +``` + +## Argument Reference + +The following arguments are supported: + +* `analyze_task_type` - (Required, String) Analysis of task type, supported types: `AnalyzeTaskType_Network`: network quality, `AnalyzeTaskType_Browse`: page performance, `AnalyzeTaskType_Transport`: port performance, `AnalyzeTaskType_UploadDownload`: file transport, `AnalyzeTaskType_MediaStream`: audiovisual experience. +* `field` - (Required, String) Detailed fields of metrics, specified metrics can be passed or aggregate metrics, such as avg(ping_time) means entire delay. +* `filters` - (Required, Set: [`String`]) Multiple condition filtering, supports combining multiple filtering conditions for query. +* `metric_type` - (Required, String) Metric type, metrics queries are passed with gauge by default. +* `filter` - (Optional, String) Filter conditions can be passed as a single filter or multiple parameters concatenated together. +* `group_by` - (Optional, String) Aggregation time, such as 1m, 1d, 30d, and so on. +* `result_output_file` - (Optional, String) Used to save results. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `metric_set` - Return JSON string. + + diff --git a/website/docs/d/cat_node.html.markdown b/website/docs/d/cat_node.html.markdown index bef719dd7b..9191e39335 100644 --- a/website/docs/d/cat_node.html.markdown +++ b/website/docs/d/cat_node.html.markdown @@ -46,6 +46,7 @@ In addition to all arguments above, the following attributes are exported: * `name` - Node name. * `net_service` - Network service provider. * `node_define_status` - Node status: 1=running, 2=offline. + * `task_types` - The task types supported by the node. `1`: page performance, `2`: file upload, `3`: file download, `4`: port performance, `5`: network quality, `6`: audio and video experience. * `type` - Node Type;1 = IDC,2 = LastMile,3 = Mobile. diff --git a/website/docs/r/cat_task_set.html.markdown b/website/docs/r/cat_task_set.html.markdown index cfc2e5d05d..ea5b75bc6e 100644 --- a/website/docs/r/cat_task_set.html.markdown +++ b/website/docs/r/cat_task_set.html.markdown @@ -67,6 +67,7 @@ The following arguments are supported: * `task_category` - (Required, Int) Task category,1:PC,2:Mobile. * `task_type` - (Required, Int) Task Type 1:Page Performance, 2:File upload,3:File Download,4:Port performance 5:Audio and video. * `cron` - (Optional, String) Timer task cron expression. +* `operate` - (Optional, String) The input is valid when the parameter is modified, `suspend`/`resume`, used to suspend/resume the dial test task. * `tags` - (Optional, Map) Tag description list. The `batch_tasks` object supports the following: diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index ebefc79b2e..78ce9eee09 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -587,6 +587,9 @@
  • Data Sources