tccli 3.0.1134.1__py2.py3-none-any.whl → 3.0.1136.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 (58) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/services/__init__.py +3 -0
  3. tccli/services/asr/asr_client.py +53 -0
  4. tccli/services/asr/v20190614/api.json +193 -1
  5. tccli/services/asr/v20190614/examples.json +8 -0
  6. tccli/services/batch/v20170312/api.json +8 -5
  7. tccli/services/batch/v20170312/examples.json +1 -1
  8. tccli/services/cdb/cdb_client.py +57 -4
  9. tccli/services/cdb/v20170320/api.json +270 -0
  10. tccli/services/cdb/v20170320/examples.json +8 -0
  11. tccli/services/ckafka/v20190819/api.json +1 -1
  12. tccli/services/cls/v20201016/api.json +3 -3
  13. tccli/services/dlc/dlc_client.py +53 -0
  14. tccli/services/dlc/v20210125/api.json +138 -4
  15. tccli/services/dlc/v20210125/examples.json +13 -5
  16. tccli/services/dsgc/v20190723/api.json +35 -35
  17. tccli/services/eiam/v20210420/api.json +4 -4
  18. tccli/services/eiam/v20210420/examples.json +4 -4
  19. tccli/services/ess/v20201111/api.json +1 -1
  20. tccli/services/essbasic/v20210526/api.json +3 -3
  21. tccli/services/facefusion/v20181201/api.json +12 -12
  22. tccli/services/facefusion/v20181201/examples.json +4 -4
  23. tccli/services/iotexplorer/iotexplorer_client.py +53 -0
  24. tccli/services/iotexplorer/v20190423/api.json +137 -4
  25. tccli/services/iotexplorer/v20190423/examples.json +8 -0
  26. tccli/services/lcic/v20220817/api.json +4 -4
  27. tccli/services/lighthouse/v20200324/api.json +15 -15
  28. tccli/services/lighthouse/v20200324/examples.json +7 -7
  29. tccli/services/lke/lke_client.py +175 -16
  30. tccli/services/lke/v20231130/api.json +782 -165
  31. tccli/services/lke/v20231130/examples.json +35 -5
  32. tccli/services/ocr/v20181119/api.json +1 -1
  33. tccli/services/ses/v20201002/api.json +20 -1
  34. tccli/services/tdmq/tdmq_client.py +53 -0
  35. tccli/services/tdmq/v20200217/api.json +321 -0
  36. tccli/services/tdmq/v20200217/examples.json +8 -0
  37. tccli/services/tem/v20210701/api.json +8 -5
  38. tccli/services/tem/v20210701/examples.json +2 -2
  39. tccli/services/tke/v20180525/api.json +33 -21
  40. tccli/services/tke/v20180525/examples.json +4 -4
  41. tccli/services/trocket/trocket_client.py +65 -12
  42. tccli/services/trocket/v20230308/api.json +196 -0
  43. tccli/services/trocket/v20230308/examples.json +8 -0
  44. tccli/services/trtc/v20190722/api.json +48 -66
  45. tccli/services/tsi/__init__.py +4 -0
  46. tccli/services/tsi/tsi_client.py +301 -0
  47. tccli/services/tsi/v20210325/api.json +373 -0
  48. tccli/services/tsi/v20210325/examples.json +29 -0
  49. tccli/services/vpc/v20170312/api.json +36 -16
  50. tccli/services/vpc/v20170312/examples.json +9 -3
  51. tccli/services/waf/v20180125/api.json +70 -0
  52. tccli/services/waf/v20180125/examples.json +8 -0
  53. tccli/services/waf/waf_client.py +53 -0
  54. {tccli-3.0.1134.1.dist-info → tccli-3.0.1136.1.dist-info}/METADATA +2 -2
  55. {tccli-3.0.1134.1.dist-info → tccli-3.0.1136.1.dist-info}/RECORD +58 -54
  56. {tccli-3.0.1134.1.dist-info → tccli-3.0.1136.1.dist-info}/WHEEL +0 -0
  57. {tccli-3.0.1134.1.dist-info → tccli-3.0.1136.1.dist-info}/entry_points.txt +0 -0
  58. {tccli-3.0.1134.1.dist-info → tccli-3.0.1136.1.dist-info}/license_files/LICENSE +0 -0
