tccli 3.0.1113.1__py2.py3-none-any.whl → 3.0.1114.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
tccli/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '3.0.1113.1'
1
+ __version__ = '3.0.1114.1'
@@ -36,7 +36,7 @@
36
36
  "status": "online"
37
37
  },
38
38
  "DescribeProbeMetricData": {
39
- "document": "查询云拨测指标数据,指标支持使用sum,avg,max,min聚合函数进行指标数据查询",
39
+ "document": "查询云拨测指标数据,指标支持使用sum,avg,max,min聚合函数进行指标数据查询\n拨测频率与groupby聚合时间设置关联,如拨测频率为 30 分钟,则 grouby 聚合时间建议设置为大于30分钟,避免出现查询数据为空的情况",
40
40
  "input": "DescribeProbeMetricDataRequest",
41
41
  "name": "列出云拨测指标详细数据",
42
42
  "output": "DescribeProbeMetricDataResponse",
@@ -670,7 +670,7 @@
670
670
  "members": [
671
671
  {
672
672
  "disabled": false,
673
- "document": "返回指标 JSON 序列化后的字符串,具体如下所示:\n\"[{\\\"name\\\":\\\"task_navigate_request_gauge\\\",\\\"columns\\\":[\\\"time\\\",\\\"avg(first_screen_time) / 1000\\\"],\\\"values\\\":[[1641571200,6.756600000000001]],\\\"tags\\\":null}]\"",
673
+ "document": " 返回指标 JSON 序列化后的字符串,具体如下所示:\"[{\\\"name\\\":\\\"task_navigate_request_gauge\\\",\\\"columns\\\":[\\\"time\\\",\\\"avg(first_screen_time) / 1000\\\"],\\\"values\\\":[[1641571200,6.756600000000001]],\\\"tags\\\":null}]\"",
674
674
  "example": "\"\"",
675
675
  "member": "string",
676
676
  "name": "MetricSet",
@@ -49,8 +49,8 @@
49
49
  "DescribeProbeMetricData": [
50
50
  {
51
51
  "document": "请求浏览数据",
52
- "input": "POST / HTTP/1.1\nHost: cat.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeProbeMetricData\n<公共请求参数>\n\n{\n \"AnalyzeTaskType\": \"AnalyzeTaskType_Browse\",\n \"MetricType\": \"gauge\",\n \"Field\": \"avg(\\\"count\\\")\",\n \"GroupBy\": \"time(30d), \\\"operator\\\"\",\n \"Filters\": [\n \"\\\"host\\\" = 'default-host'\",\n \"time >= now()-3h\"\n ]\n}",
53
- "output": "{\n \"Response\": {\n \"MetricSet\": \"abc\",\n \"RequestId\": \"abc\"\n }\n}",
52
+ "input": "POST / HTTP/1.1\nHost: cat.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeProbeMetricData\n<公共请求参数>\n\n{\n \"AnalyzeTaskType\": \"AnalyzeTaskType_Network\",\n \"MetricType\": \"gauge\",\n \"Field\": \"sum(\\\"error_count\\\")\",\n \"GroupBy\": \"time(30d), \\\"operator\\\"\",\n \"Filters\": [\n \"\\\"host\\\" = 'default-host'\",\n \"time >= now()-1h\"\n ]\n}",
53
+ "output": "{\n \"Response\": {\n \"MetricSet\": \"[{\\\"name\\\":\\\"netenv_request_gauge\\\",\\\"columns\\\":[\\\"time\\\",\\\"sum(error_count)\\\"],\\\"values\\\":[[xxxxx,xxxxx]],\\\"tags\\\":null}]\",\n \"RequestId\": \"xxxxx\"\n }\n}",
54
54
  "title": "请求浏览数据"
55
55
  }
56
56
  ],
@@ -1891,7 +1891,7 @@ def doDescribeAllUserContact(args, parsed_globals):
1891
1891
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1892
1892
 
1893
1893
 
1894
- def doDescribeProxyProcessStatistics(args, parsed_globals):
1894
+ def doDescribeRedisBigKeyAnalysisTasks(args, parsed_globals):
1895
1895
  g_param = parse_global_arg(parsed_globals)
1896
1896
 
1897
1897
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1920,11 +1920,11 @@ def doDescribeProxyProcessStatistics(args, parsed_globals):
1920
1920
  client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
1921
1921
  client._sdkVersion += ("_CLI_" + __version__)
1922
1922
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1923
- model = models.DescribeProxyProcessStatisticsRequest()
1923
+ model = models.DescribeRedisBigKeyAnalysisTasksRequest()
1924
1924
  model.from_json_string(json.dumps(args))
1925
1925
  start_time = time.time()
1926
1926
  while True:
1927
- rsp = client.DescribeProxyProcessStatistics(model)
1927
+ rsp = client.DescribeRedisBigKeyAnalysisTasks(model)
1928
1928
  result = rsp.to_json_string()
1929
1929
  try:
1930
1930
  json_obj = json.loads(result)
@@ -2567,6 +2567,58 @@ def doModifyDiagDBInstanceConf(args, parsed_globals):
2567
2567
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2568
2568
 
2569
2569
 
2570
+ def doDescribeProxyProcessStatistics(args, parsed_globals):
2571
+ g_param = parse_global_arg(parsed_globals)
2572
+
2573
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2574
+ cred = credential.CVMRoleCredential()
2575
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2576
+ cred = credential.STSAssumeRoleCredential(
2577
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2578
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2579
+ )
2580
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
2581
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2582
+ else:
2583
+ cred = credential.Credential(
2584
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2585
+ )
2586
+ http_profile = HttpProfile(
2587
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2588
+ reqMethod="POST",
2589
+ endpoint=g_param[OptionsDefine.Endpoint],
2590
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2591
+ )
2592
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2593
+ if g_param[OptionsDefine.Language]:
2594
+ profile.language = g_param[OptionsDefine.Language]
2595
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2596
+ client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
2597
+ client._sdkVersion += ("_CLI_" + __version__)
2598
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
2599
+ model = models.DescribeProxyProcessStatisticsRequest()
2600
+ model.from_json_string(json.dumps(args))
2601
+ start_time = time.time()
2602
+ while True:
2603
+ rsp = client.DescribeProxyProcessStatistics(model)
2604
+ result = rsp.to_json_string()
2605
+ try:
2606
+ json_obj = json.loads(result)
2607
+ except TypeError as e:
2608
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
2609
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2610
+ break
2611
+ cur_time = time.time()
2612
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2613
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2614
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2615
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2616
+ else:
2617
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2618
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2619
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2620
+
2621
+
2570
2622
  def doCreateKillTask(args, parsed_globals):
2571
2623
  g_param = parse_global_arg(parsed_globals)
2572
2624
 
@@ -3240,7 +3292,7 @@ ACTION_MAP = {
3240
3292
  "DescribeSlowLogTopSqls": doDescribeSlowLogTopSqls,
3241
3293
  "DescribeSecurityAuditLogExportTasks": doDescribeSecurityAuditLogExportTasks,
3242
3294
  "DescribeAllUserContact": doDescribeAllUserContact,
3243
- "DescribeProxyProcessStatistics": doDescribeProxyProcessStatistics,
3295
+ "DescribeRedisBigKeyAnalysisTasks": doDescribeRedisBigKeyAnalysisTasks,
3244
3296
  "DescribeSlowLogs": doDescribeSlowLogs,
3245
3297
  "DescribeDBDiagEvent": doDescribeDBDiagEvent,
3246
3298
  "DescribeDBDiagHistory": doDescribeDBDiagHistory,
@@ -3253,6 +3305,7 @@ ACTION_MAP = {
3253
3305
  "DescribeIndexRecommendInfo": doDescribeIndexRecommendInfo,
3254
3306
  "DescribeIndexRecommendAggregationSlowLogs": doDescribeIndexRecommendAggregationSlowLogs,
3255
3307
  "ModifyDiagDBInstanceConf": doModifyDiagDBInstanceConf,
3308
+ "DescribeProxyProcessStatistics": doDescribeProxyProcessStatistics,
3256
3309
  "CreateKillTask": doCreateKillTask,
3257
3310
  "UpdateAgentSwitch": doUpdateAgentSwitch,
3258
3311
  "UpdateMonitorSwitch": doUpdateMonitorSwitch,
@@ -252,6 +252,13 @@
252
252
  "output": "DescribeProxySessionKillTasksResponse",
253
253
  "status": "online"
254
254
  },
255
+ "DescribeRedisBigKeyAnalysisTasks": {
256
+ "document": "查询redis大key分析任务列表。",
257
+ "input": "DescribeRedisBigKeyAnalysisTasksRequest",
258
+ "name": "查询redis大key分析任务列表",
259
+ "output": "DescribeRedisBigKeyAnalysisTasksResponse",
260
+ "status": "online"
261
+ },
255
262
  "DescribeRedisProcessList": {
256
263
  "document": "获取 Redis 实例所有 proxy 节点的实时会话详情列表。",
257
264
  "input": "DescribeRedisProcessListRequest",
@@ -386,7 +393,7 @@
386
393
  "status": "online"
387
394
  },
388
395
  "ModifyDiagDBInstanceConf": {
389
- "document": "修改实例巡检开关。",
396
+ "document": "修改实例的配置信息。",
390
397
  "input": "ModifyDiagDBInstanceConfRequest",
391
398
  "name": "修改实例巡检开关状态",
392
399
  "output": "ModifyDiagDBInstanceConfResponse",
@@ -3116,7 +3123,7 @@
3116
3123
  },
3117
3124
  {
3118
3125
  "disabled": false,
3119
- "document": "服务产品类型,支持值包括:\"mysql\" - 云数据库 MySQL,\"cynosdb\" - 云数据库 TDSQL-C for MySQL,\"dbbrain-mysql\" - 自建 MySQL,默认为\"mysql\"。",
3126
+ "document": "服务产品类型,支持值包括:\"mysql\" - 云数据库 MySQL,\"cynosdb\" - 云数据库 TDSQL-C for MySQL,\"dbbrain-mysql\" - 自建 MySQL,\"redis\" - 云数据库 Redis,默认为\"mysql\"。",
3120
3127
  "example": "mysql",
3121
3128
  "member": "string",
3122
3129
  "name": "Product",
@@ -3911,6 +3918,80 @@
3911
3918
  ],
3912
3919
  "type": "object"
3913
3920
  },
3921
+ "DescribeRedisBigKeyAnalysisTasksRequest": {
3922
+ "document": "DescribeRedisBigKeyAnalysisTasks请求参数结构体",
3923
+ "members": [
3924
+ {
3925
+ "disabled": false,
3926
+ "document": "服务产品类型,支持值包括 \"redis\" - 云数据库 Redis。",
3927
+ "example": "redis",
3928
+ "member": "string",
3929
+ "name": "Product",
3930
+ "required": true,
3931
+ "type": "string"
3932
+ },
3933
+ {
3934
+ "disabled": false,
3935
+ "document": "实例ID。",
3936
+ "example": "crs-c1nl9rpv",
3937
+ "member": "string",
3938
+ "name": "InstanceId",
3939
+ "required": true,
3940
+ "type": "string"
3941
+ },
3942
+ {
3943
+ "disabled": false,
3944
+ "document": "查询数目,默认为20,最大值为100。",
3945
+ "example": "20",
3946
+ "member": "int64",
3947
+ "name": "Limit",
3948
+ "required": false,
3949
+ "type": "int"
3950
+ },
3951
+ {
3952
+ "disabled": false,
3953
+ "document": "偏移量,默认为0。",
3954
+ "example": "0",
3955
+ "member": "int64",
3956
+ "name": "Offset",
3957
+ "required": false,
3958
+ "type": "int"
3959
+ }
3960
+ ],
3961
+ "type": "object"
3962
+ },
3963
+ "DescribeRedisBigKeyAnalysisTasksResponse": {
3964
+ "document": "DescribeRedisBigKeyAnalysisTasks返回参数结构体",
3965
+ "members": [
3966
+ {
3967
+ "disabled": false,
3968
+ "document": "任务总数。\n注意:此字段可能返回 null,表示取不到有效值。",
3969
+ "example": "100",
3970
+ "member": "int64",
3971
+ "name": "TotalCount",
3972
+ "output_required": true,
3973
+ "type": "int",
3974
+ "value_allowed_null": true
3975
+ },
3976
+ {
3977
+ "disabled": false,
3978
+ "document": "任务列表。",
3979
+ "example": "无",
3980
+ "member": "RedisBigKeyTask",
3981
+ "name": "Tasks",
3982
+ "output_required": false,
3983
+ "type": "list",
3984
+ "value_allowed_null": false
3985
+ },
3986
+ {
3987
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
3988
+ "member": "string",
3989
+ "name": "RequestId",
3990
+ "type": "string"
3991
+ }
3992
+ ],
3993
+ "type": "object"
3994
+ },
3914
3995
  "DescribeRedisProcessListRequest": {
3915
3996
  "document": "DescribeRedisProcessList请求参数结构体",
3916
3997
  "members": [
@@ -6028,7 +6109,7 @@
6028
6109
  "example": "无",
6029
6110
  "member": "string",
6030
6111
  "name": "KeyDelimiters",
6031
- "output_required": true,
6112
+ "output_required": false,
6032
6113
  "required": false,
6033
6114
  "type": "list",
6034
6115
  "value_allowed_null": true
@@ -6039,7 +6120,18 @@
6039
6120
  "example": "3",
6040
6121
  "member": "string",
6041
6122
  "name": "ShardNum",
6042
- "output_required": true,
6123
+ "output_required": false,
6124
+ "required": false,
6125
+ "type": "string",
6126
+ "value_allowed_null": true
6127
+ },
6128
+ {
6129
+ "disabled": false,
6130
+ "document": "是否开启大key周期性分析,仅redis产品有效。\n注意:此字段可能返回 null,表示取不到有效值。",
6131
+ "example": "Yes",
6132
+ "member": "string",
6133
+ "name": "AnalysisTopKey",
6134
+ "output_required": false,
6043
6135
  "required": false,
6044
6136
  "type": "string",
6045
6137
  "value_allowed_null": true
@@ -6822,7 +6914,7 @@
6822
6914
  },
6823
6915
  {
6824
6916
  "disabled": false,
6825
- "document": "服务产品类型,支持值包括: \"mysql\" - 云数据库 MySQL, \"cynosdb\" - 云数据库 CynosDB for MySQL。",
6917
+ "document": "服务产品类型,支持值包括: \"mysql\" - 云数据库 MySQL, \"cynosdb\" - 云数据库 CynosDB for MySQL,\"redis\" - 云数据库 Redis。",
6826
6918
  "example": "mysql",
6827
6919
  "member": "string",
6828
6920
  "name": "Product",
@@ -7515,6 +7607,82 @@
7515
7607
  ],
7516
7608
  "usage": "out"
7517
7609
  },
7610
+ "RedisBigKeyTask": {
7611
+ "document": "Redis大Key分析任务详情。",
7612
+ "members": [
7613
+ {
7614
+ "disabled": false,
7615
+ "document": "异步任务请求 ID。",
7616
+ "example": "12306",
7617
+ "member": "int64",
7618
+ "name": "AsyncRequestId",
7619
+ "output_required": true,
7620
+ "type": "int",
7621
+ "value_allowed_null": false
7622
+ },
7623
+ {
7624
+ "disabled": false,
7625
+ "document": "任务创建时间。",
7626
+ "example": "2024-01-02 21:02:24",
7627
+ "member": "string",
7628
+ "name": "CreateTime",
7629
+ "output_required": true,
7630
+ "type": "string",
7631
+ "value_allowed_null": false
7632
+ },
7633
+ {
7634
+ "disabled": false,
7635
+ "document": "任务开始时间。",
7636
+ "example": "2024-01-02 21:02:25",
7637
+ "member": "string",
7638
+ "name": "StartTime",
7639
+ "output_required": true,
7640
+ "type": "string",
7641
+ "value_allowed_null": false
7642
+ },
7643
+ {
7644
+ "disabled": false,
7645
+ "document": "任务结束时间。",
7646
+ "example": "2024-01-08 11:52:41",
7647
+ "member": "string",
7648
+ "name": "EndTime",
7649
+ "output_required": true,
7650
+ "type": "string",
7651
+ "value_allowed_null": false
7652
+ },
7653
+ {
7654
+ "disabled": false,
7655
+ "document": "任务状态。",
7656
+ "example": "finished",
7657
+ "member": "string",
7658
+ "name": "TaskStatus",
7659
+ "output_required": true,
7660
+ "type": "string",
7661
+ "value_allowed_null": false
7662
+ },
7663
+ {
7664
+ "disabled": false,
7665
+ "document": "任务执行进度。",
7666
+ "example": "100",
7667
+ "member": "int64",
7668
+ "name": "Progress",
7669
+ "output_required": true,
7670
+ "type": "int",
7671
+ "value_allowed_null": false
7672
+ },
7673
+ {
7674
+ "disabled": false,
7675
+ "document": "任务包含的分片节点序号列表。",
7676
+ "example": "[2,3]",
7677
+ "member": "int64",
7678
+ "name": "ShardIds",
7679
+ "output_required": true,
7680
+ "type": "list",
7681
+ "value_allowed_null": false
7682
+ }
7683
+ ],
7684
+ "usage": "out"
7685
+ },
7518
7686
  "RedisKeySpaceData": {
7519
7687
  "document": "redis key空间信息。",
7520
7688
  "members": [
@@ -288,6 +288,14 @@
288
288
  "title": "查询 kill 会话任务执行结果"
289
289
  }
290
290
  ],
291
+ "DescribeRedisBigKeyAnalysisTasks": [
292
+ {
293
+ "document": "获取某个Redis实例的大Key分析任务列表。",
294
+ "input": "POST / HTTP/1.1\nHost: dbbrain.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeRedisBigKeyAnalysisTasks\n<公共请求参数>\n\n{\n \"InstanceId\": \"crs-7i2test\",\n \"Product\": \"redis\",\n \"Limit\": 50,\n \"Offset\": 0\n}",
295
+ "output": "{\n \"Response\": {\n \"TotalCount\": 1,\n \"Tasks\": [\n {\n \"Progress\": 100,\n \"AsyncRequestId\": 7309733,\n \"EndTime\": \"2024-01-12 11:41:53\",\n \"CreateTime\": \"2024-01-12 11:38:37\",\n \"StartTime\": \"2024-01-12 11:38:38\",\n \"TaskStatus\": \"finished\",\n \"ShardIds\": [\n \"2\",\n \"3\"\n ]\n }\n ],\n \"RequestId\": \"e9833850-b113-11ee-8376-93f024a9a001\"\n }\n}",
296
+ "title": "获取Redis大Key分析任务列表"
297
+ }
298
+ ],
291
299
  "DescribeRedisProcessList": [
292
300
  {
293
301
  "document": "指定 Offset 分页获取实例 Proxy 实时会话详情列表。",
@@ -448,10 +456,16 @@
448
456
  ],
449
457
  "ModifyDiagDBInstanceConf": [
450
458
  {
451
- "document": "",
459
+ "document": "修改实例巡检状态。",
452
460
  "input": "https://dbbrain.tencentcloudapi.com/?Action=ModifyDiagDBInstanceConf\n&InstanceIds.0=cdb-fyclrp7r\n&InstanceConfs.DailyInspection=Yes\n&Regions=All\n&Product=mysql\n&<公共请求参数>",
453
461
  "output": "{\n \"Response\": {\n \"RequestId\": \"77db16d7-bbe8-48a7-868b-ed776a96f1ab\"\n }\n}",
454
462
  "title": "修改实例巡检状态"
463
+ },
464
+ {
465
+ "document": "开启Redis实例大key周期性分析并自定义分隔符。",
466
+ "input": "POST / HTTP/1.1\nHost: dbbrain.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyDiagDBInstanceConf\n<公共请求参数>\n\n{\n \"Product\": \"redis\",\n \"Regions\": \"all\",\n \"InstanceIds\": [\n \"crs-pz1raq11\"\n ],\n \"InstanceConfs\": {\n \"AnalysisTopKey\": \"Yes\",\n \"KeyDelimiters\": [\n \"_\",\n \"-\",\n \":\"\n ]\n }\n}",
467
+ "output": "{\n \"Response\": {\n \"RequestId\": \"bcd97ab0-16d1-11ef-8e52-3d11a9997f13\"\n }\n}",
468
+ "title": "修改Redis实例大key周期性分析"
455
469
  }
456
470
  ],
457
471
  "ModifySqlFilters": [