tccli 3.0.967.1__py2.py3-none-any.whl → 3.0.968.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/examples/cdwpg/v20201230/CreateInstanceByApi.md +40 -0
  3. tccli/examples/cdwpg/v20201230/DestroyInstanceByApi.md +22 -0
  4. tccli/examples/dbbrain/v20210527/DescribeIndexRecommendAggregationSlowLogs.md +34 -0
  5. tccli/examples/dbbrain/v20210527/DescribeIndexRecommendInfo.md +57 -0
  6. tccli/examples/dbbrain/v20210527/DescribeRedisProcessList.md +46 -0
  7. tccli/examples/trtc/v20190722/DescribeTRTCMarketQualityData.md +2 -2
  8. tccli/examples/trtc/v20190722/DescribeTRTCMarketScaleData.md +27 -45
  9. tccli/examples/trtc/v20190722/DescribeTRTCRealTimeQualityData.md +202 -6
  10. tccli/examples/trtc/v20190722/DescribeTRTCRealTimeScaleData.md +214 -7
  11. tccli/services/__init__.py +3 -0
  12. tccli/services/cdwpg/__init__.py +4 -0
  13. tccli/services/cdwpg/cdwpg_client.py +247 -0
  14. tccli/services/cdwpg/v20201230/api.json +354 -0
  15. tccli/services/cdwpg/v20201230/examples.json +21 -0
  16. tccli/services/dbbrain/dbbrain_client.py +171 -12
  17. tccli/services/dbbrain/v20210527/api.json +614 -0
  18. tccli/services/dbbrain/v20210527/examples.json +24 -0
  19. tccli/services/teo/v20220901/api.json +114 -0
  20. tccli/services/trtc/v20190722/api.json +1 -1
  21. tccli/services/trtc/v20190722/examples.json +8 -8
  22. {tccli-3.0.967.1.dist-info → tccli-3.0.968.1.dist-info}/METADATA +2 -2
  23. {tccli-3.0.967.1.dist-info → tccli-3.0.968.1.dist-info}/RECORD +26 -17
  24. {tccli-3.0.967.1.dist-info → tccli-3.0.968.1.dist-info}/WHEEL +0 -0
  25. {tccli-3.0.967.1.dist-info → tccli-3.0.968.1.dist-info}/entry_points.txt +0 -0
  26. {tccli-3.0.967.1.dist-info → tccli-3.0.968.1.dist-info}/license_files/LICENSE +0 -0