tccli/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '3.0.1134.1'
1
+ __version__ = '3.0.1136.1'
@@ -733,6 +733,9 @@ SERVICE_VERSIONS = {
733
733
  "tsf": [
734
734
  "2018-03-26"
735
735
  ],
736
+ "tsi": [
737
+ "2021-03-25"
738
+ ],
736
739
  "tsw": [
737
740
  "2021-04-12",
738
741
  "2020-09-24"
@@ -537,6 +537,58 @@ def doCreateCustomization(args, parsed_globals):
537
537
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
538
538
 
539
539
 
540
+ def doVoicePrintGroupVerify(args, parsed_globals):
541
+ g_param = parse_global_arg(parsed_globals)
542
+
543
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
544
+ cred = credential.CVMRoleCredential()
545
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
546
+ cred = credential.STSAssumeRoleCredential(
547
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
548
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
549
+ )
550
+ 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):
551
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
552
+ else:
553
+ cred = credential.Credential(
554
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
555
+ )
556
+ http_profile = HttpProfile(
557
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
558
+ reqMethod="POST",
559
+ endpoint=g_param[OptionsDefine.Endpoint],
560
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
561
+ )
562
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
563
+ if g_param[OptionsDefine.Language]:
564
+ profile.language = g_param[OptionsDefine.Language]
565
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
566
+ client = mod.AsrClient(cred, g_param[OptionsDefine.Region], profile)
567
+ client._sdkVersion += ("_CLI_" + __version__)
568
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
569
+ model = models.VoicePrintGroupVerifyRequest()
570
+ model.from_json_string(json.dumps(args))
571
+ start_time = time.time()
572
+ while True:
573
+ rsp = client.VoicePrintGroupVerify(model)
574
+ result = rsp.to_json_string()
575
+ try:
576
+ json_obj = json.loads(result)
577
+ except TypeError as e:
578
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
579
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
580
+ break
581
+ cur_time = time.time()
582
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
583
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
584
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
585
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
586
+ else:
587
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
588
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
589
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
590
+
591
+
540
592
  def doDeleteAsrVocab(args, parsed_globals):
541
593
  g_param = parse_global_arg(parsed_globals)
542
594
 
@@ -1390,6 +1442,7 @@ ACTION_MAP = {
1390
1442
  "SetVocabState": doSetVocabState,
1391
1443
  "DownloadAsrVocab": doDownloadAsrVocab,
1392
1444
  "CreateCustomization": doCreateCustomization,
1445
+ "VoicePrintGroupVerify": doVoicePrintGroupVerify,
1393
1446
  "DeleteAsrVocab": doDeleteAsrVocab,
1394
1447
  "SentenceRecognition": doSentenceRecognition,
1395
1448
  "CreateRecTask": doCreateRecTask,
@@ -168,6 +168,13 @@
168
168
  "output": "VoicePrintEnrollResponse",
169
169
  "status": "online"
170
170
  },
171
+ "VoicePrintGroupVerify": {
172
+ "document": "说话人验证1:N接口,可以通过传入一段说话人音频,并且指定已存在的groupId, 和返回topN, 接口返回groupId内所有声纹和传入音频声纹比对打分TopN的结果。",
173
+ "input": "VoicePrintGroupVerifyRequest",
174
+ "name": "说话人验证1:N",
175
+ "output": "VoicePrintGroupVerifyResponse",
176
+ "status": "online"
177
+ },
171
178
  "VoicePrintUpdate": {
172
179
  "document": "本接口用于更新和覆盖已注册的音频数据和说话人昵称,更新后原有的音频数据将失效。",
173
180
  "input": "VoicePrintUpdateRequest",
@@ -2048,6 +2055,62 @@
2048
2055
  ],
2049
2056
  "type": "object"
2050
2057
  },
2058
+ "VerifyTop": {
2059
+ "document": "声纹组对比结果top数据",
2060
+ "members": [
2061
+ {
2062
+ "disabled": false,
2063
+ "document": "相似度打分\n注意:此字段可能返回 null,表示取不到有效值。",
2064
+ "example": "0.70",
2065
+ "member": "string",
2066
+ "name": "Score",
2067
+ "output_required": false,
2068
+ "required": false,
2069
+ "type": "string",
2070
+ "value_allowed_null": true
2071
+ },
2072
+ {
2073
+ "disabled": false,
2074
+ "document": "说话人id\n注意:此字段可能返回 null,表示取不到有效值。",
2075
+ "example": "dsadcsds-dsads-dsadasd",
2076
+ "member": "string",
2077
+ "name": "VoicePrintId",
2078
+ "output_required": false,
2079
+ "required": false,
2080
+ "type": "string",
2081
+ "value_allowed_null": true
2082
+ },
2083
+ {
2084
+ "disabled": false,
2085
+ "document": "说话人昵称\n注意:此字段可能返回 null,表示取不到有效值。",
2086
+ "example": "小明",
2087
+ "member": "string",
2088
+ "name": "SpeakerId",
2089
+ "output_required": false,
2090
+ "required": false,
2091
+ "type": "string",
2092
+ "value_allowed_null": true
2093
+ }
2094
+ ],
2095
+ "usage": "both"
2096
+ },
2097
+ "VerifyTopResult": {
2098
+ "document": "说话人验证1:N返回结果",
2099
+ "members": [
2100
+ {
2101
+ "disabled": false,
2102
+ "document": "对比打分结果,按照打分降序排列返回\n注意:此字段可能返回 null,表示取不到有效值。",
2103
+ "example": "无",
2104
+ "member": "VerifyTop",
2105
+ "name": "VerifyTops",
2106
+ "output_required": false,
2107
+ "required": false,
2108
+ "type": "list",
2109
+ "value_allowed_null": true
2110
+ }
2111
+ ],
2112
+ "usage": "both"
2113
+ },
2051
2114
  "Vocab": {
2052
2115
  "document": "[词表内容](https://cloud.tencent.com/document/product/1093/41484#3.-.E8.BE.93.E5.87.BA.E5.8F.82.E6.95.B0)",
2053
2116
  "members": [
@@ -2262,13 +2325,42 @@
2262
2325
  "output_required": false,
2263
2326
  "type": "int",
2264
2327
  "value_allowed_null": true
2328
+ },
2329
+ {
2330
+ "disabled": false,
2331
+ "document": "说话人id列表\n注意:此字段可能返回 null,表示取不到有效值。",
2332
+ "example": "无",
2333
+ "member": "VoicePrintBaseData",
2334
+ "name": "VoicePrintList",
2335
+ "output_required": false,
2336
+ "type": "list",
2337
+ "value_allowed_null": true
2265
2338
  }
2266
2339
  ],
2267
2340
  "usage": "out"
2268
2341
  },
2269
2342
  "VoicePrintCountRequest": {
2270
2343
  "document": "VoicePrintCount请求参数结构体",
2271
- "members": [],
2344
+ "members": [
2345
+ {
2346
+ "disabled": false,
2347
+ "document": "分组ID,仅支持大小写字母和下划线的组合,不超过128个字符",
2348
+ "example": "无",
2349
+ "member": "string",
2350
+ "name": "GroupId",
2351
+ "required": false,
2352
+ "type": "string"
2353
+ },
2354
+ {
2355
+ "disabled": false,
2356
+ "document": "统计模式\n0: 统计所有声纹数量\n1: 统计指定分组下的声纹数量",
2357
+ "example": "0",
2358
+ "member": "int64",
2359
+ "name": "CountMod",
2360
+ "required": false,
2361
+ "type": "int"
2362
+ }
2363
+ ],
2272
2364
  "type": "object"
2273
2365
  },
2274
2366
  "VoicePrintCountResponse": {
@@ -2304,6 +2396,24 @@
2304
2396
  "name": "VoicePrintId",
2305
2397
  "required": false,
2306
2398
  "type": "string"
2399
+ },
2400
+ {
2401
+ "disabled": false,
2402
+ "document": "说话人分组ID,仅支持大小写字母和下划线的组合,不超过128个字符",
2403
+ "example": "无",
2404
+ "member": "string",
2405
+ "name": "GroupId",
2406
+ "required": false,
2407
+ "type": "string"
2408
+ },
2409
+ {
2410
+ "disabled": false,
2411
+ "document": "删除模式: \n0.默认值,删除该条声纹\n1.从分组中删除该条声纹,声纹本身不删除\n2.从声纹库中删除分组,仅删除分组信息,不会真正删除分组中的声纹",
2412
+ "example": "0",
2413
+ "member": "int64",
2414
+ "name": "DelMod",
2415
+ "required": false,
2416
+ "type": "int"
2307
2417
  }