@@ -0,0 +1,354 @@
1
+ {
2
+ "actions": {
3
+ "CreateInstanceByApi": {
4
+ "document": "创建集群",
5
+ "input": "CreateInstanceByApiRequest",
6
+ "name": "创建集群",
7
+ "output": "CreateInstanceByApiResponse",
8
+ "status": "online"
9
+ },
10
+ "DestroyInstanceByApi": {
11
+ "document": "销毁集群",
12
+ "input": "DestroyInstanceByApiRequest",
13
+ "name": "销毁集群",
14
+ "output": "DestroyInstanceByApiResponse",
15
+ "status": "online"
16
+ }
17
+ },
18
+ "metadata": {
19
+ "apiVersion": "2020-12-30",
20
+ "api_brief": "官网对外接口",
21
+ "serviceNameCN": "云数据仓库 PostgreSQL",
22
+ "serviceShortName": "cdwpg"
23
+ },
24
+ "objects": {
25
+ "CBSSpec": {
26
+ "document": "磁盘规格",
27
+ "members": [
28
+ {
29
+ "disabled": false,
30
+ "document": "盘类型",
31
+ "example": "CLOUD_SSD",
32
+ "member": "string",
33
+ "name": "DiskType",
34
+ "required": true,
35
+ "type": "string",
36
+ "value_allowed_null": false
37
+ },
38
+ {
39
+ "disabled": false,
40
+ "document": "大小",
41
+ "example": "20",
42
+ "member": "int64",
43
+ "name": "DiskSize",
44
+ "required": true,
45
+ "type": "int",
46
+ "value_allowed_null": false
47
+ },
48
+ {
49
+ "disabled": false,
50
+ "document": "个数",
51
+ "example": "10",
52
+ "member": "int64",
53
+ "name": "DiskCount",
54
+ "required": true,
55
+ "type": "int",
56
+ "value_allowed_null": false
57
+ }
58
+ ],
59
+ "usage": "in"
60
+ },
61
+ "ChargeProperties": {
62
+ "document": "计费时间参数",
63
+ "members": [
64
+ {
65
+ "disabled": false,
66
+ "document": "1-需要自动续期",
67
+ "example": "1",
68
+ "member": "int64",
69
+ "name": "RenewFlag",
70
+ "required": true,
71
+ "type": "int",
72
+ "value_allowed_null": false
73
+ },
74
+ {
75
+ "disabled": false,
76
+ "document": "订单时间范围",
77
+ "example": "1",
78
+ "member": "int64",
79
+ "name": "TimeSpan",
80
+ "required": true,
81
+ "type": "int",
82
+ "value_allowed_null": false
83
+ },
84
+ {
85
+ "disabled": false,
86
+ "document": "时间单位,一般为h和m",
87
+ "example": "m",
88
+ "member": "string",
89
+ "name": "TimeUnit",
90
+ "required": true,
91
+ "type": "string",
92
+ "value_allowed_null": false
93
+ },
94
+ {
95
+ "disabled": false,
96
+ "document": "计费类型0-按量计费,1-包年包月",
97
+ "example": "0",
98
+ "member": "int64",
99
+ "name": "PayMode",
100
+ "required": false,
101
+ "type": "int",
102
+ "value_allowed_null": false
103
+ },
104
+ {
105
+ "disabled": false,
106
+ "document": "PREPAID、POSTPAID_BY_HOUR",
107
+ "example": "PREPAID",
108
+ "member": "string",
109
+ "name": "ChargeType",
110
+ "required": false,
111
+ "type": "string",
112
+ "value_allowed_null": false
113
+ }
114
+ ],
115
+ "usage": "in"
116
+ },
117
+ "CreateInstanceByApiRequest": {
118
+ "document": "CreateInstanceByApi请求参数结构体",
119
+ "members": [
120
+ {
121
+ "disabled": false,
122
+ "document": "实例名称",
123
+ "example": "cdwpg-test",
124
+ "member": "string",
125
+ "name": "InstanceName",
126
+ "required": true,
127
+ "type": "string"
128
+ },
129
+ {
130
+ "disabled": false,
131
+ "document": "可用区",
132
+ "example": "ap-beijing-2",
133
+ "member": "string",
134
+ "name": "Zone",
135
+ "required": true,
136
+ "type": "string"
137
+ },
138
+ {
139
+ "disabled": false,
140
+ "document": "私有网络",
141
+ "example": "vpc-xxx",
142
+ "member": "string",
143
+ "name": "UserVPCId",
144
+ "required": true,
145
+ "type": "string"
146
+ },
147
+ {
148
+ "disabled": false,
149
+ "document": "子网",
150
+ "example": "subnet-xxx",
151
+ "member": "string",
152
+ "name": "UserSubnetId",
153
+ "required": true,
154
+ "type": "string"
155
+ },
156
+ {
157
+ "disabled": false,
158
+ "document": "计费方式",
159
+ "example": "无",
160
+ "member": "ChargeProperties",
161
+ "name": "ChargeProperties",
162
+ "required": true,
163
+ "type": "object"
164
+ },
165
+ {
166
+ "disabled": false,
167
+ "document": "集群密码",
168
+ "example": "无",
169
+ "member": "string",
170
+ "name": "AdminPassword",
171
+ "required": true,
172
+ "type": "string"
173
+ },
174
+ {
175
+ "disabled": false,
176
+ "document": "资源信息",
177
+ "example": "无",
178
+ "member": "ResourceSpecNew",
179
+ "name": "Resources",
180
+ "required": true,
181
+ "type": "list"
182
+ },
183
+ {
184
+ "disabled": false,
185
+ "document": "标签列表",
186
+ "example": "无",
187
+ "member": "Tag",
188
+ "name": "Tags",
189
+ "required": false,
190
+ "type": "object"
191
+ }
192
+ ],
193
+ "type": "object"
194
+ },
195
+ "CreateInstanceByApiResponse": {
196
+ "document": "CreateInstanceByApi返回参数结构体",
197
+ "members": [
198
+ {
199
+ "disabled": false,
200
+ "document": "流程ID\n注意:此字段可能返回 null,表示取不到有效值。",
201
+ "example": "123",
202
+ "member": "string",
203
+ "name": "FlowId",
204
+ "output_required": true,
205
+ "type": "string",
206
+ "value_allowed_null": true
207
+ },
208
+ {
209
+ "disabled": false,
210
+ "document": "实例ID\n注意:此字段可能返回 null,表示取不到有效值。",
211
+ "example": "cdwpg-xxx",
212
+ "member": "string",
213
+ "name": "InstanceId",
214
+ "output_required": true,
215
+ "type": "string",
216
+ "value_allowed_null": true
217
+ },
218
+ {
219
+ "disabled": false,
220
+ "document": "错误信息\n注意:此字段可能返回 null,表示取不到有效值。",
221
+ "example": "xxx",
222
+ "member": "string",
223
+ "name": "ErrorMsg",
224
+ "output_required": true,
225
+ "type": "string",
226
+ "value_allowed_null": true
227
+ },
228
+ {
229
+ "document": "唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。",
230
+ "member": "string",
231
+ "name": "RequestId",
232
+ "type": "string"
233
+ }
234
+ ],
235
+ "type": "object"
236
+ },
237
+ "DestroyInstanceByApiRequest": {
238
+ "document": "DestroyInstanceByApi请求参数结构体",
239
+ "members": [
240
+ {
241
+ "disabled": false,
242
+ "document": "实例名称,例如\"cdwpg-xxxx\"",
243
+ "example": "\"cdwpg-xxxx\"",
244
+ "member": "string",
245
+ "name": "InstanceId",
246
+ "required": true,
247
+ "type": "string"
248
+ }
249
+ ],
250
+ "type": "object"
251
+ },
252
+ "DestroyInstanceByApiResponse": {
253
+ "document": "DestroyInstanceByApi返回参数结构体",
254
+ "members": [
255
+ {
256
+ "disabled": false,
257
+ "document": "销毁流程Id",
258
+ "example": "\"123\"",
259
+ "member": "string",
260
+ "name": "FlowId",
261
+ "output_required": true,
262
+ "type": "string",
263
+ "value_allowed_null": false
264
+ },
265
+ {
266
+ "disabled": false,
267
+ "document": "错误信息",
268
+ "example": "\"xx\"",
269
+ "member": "string",
270
+ "name": "ErrorMsg",
271
+ "output_required": true,
272
+ "type": "string",
273
+ "value_allowed_null": false
274
+ },
275
+ {
276
+ "document": "唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。",
277
+ "member": "string",
278
+ "name": "RequestId",
279
+ "type": "string"
280
+ }
281
+ ],
282
+ "type": "object"
283
+ },
284
+ "ResourceSpecNew": {
285
+ "document": "资源规格",
286
+ "members": [
287
+ {
288
+ "disabled": false,
289
+ "document": "资源名称",
290
+ "example": "nc2.large",
291
+ "member": "string",
292
+ "name": "SpecName",
293
+ "required": true,
294
+ "type": "string"
295
+ },
296
+ {
297
+ "disabled": false,
298
+ "document": "资源数",
299
+ "example": "200",
300
+ "member": "int64",
301
+ "name": "Count",
302
+ "required": true,
303
+ "type": "int"
304
+ },
305
+ {
306
+ "disabled": false,
307
+ "document": "磁盘信息",
308
+ "example": "{ \"DiskType\": \"CLOUD_HSSD\", \"DiskSize\": 20, \"DiskCount\": 10 }",
309
+ "member": "CBSSpec",
310
+ "name": "DiskSpec",
311
+ "required": true,
312
+ "type": "object"
313
+ },
314
+ {
315
+ "disabled": false,
316
+ "document": "资源类型,DATA",
317
+ "example": "Local",
318
+ "member": "string",
319
+ "name": "Type",
320
+ "required": true,
321
+ "type": "string"
322
+ }
323
+ ],
324
+ "usage": "in"
325
+ },
326
+ "Tag": {
327
+ "document": "标签描述",
328
+ "members": [
329
+ {
330
+ "disabled": false,
331
+ "document": "标签的键",
332
+ "example": "标签一",
333
+ "member": "string",
334
+ "name": "TagKey",
335
+ "required": true,
336
+ "type": "string",
337
+ "value_allowed_null": false
338
+ },
339
+ {
340
+ "disabled": false,
341
+ "document": "标签的值",
342
+ "example": "内容一",
343
+ "member": "string",
344
+ "name": "TagValue",
345
+ "required": true,
346
+ "type": "string",
347
+ "value_allowed_null": false
348
+ }
349
+ ],
350
+ "usage": "both"
351
+ }
352
+ },
353
+ "version": "1.0"
354
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "actions": {
3
+ "CreateInstanceByApi": [
4
+ {
5
+ "document": "创建集群",
6
+ "input": "POST / HTTP/1.1\nHost: cdwpg.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateInstanceByApi\n<公共请求参数>\n\n{\n \"InstanceName\": \"abc\",\n \"Zone\": \"abc\",\n \"UserVPCId\": \"abc\",\n \"UserSubnetId\": \"abc\",\n \"ChargeProperties\": {\n \"PayMode\": 0,\n \"RenewFlag\": 0,\n \"TimeSpan\": 0,\n \"TimeUnit\": \"abc\",\n \"ChargeType\": \"abc\"\n },\n \"AdminPassword\": \"abc\",\n \"Tags\": {\n \"TagKey\": \"abc\",\n \"TagValue\": \"abc\"\n },\n \"Resources\": [\n {\n \"SpecName\": \"abc\",\n \"Count\": 0,\n \"DiskSpec\": {\n \"DiskType\": \"abc\",\n \"DiskSize\": 0,\n \"DiskCount\": 0\n },\n \"Type\": \"abc\"\n }\n ]\n}",
7
+ "output": "{\n \"Response\": {\n \"FlowId\": \"abc\",\n \"InstanceId\": \"abc\",\n \"ErrorMsg\": \"abc\",\n \"RequestId\": \"abc\"\n }\n}",
8
+ "title": "创建集群"
9
+ }
10
+ ],
11
+ "DestroyInstanceByApi": [
12
+ {
13
+ "document": "销毁集群",
14
+ "input": "POST / HTTP/1.1\nHost: cdwpg.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DestroyInstanceByApi\n<公共请求参数>\n\n{\n \"InstanceId\": \"abc\"\n}",
15
+ "output": "{\n \"Response\": {\n \"FlowId\": \"abc\",\n \"ErrorMsg\": \"abc\",\n \"RequestId\": \"abc\"\n }\n}",
16
+ "title": "销毁集群"
17
+ }
18
+ ]
19
+ },
20
+ "version": "1.0"
21
+ }
@@ -643,6 +643,58 @@ def doCreateRedisBigKeyAnalysisTask(args, parsed_globals):
643
643
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
644
644
 