2308
2418
  ],
2309
2419
  "type": "object"
@@ -2368,6 +2478,15 @@
2368
2478
  "name": "SpeakerNick",
2369
2479
  "required": false,
2370
2480
  "type": "string"
2481
+ },
2482
+ {
2483
+ "disabled": false,
2484
+ "document": "分组id, 仅支持大小写字母和下划线的组合,不超过128个字符",
2485
+ "example": "无",
2486
+ "member": "string",
2487
+ "name": "GroupId",
2488
+ "required": false,
2489
+ "type": "string"
2371
2490
  }
2372
2491
  ],
2373
2492
  "type": "object"
@@ -2394,6 +2513,79 @@
2394
2513
  ],
2395
2514
  "type": "object"
2396
2515
  },
2516
+ "VoicePrintGroupVerifyRequest": {
2517
+ "document": "VoicePrintGroupVerify请求参数结构体",
2518
+ "members": [
2519
+ {
2520
+ "disabled": false,
2521
+ "document": "音频格式 0: pcm, 1: wav",
2522
+ "example": "0",
2523
+ "member": "int64",
2524
+ "name": "VoiceFormat",
2525
+ "required": true,
2526
+ "type": "int"
2527
+ },
2528
+ {
2529
+ "disabled": false,
2530
+ "document": "音频采样率,目前支持16000,单位:Hz,必填",
2531
+ "example": "16000",
2532
+ "member": "int64",
2533
+ "name": "SampleRate",
2534
+ "required": true,
2535
+ "type": "int"
2536
+ },
2537
+ {
2538
+ "disabled": false,
2539
+ "document": "音频数据, base64 编码, 音频时长不能超过30s,数据大小不超过2M",
2540
+ "example": "无",
2541
+ "member": "string",
2542
+ "name": "Data",
2543
+ "required": true,
2544
+ "type": "string"
2545
+ },
2546
+ {
2547
+ "disabled": false,
2548
+ "document": "分组id, 支持数字,字母,下划线,长度不超过128",
2549
+ "example": "test_group",
2550
+ "member": "string",
2551
+ "name": "GroupId",
2552
+ "required": true,
2553
+ "type": "string"
2554
+ },
2555
+ {
2556
+ "disabled": false,
2557
+ "document": "返回打分结果降序排列topN, TopN大于0, 小于可创建声纹最大数量",
2558
+ "example": "1",
2559
+ "member": "uint64",
2560
+ "name": "TopN",
2561
+ "required": true,
2562
+ "type": "int"
2563
+ }
2564
+ ],
2565
+ "type": "object"
2566
+ },
2567
+ "VoicePrintGroupVerifyResponse": {
2568
+ "document": "VoicePrintGroupVerify返回参数结构体",
2569
+ "members": [
2570
+ {
2571
+ "disabled": false,
2572
+ "document": "TopN 返回结果;系统建议打分70分以上为同一个人音色,评分也取决于音频质量、长度等其他原因影响,您可以按照业务需求适当提高或降低分数要求",
2573
+ "example": "无",
2574
+ "member": "VerifyTopResult",
2575
+ "name": "Data",
2576
+ "output_required": false,
2577
+ "type": "object",
2578
+ "value_allowed_null": false
2579
+ },
2580
+ {
2581
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
2582
+ "member": "string",
2583
+ "name": "RequestId",
2584
+ "type": "string"
2585
+ }
2586
+ ],
2587
+ "type": "object"
2588
+ },
2397
2589
  "VoicePrintUpdateRequest": {
2398
2590
  "document": "VoicePrintUpdate请求参数结构体",
2399
2591
  "members": [
@@ -222,6 +222,14 @@
222
222
  "title": "注册说话人"
223
223
  }
224
224
  ],