645
645
 
646
+ def doModifyAlarmPolicy(args, parsed_globals):
647
+ g_param = parse_global_arg(parsed_globals)
648
+
649
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
650
+ cred = credential.CVMRoleCredential()
651
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
652
+ cred = credential.STSAssumeRoleCredential(
653
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
654
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
655
+ )
656
+ 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):
657
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
658
+ else:
659
+ cred = credential.Credential(
660
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
661
+ )
662
+ http_profile = HttpProfile(
663
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
664
+ reqMethod="POST",
665
+ endpoint=g_param[OptionsDefine.Endpoint],
666
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
667
+ )
668
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
669
+ if g_param[OptionsDefine.Language]:
670
+ profile.language = g_param[OptionsDefine.Language]
671
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
672
+ client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
673
+ client._sdkVersion += ("_CLI_" + __version__)
674
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
675
+ model = models.ModifyAlarmPolicyRequest()
676
+ model.from_json_string(json.dumps(args))
677
+ start_time = time.time()
678
+ while True:
679
+ rsp = client.ModifyAlarmPolicy(model)
680
+ result = rsp.to_json_string()
681
+ try:
682
+ json_obj = json.loads(result)
683
+ except TypeError as e:
684
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
685
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
686
+ break
687
+ cur_time = time.time()
688
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
689
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
690
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
691
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
692
+ else:
693
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
694
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
695
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
696
+
697
+
646
698
  def doDeleteAuditLogFile(args, parsed_globals):
647
699
  g_param = parse_global_arg(parsed_globals)
648
700
 
@@ -955,6 +1007,58 @@ def doCreateDBDiagReportTask(args, parsed_globals):
955
1007
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
956
1008
 
957
1009
 
1010
+ def doDescribeRedisProcessList(args, parsed_globals):
1011
+ g_param = parse_global_arg(parsed_globals)
1012
+
1013
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1014
+ cred = credential.CVMRoleCredential()
1015
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1016
+ cred = credential.STSAssumeRoleCredential(
1017
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1018
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
1019
+ )
1020
+ 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):
1021
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1022
+ else:
1023
+ cred = credential.Credential(
1024
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1025
+ )
1026
+ http_profile = HttpProfile(
1027
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1028
+ reqMethod="POST",
1029
+ endpoint=g_param[OptionsDefine.Endpoint],
1030
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1031
+ )
1032
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1033
+ if g_param[OptionsDefine.Language]:
1034
+ profile.language = g_param[OptionsDefine.Language]
1035
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1036
+ client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
1037
+ client._sdkVersion += ("_CLI_" + __version__)
1038
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1039
+ model = models.DescribeRedisProcessListRequest()
1040
+ model.from_json_string(json.dumps(args))
1041
+ start_time = time.time()
1042
+ while True:
1043
+ rsp = client.DescribeRedisProcessList(model)
1044
+ result = rsp.to_json_string()
1045
+ try:
1046
+ json_obj = json.loads(result)
1047
+ except TypeError as e:
1048
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1049
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1050
+ break
1051
+ cur_time = time.time()
1052
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1053
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1054
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1055
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1056
+ else:
1057
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1058
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1059
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1060
+
1061
+
958
1062
  def doDescribeSlowLogUserHostStats(args, parsed_globals):