225
+ "VoicePrintGroupVerify": [
226
+ {
227
+ "document": "提供一段音频数据和提前注册的一组说话人数据进行比对, 返回topN",
228
+ "input": "POST / HTTP/1.1\nHost: asr.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: VoicePrintGroupVerify\n<公共请求参数>\n\n{\n \"VoiceFormat\": 1,\n \"SampleRate\": 16000,\n \"Data\": \"UklGRsb7AQBXQVZFZm10IBAAAAAB\",\n \"GroupId\": \"test\",\n \"TopN\": 2\n}",
229
+ "output": "{\n \"Response\": {\n \"Data\": {\n \"VerifyTops\": [\n {\n \"Score\": \"100.0\",\n \"SpeakerId\": \"张三\",\n \"VoicePrintId\": \"03c7c4-34e1-4cc2-97d4-f031bc6538d0\"\n },\n {\n \"Score\": \"89.0\",\n \"SpeakerId\": \"李四\",\n \"VoicePrintId\": \"16a936-c0c9-44b8-81e6-19515a9515ef\"\n }\n ]\n },\n \"RequestId\": \"affe4cc1-7158-ad-aefc-371fce09c092\"\n }\n}",
230
+ "title": "说话人验证1:N"
231
+ }
232
+ ],
225
233
  "VoicePrintUpdate": [
226
234
  {
227
235
  "document": "更新说话人的音频和昵称",
@@ -1434,7 +1434,7 @@
1434
1434
  {
1435
1435
  "disabled": false,
1436
1436
  "document": "过滤条件。\n<li> zone - String - 是否必填:否 -(过滤条件)按照可用区过滤。</li>\n<li> instance-family String - 是否必填:否 -(过滤条件)按照机型系列过滤。实例机型系列形如:S1、I1、M1等。</li>",
1437
- "example": "",
1437
+ "example": "\t[{\"Name\":\"zone\",\"Values\":[\"ap-guangzhou-1\"]}]",
1438
1438
  "member": "Filter",
1439
1439
  "name": "Filters",
1440
1440
  "required": false,
@@ -1449,9 +1449,10 @@
1449
1449
  {
1450
1450
  "disabled": false,
1451
1451
  "document": "机型配置数组",
1452
- "example": "",
1452
+ "example": "",
1453
1453
  "member": "InstanceTypeConfig",
1454
1454
  "name": "InstanceTypeConfigSet",
1455
+ "output_required": true,
1455
1456
  "type": "list",
1456
1457
  "value_allowed_null": false
1457
1458
  },
@@ -2013,7 +2014,7 @@
2013
2014
  {
2014
2015
  "disabled": false,
2015
2016
  "document": "过滤条件。\n<li> zone - String - 是否必填:否 -(过滤条件)按照可用区过滤。</li>\n<li> instance-family String - 是否必填:否 -(过滤条件)按照机型系列过滤。实例机型系列形如:S1、I1、M1等。</li>\n<li> instance-type - String - 是否必填:否 - (过滤条件)按照机型过滤。</li>\n<li> instance-charge-type - String - 是否必填:否 -(过滤条件)按照实例计费模式过滤。 ( POSTPAID_BY_HOUR:表示后付费,即按量计费机型 | SPOTPAID:表示竞价付费机型。 ) </li>",
2016
- "example": "",
2017
+ "example": "[{\"Name\":\"zone\",\"Values\":[\"ap-guangzhou-1\"]}]",
2017
2018
  "member": "Filter",
2018
2019
  "name": "Filters",
2019
2020
  "required": false,
@@ -2028,9 +2029,10 @@
2028
2029
  {
2029
2030
  "disabled": false,
2030
2031
  "document": "可用区机型配置列表。",
2031
- "example": "",
2032
+ "example": "",
2032
2033
  "member": "InstanceTypeQuotaItem",
2033
2034
  "name": "InstanceTypeQuotaSet",
2035
+ "output_required": true,
2034
2036
  "type": "list",
2035
2037
  "value_allowed_null": false
2036
2038
  },
@@ -2054,9 +2056,10 @@
2054
2056
  {
2055
2057
  "disabled": false,
2056
2058
  "document": "CVM实例分类列表",
2057
- "example": "",
2059
+ "example": "[{\"InstanceFamilySet\": [\"C3\",\"CN3\"],\"InstanceCategory\": \"COMPUTE_3\"}",
2058
2060
  "member": "InstanceCategoryItem",
2059
2061
  "name": "InstanceCategorySet",
2062
+ "output_required": true,
2060
2063
  "type": "list",
2061
2064
  "value_allowed_null": false
2062
2065
  },
@@ -116,7 +116,7 @@
116
116
  {
117
117
  "document": "",
118
118
  "input": "https://batch.tencentcloudapi.com/?Action=DescribeCvmZoneInstanceConfigInfos\r\n&Filters.0.Name=zone\r\n&Filters.0.Values.0=ap-chongqing-1\r\n&Filters.1.Name=instance-charge-type\r\n&Filters.1.Values.0=POSTPAID_BY_HOUR\r\n&<公共请求参数>",
119
- "output": "{\n \"Response\": {\n \"InstanceTypeQuotaSet\": [\n {\n \"Status\": \"SELL\",\n \"Zone\": \"ap-chongqing-1\",\n \"NetworkCard\": 0,\n \"Price\": {\n \"UnitPrice\": 0.18,\n \"ChargeUnit\": \"HOUR\"\n },\n \"InstanceFamily\": \"S3\",\n \"Externals\": {},\n \"Cpu\": 1,\n \"TypeName\": \"标准型S3\",\n \"InstanceChargeType\": \"POSTPAID_BY_HOUR\",\n \"Memory\": 1,\n \"LocalDiskTypeList\": [],\n \"InstanceType\": \"S3.SMALL1\"\n },\n {\n \"Status\": \"SELL\",\n \"Zone\": \"ap-chongqing-1\",\n \"NetworkCard\": 0,\n \"Price\": {\n \"UnitPrice\": 0.26,\n \"ChargeUnit\": \"HOUR\"\n },\n \"InstanceFamily\": \"S3\",\n \"Externals\": {},\n \"Cpu\": 1,\n \"TypeName\": \"标准型S3\",\n \"InstanceChargeType\": \"POSTPAID_BY_HOUR\",\n \"Memory\": 2,\n \"LocalDiskTypeList\": [],\n \"InstanceType\": \"S3.SMALL2\"\n }\n ],\n \"RequestId\": \"2fba5b9c-e4ee-47ad-a776-dabb79ff2c35\"\n }\n}",
119
+ "output": "{\n \"Response\": {\n \"InstanceTypeQuotaSet\": [\n {\n \"Status\": \"SELL\",\n \"Zone\": \"ap-guangzhou-2\",\n \"NetworkCard\": 0,\n \"Price\": {\n \"DiscountPrice\": 59,\n \"OriginalPriceThreeYear\": 0,\n \"DiscountOneYear\": 0,\n \"UnitPrice\": 0,\n \"UnitPriceThirdStep\": 0,\n \"OriginalPriceFiveYear\": 0,\n \"Discount\": 0,\n \"DiscountFiveYear\": 0,\n \"UnitPriceDiscountThirdStep\": 0,\n \"UnitPriceSecondStep\": 0,\n \"OriginalPrice\": 59,\n \"DiscountThreeYear\": 0,\n \"UnitPriceDiscountSecondStep\": 0,\n \"UnitPriceDiscount\": 0,\n \"DiscountPriceFiveYear\": 0,\n \"OriginalPriceOneYear\": 708,\n \"ChargeUnit\": \"HOUR\",\n \"DiscountPriceThreeYear\": 0,\n \"DiscountPriceOneYear\": 587.64\n },\n \"InstanceFamily\": \"S2\",\n \"Externals\": {},\n \"InstanceType\": \"S2.SMALL1\",\n \"TypeName\": \"Standard S2\",\n \"InstanceChargeType\": \"POSTPAID_BY_HOUR\",\n \"Memory\": 1,\n \"LocalDiskTypeList\": [],\n \"Cpu\": 1,\n \"SoldOutReason\": \"\",\n \"StorageBlockAmount\": 0,\n \"CpuType\": \"Intel Xeon E5-2680 v4\",\n \"InstancePps\": 20,\n \"InstanceBandwidth\": 1.5,\n \"Gpu\": 0,\n \"GpuCount\": 0,\n \"Fpga\": 0,\n \"Remark\": \"\",\n \"Frequency\": \"2.4GHz\",\n \"StatusCategory\": \"EnoughStock\"\n }\n ],\n \"RequestId\": \"c28559ca-d3cf-40f0-9664-2ab303484efa\"\n }\n}",
120
120
  "title": "查看重庆一区按量计费机型配置信息"
121
121
  }
122
122
  ],
@@ -433,6 +433,58 @@ def doIsolateDBInstance(args, parsed_globals):
433
433
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
434
434
 
435
435
 
436
+ def doDescribeRoGroups(args, parsed_globals):
437
+ g_param = parse_global_arg(parsed_globals)
438
+
439
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
440
+ cred = credential.CVMRoleCredential()
441
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
442
+ cred = credential.STSAssumeRoleCredential(
443
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
444
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
445
+ )
446
+ 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):
447
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
448
+ else:
449
+ cred = credential.Credential(
450
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
451
+ )
452
+ http_profile = HttpProfile(
453
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
454
+ reqMethod="POST",
455
+ endpoint=g_param[OptionsDefine.Endpoint],
456
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
457
+ )
458
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
459
+ if g_param[OptionsDefine.Language]:
460
+ profile.language = g_param[OptionsDefine.Language]
461
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
462
+ client = mod.CdbClient(cred, g_param[OptionsDefine.Region], profile)
463
+ client._sdkVersion += ("_CLI_" + __version__)
464
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
465
+ model = models.DescribeRoGroupsRequest()
466
+ model.from_json_string(json.dumps(args))
467
+ start_time = time.time()
468
+ while True:
469
+ rsp = client.DescribeRoGroups(model)
470
+ result = rsp.to_json_string()
471
+ try:
472
+ json_obj = json.loads(result)
473
+ except TypeError as e:
474
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
475
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
476
+ break
477
+ cur_time = time.time()
478
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
479
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
480
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
481
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
482
+ else:
483
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
484
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
485
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
486
+
487
+
436
488
  def doDescribeAccounts(args, parsed_globals):
437
489
  g_param = parse_global_arg(parsed_globals)
438
490
 
@@ -1005,7 +1057,7 @@ def doStopRollback(args, parsed_globals):
1005
1057
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1006
1058
 
1007
1059
 
1008
- def doDescribeRoGroups(args, parsed_globals):
1060
+ def doDescribeInstanceUpgradeType(args, parsed_globals):
1009
1061
  g_param = parse_global_arg(parsed_globals)
1010
1062
 
1011
1063
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1034,11 +1086,11 @@ def doDescribeRoGroups(args, parsed_globals):
1034
1086
  client = mod.CdbClient(cred, g_param[OptionsDefine.Region], profile)
1035
1087
  client._sdkVersion += ("_CLI_" + __version__)
1036
1088
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1037
- model = models.DescribeRoGroupsRequest()
1089
+ model = models.DescribeInstanceUpgradeTypeRequest()
1038
1090
  model.from_json_string(json.dumps(args))
1039
1091
  start_time = time.time()
1040
1092
  while True:
1041
- rsp = client.DescribeRoGroups(model)
1093
+ rsp = client.DescribeInstanceUpgradeType(model)
1042
1094
  result = rsp.to_json_string()
1043
1095
  try:
1044
1096
  json_obj = json.loads(result)
@@ -8564,6 +8616,7 @@ ACTION_MAP = {
8564
8616
  "CreateAuditRuleTemplate": doCreateAuditRuleTemplate,
8565
8617
  "BalanceRoGroupLoad": doBalanceRoGroupLoad,
8566
8618
  "IsolateDBInstance": doIsolateDBInstance,
8619
+ "DescribeRoGroups": doDescribeRoGroups,
8567
8620
  "DescribeAccounts": doDescribeAccounts,
8568
8621
  "ModifyInstanceTag": doModifyInstanceTag,
8569
8622
  "DescribeTimeWindow": doDescribeTimeWindow,
@@ -8575,7 +8628,7 @@ ACTION_MAP = {
8575
8628
  "DescribeCdbZoneConfig": doDescribeCdbZoneConfig,
8576
8629
  "CloseAuditService": doCloseAuditService,
8577
8630
  "StopRollback": doStopRollback,
8578
- "DescribeRoGroups": doDescribeRoGroups,
8631
+ "DescribeInstanceUpgradeType": doDescribeInstanceUpgradeType,
8579
8632
  "OfflineIsolatedInstances": doOfflineIsolatedInstances,
8580
8633
  "CreateAuditLogFile": doCreateAuditLogFile,
8581
8634
  "OpenDBInstanceGTID": doOpenDBInstanceGTID,