959
1063
  g_param = parse_global_arg(parsed_globals)
960
1064
 
@@ -2099,7 +2203,7 @@ def doDescribeSlowLogTimeSeriesStats(args, parsed_globals):
2099
2203
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2100
2204
 
2101
2205
 
2102
- def doDescribeDiagDBInstances(args, parsed_globals):
2206
+ def doDescribeTopSpaceSchemaTimeSeries(args, parsed_globals):
2103
2207
  g_param = parse_global_arg(parsed_globals)
2104
2208
 
2105
2209
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2128,11 +2232,11 @@ def doDescribeDiagDBInstances(args, parsed_globals):
2128
2232
  client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
2129
2233
  client._sdkVersion += ("_CLI_" + __version__)
2130
2234
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2131
- model = models.DescribeDiagDBInstancesRequest()
2235
+ model = models.DescribeTopSpaceSchemaTimeSeriesRequest()
2132
2236
  model.from_json_string(json.dumps(args))
2133
2237
  start_time = time.time()
2134
2238
  while True:
2135
- rsp = client.DescribeDiagDBInstances(model)
2239
+ rsp = client.DescribeTopSpaceSchemaTimeSeries(model)
2136
2240
  result = rsp.to_json_string()
2137
2241
  try:
2138
2242
  json_obj = json.loads(result)
@@ -2203,7 +2307,7 @@ def doDeleteSqlFilters(args, parsed_globals):
2203
2307
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2204
2308
 
2205
2309
 
2206
- def doModifyAlarmPolicy(args, parsed_globals):
2310
+ def doDescribeDiagDBInstances(args, parsed_globals):
2207
2311
  g_param = parse_global_arg(parsed_globals)
2208
2312
 
2209
2313
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2232,11 +2336,11 @@ def doModifyAlarmPolicy(args, parsed_globals):
2232
2336
  client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
2233
2337
  client._sdkVersion += ("_CLI_" + __version__)
2234
2338
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2235
- model = models.ModifyAlarmPolicyRequest()
2339
+ model = models.DescribeDiagDBInstancesRequest()
2236
2340
  model.from_json_string(json.dumps(args))
2237
2341
  start_time = time.time()
2238
2342
  while True:
2239
- rsp = client.ModifyAlarmPolicy(model)
2343
+ rsp = client.DescribeDiagDBInstances(model)
2240
2344
  result = rsp.to_json_string()
2241
2345
  try:
2242
2346
  json_obj = json.loads(result)
@@ -2307,7 +2411,7 @@ def doAddUserContact(args, parsed_globals):
2307
2411
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2308
2412
 
2309
2413
 
2310
- def doDescribeTopSpaceSchemaTimeSeries(args, parsed_globals):
2414
+ def doDescribeIndexRecommendInfo(args, parsed_globals):
2311
2415
  g_param = parse_global_arg(parsed_globals)
2312
2416
 
2313
2417
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2336,11 +2440,63 @@ def doDescribeTopSpaceSchemaTimeSeries(args, parsed_globals):
2336
2440
  client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
2337
2441
  client._sdkVersion += ("_CLI_" + __version__)
2338
2442
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2339
- model = models.DescribeTopSpaceSchemaTimeSeriesRequest()
2443
+ model = models.DescribeIndexRecommendInfoRequest()
2340
2444
  model.from_json_string(json.dumps(args))
2341
2445
  start_time = time.time()
2342
2446
  while True:
2343
- rsp = client.DescribeTopSpaceSchemaTimeSeries(model)
2447
+ rsp = client.DescribeIndexRecommendInfo(model)
2448
+ result = rsp.to_json_string()
2449
+ try:
2450
+ json_obj = json.loads(result)
2451
+ except TypeError as e:
2452
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
2453
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2454
+ break
2455
+ cur_time = time.time()
2456
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2457
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2458
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2459
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2460
+ else:
2461
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2462
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2463
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2464
+
2465
+
2466
+ def doDescribeIndexRecommendAggregationSlowLogs(args, parsed_globals):
2467
+ g_param = parse_global_arg(parsed_globals)
2468
+
2469
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2470
+ cred = credential.CVMRoleCredential()
2471
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2472
+ cred = credential.STSAssumeRoleCredential(
2473
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2474
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
2475
+ )
2476
+ 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):
2477
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2478
+ else:
2479
+ cred = credential.Credential(
2480
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2481
+ )
2482
+ http_profile = HttpProfile(
2483
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2484
+ reqMethod="POST",
2485
+ endpoint=g_param[OptionsDefine.Endpoint],
2486
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2487
+ )
2488
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2489
+ if g_param[OptionsDefine.Language]:
2490
+ profile.language = g_param[OptionsDefine.Language]
2491
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2492
+ client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
2493
+ client._sdkVersion += ("_CLI_" + __version__)
2494
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
2495
+ model = models.DescribeIndexRecommendAggregationSlowLogsRequest()
2496
+ model.from_json_string(json.dumps(args))
2497
+ start_time = time.time()
2498
+ while True:
2499
+ rsp = client.DescribeIndexRecommendAggregationSlowLogs(model)
2344
2500
  result = rsp.to_json_string()
2345
2501
  try:
2346
2502
  json_obj = json.loads(result)
@@ -3060,12 +3216,14 @@ ACTION_MAP = {
3060
3216
  "DescribeDBDiagReportTasks": doDescribeDBDiagReportTasks,
3061
3217
  "DescribeAuditLogFiles": doDescribeAuditLogFiles,
3062
3218
  "CreateRedisBigKeyAnalysisTask": doCreateRedisBigKeyAnalysisTask,
3219
+ "ModifyAlarmPolicy": doModifyAlarmPolicy,
3063
3220
  "DeleteAuditLogFile": doDeleteAuditLogFile,
3064
3221
  "DescribeAllUserGroup": doDescribeAllUserGroup,
3065
3222
  "DescribeDBDiagEvents": doDescribeDBDiagEvents,
3066
3223
  "DescribeAuditInstanceList": doDescribeAuditInstanceList,
3067
3224
  "DescribeTopSpaceTableTimeSeries": doDescribeTopSpaceTableTimeSeries,
3068
3225
  "CreateDBDiagReportTask": doCreateDBDiagReportTask,
3226
+ "DescribeRedisProcessList": doDescribeRedisProcessList,
3069
3227
  "DescribeSlowLogUserHostStats": doDescribeSlowLogUserHostStats,
3070
3228
  "DescribeUserSqlAdvice": doDescribeUserSqlAdvice,
3071
3229
  "CreateSqlFilter": doCreateSqlFilter,
@@ -3088,11 +3246,12 @@ ACTION_MAP = {
3088
3246
  "DescribeDBDiagHistory": doDescribeDBDiagHistory,
3089
3247
  "DescribeRedisTopKeyPrefixList": doDescribeRedisTopKeyPrefixList,
3090
3248
  "DescribeSlowLogTimeSeriesStats": doDescribeSlowLogTimeSeriesStats,
3091
- "DescribeDiagDBInstances": doDescribeDiagDBInstances,
3249
+ "DescribeTopSpaceSchemaTimeSeries": doDescribeTopSpaceSchemaTimeSeries,
3092
3250
  "DeleteSqlFilters": doDeleteSqlFilters,
3093
- "ModifyAlarmPolicy": doModifyAlarmPolicy,
3251
+ "DescribeDiagDBInstances": doDescribeDiagDBInstances,
3094
3252
  "AddUserContact": doAddUserContact,
3095
- "DescribeTopSpaceSchemaTimeSeries": doDescribeTopSpaceSchemaTimeSeries,
3253
+ "DescribeIndexRecommendInfo": doDescribeIndexRecommendInfo,
3254
+ "DescribeIndexRecommendAggregationSlowLogs": doDescribeIndexRecommendAggregationSlowLogs,
3096
3255
  "ModifyDiagDBInstanceConf": doModifyDiagDBInstanceConf,
3097
3256
  "CreateKillTask": doCreateKillTask,
3098
3257
  "UpdateAgentSwitch": doUpdateAgentSwitch,