tccli 3.0.1370.1__py2.py3-none-any.whl → 3.0.1372.1__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/services/batch/v20170312/api.json +56 -56
  3. tccli/services/batch/v20170312/examples.json +3 -3
  4. tccli/services/cfg/v20210820/api.json +5 -5
  5. tccli/services/cfg/v20210820/examples.json +1 -1
  6. tccli/services/ckafka/v20190819/api.json +21 -21
  7. tccli/services/clb/v20180317/api.json +7 -7
  8. tccli/services/cls/v20201016/api.json +337 -233
  9. tccli/services/cls/v20201016/examples.json +32 -32
  10. tccli/services/csip/v20221121/examples.json +1 -1
  11. tccli/services/ctem/v20231128/api.json +112 -112
  12. tccli/services/ctem/v20231128/examples.json +10 -10
  13. tccli/services/dlc/v20210125/api.json +3 -3
  14. tccli/services/dnspod/v20210323/api.json +14 -4
  15. tccli/services/dnspod/v20210323/examples.json +2 -2
  16. tccli/services/es/v20180416/api.json +23 -4
  17. tccli/services/ess/v20201111/api.json +29 -5
  18. tccli/services/essbasic/v20210526/api.json +28 -4
  19. tccli/services/faceid/v20180301/api.json +42 -2
  20. tccli/services/faceid/v20180301/examples.json +2 -2
  21. tccli/services/iai/v20200303/api.json +9 -0
  22. tccli/services/lighthouse/lighthouse_client.py +106 -0
  23. tccli/services/lighthouse/v20200324/api.json +280 -0
  24. tccli/services/lighthouse/v20200324/examples.json +22 -0
  25. tccli/services/live/v20180801/api.json +1 -1
  26. tccli/services/lke/lke_client.py +0 -53
  27. tccli/services/lke/v20231130/api.json +32 -82
  28. tccli/services/lke/v20231130/examples.json +0 -8
  29. tccli/services/mariadb/v20170312/api.json +1 -1
  30. tccli/services/monitor/v20180724/api.json +3 -3
  31. tccli/services/ocr/v20181119/api.json +22 -2
  32. tccli/services/organization/v20210331/api.json +25 -25
  33. tccli/services/organization/v20210331/examples.json +1 -1
  34. tccli/services/sqlserver/v20180328/api.json +11 -9
  35. tccli/services/ssl/v20191205/api.json +1 -1
  36. tccli/services/teo/v20220901/api.json +12 -12
  37. tccli/services/tione/v20211111/api.json +18 -18
  38. tccli/services/tms/v20201229/api.json +6 -6
  39. tccli/services/trtc/trtc_client.py +159 -0
  40. tccli/services/trtc/v20190722/api.json +264 -0
  41. tccli/services/trtc/v20190722/examples.json +24 -0
  42. tccli/services/tse/v20201207/api.json +23 -5
  43. tccli/services/tse/v20201207/examples.json +2 -2
  44. tccli/services/tsf/v20180326/api.json +490 -490
  45. tccli/services/tsf/v20180326/examples.json +21 -21
  46. tccli/services/vod/v20180717/api.json +12 -1
  47. tccli/services/vpc/v20170312/api.json +12 -2
  48. tccli/services/vpc/v20170312/examples.json +2 -2
  49. tccli/services/wsa/v20250508/api.json +21 -3
  50. {tccli-3.0.1370.1.dist-info → tccli-3.0.1372.1.dist-info}/METADATA +2 -2
  51. {tccli-3.0.1370.1.dist-info → tccli-3.0.1372.1.dist-info}/RECORD +54 -54
  52. {tccli-3.0.1370.1.dist-info → tccli-3.0.1372.1.dist-info}/WHEEL +0 -0
  53. {tccli-3.0.1370.1.dist-info → tccli-3.0.1372.1.dist-info}/entry_points.txt +0 -0
  54. {tccli-3.0.1370.1.dist-info → tccli-3.0.1372.1.dist-info}/license_files/LICENSE +0 -0
@@ -192,7 +192,7 @@
192
192
  {
193
193
  "document": "",
194
194
  "input": "POST / HTTP/1.1\nHost: faceid.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: GetDetectInfoEnhanced\n<公共请求参数>\n\n{\n \"InfoType\": \"1\",\n \"BizToken\": \"CE661F1A-0F1E-45BD-BE13-34C05CEA7681\",\n \"RuleId\": \"0\"\n}",
195
- "output": "{\n \"Response\": {\n \"BestFrame\": {\n \"BestFrame\": \"/9j/4AAQSk...JKD2A//9k=\",\n \"BestFrames\": [\n \"/9j/4AAQSk...002dgP/9k=\",\n \"/9j/4AAQSk...vx+YH/2Q==\",\n \"/9j/4AAQSk...n6fj5Af//Z\",\n \"/9j/4AAQSk...dzlFFagf/Z\"\n ]\n },\n \"EncryptedBody\": \"\",\n \"Encryption\": {\n \"Algorithm\": \"\",\n \"CiphertextBlob\": \"\",\n \"EncryptList\": [],\n \"Iv\": \"\",\n \"TagList\": []\n },\n \"IdCardData\": {\n \"Avatar\": null,\n \"BackWarnInfos\": null,\n \"OcrBack\": null,\n \"OcrFront\": null,\n \"ProcessedBackImage\": null,\n \"ProcessedFrontImage\": null,\n \"WarnInfos\": null\n },\n \"IntentionActionResult\": null,\n \"IntentionQuestionResult\": {\n \"AsrResult\": [],\n \"Audios\": [],\n \"FinalResultCode\": null,\n \"FinalResultDetailCode\": null,\n \"FinalResultMessage\": null,\n \"ResultCode\": [],\n \"ScreenShot\": [],\n \"Video\": null\n },\n \"IntentionVerifyData\": {\n \"AsrResult\": null,\n \"AsrResultSimilarity\": null,\n \"ErrorCode\": null,\n \"ErrorMessage\": null,\n \"IntentionVerifyBestFrame\": null,\n \"IntentionVerifyVideo\": null\n },\n \"RequestId\": \"91173d84-e461-4da4-a270-2b8d48a2e136\",\n \"Text\": {\n \"CompareLibType\": \"权威库\",\n \"Comparemsg\": \"成功\",\n \"Comparestatus\": 0,\n \"ErrCode\": 0,\n \"ErrMsg\": \"成功\",\n \"Extra\": \"\",\n \"IdCard\": \"11204416541220243X\",\n \"IdInfoFrom\": \"其他\",\n \"LiveMsg\": \"成功\",\n \"LiveStatus\": 0,\n \"LivenessDetail\": [\n {\n \"CompareLibType\": \"权威库\",\n \"Comparemsg\": \"成功\",\n \"Comparestatus\": 0,\n \"Errcode\": 0,\n \"Errmsg\": \"成功\",\n \"Idcard\": \"11204416541220243X\",\n \"IsNeedCharge\": true,\n \"Livemsg\": \"成功\",\n \"LivenessMode\": 1,\n \"Livestatus\": 0,\n \"Name\": \"韦小宝\",\n \"ReqTime\": \"1730444265275\",\n \"Seq\": \"1f330eea-f5db-4726-a7b4-38cdf1aefb02\",\n \"Sim\": \"95.51\"\n }\n ],\n \"LivenessInfoTag\": null,\n \"LivenessMode\": 1,\n \"Location\": null,\n \"Mobile\": \"\",\n \"NFCBillingCounts\": 0,\n \"NFCRequestIds\": [],\n \"Name\": \"韦小宝\",\n \"OcrAddress\": null,\n \"OcrAuthority\": null,\n \"OcrBirth\": null,\n \"OcrGender\": null,\n \"OcrIdCard\": \"\",\n \"OcrName\": \"\",\n \"OcrNation\": null,\n \"OcrValidDate\": null,\n \"PassNo\": null,\n \"Sim\": \"95.51\",\n \"UseIDType\": 0,\n \"VisaNum\": null\n },\n \"VideoData\": {\n \"LivenessVideo\": \"AAAAGGZ0eX...VyYWxidW0h\"\n }\n }\n}",
195
+ "output": "{\n \"Response\": {\n \"BestFrame\": {\n \"BestFrame\": \"/9j/4AAQSk...JKD2A//9k=\",\n \"BestFrames\": [\n \"/9j/4AAQSk...002dgP/9k=\",\n \"/9j/4AAQSk...vx+YH/2Q==\",\n \"/9j/4AAQSk...n6fj5Af//Z\",\n \"/9j/4AAQSk...dzlFFagf/Z\"\n ]\n },\n \"EncryptedBody\": \"\",\n \"Encryption\": {\n \"Algorithm\": \"\",\n \"CiphertextBlob\": \"\",\n \"EncryptList\": [],\n \"Iv\": \"\",\n \"TagList\": []\n },\n \"IdCardData\": {\n \"Avatar\": null,\n \"BackWarnInfos\": null,\n \"OcrBack\": null,\n \"OcrFront\": null,\n \"ProcessedBackImage\": null,\n \"ProcessedFrontImage\": null,\n \"WarnInfos\": null\n },\n \"IntentionActionResult\": null,\n \"IntentionQuestionResult\": {\n \"AsrResult\": [],\n \"Audios\": [],\n \"FinalResultCode\": null,\n \"FinalResultDetailCode\": null,\n \"FinalResultMessage\": null,\n \"ResultCode\": [],\n \"ScreenShot\": [],\n \"Video\": null\n },\n \"IntentionVerifyData\": {\n \"AsrResult\": null,\n \"AsrResultSimilarity\": null,\n \"ErrorCode\": null,\n \"ErrorMessage\": null,\n \"IntentionVerifyBestFrame\": null,\n \"IntentionVerifyVideo\": null\n },\n \"IsVerifyIntention\": false,\n \"IntentionVerifyType\": \"\",\n \"RequestId\": \"91173d84-e461-4da4-a270-2b8d48a2e136\",\n \"Text\": {\n \"CompareLibType\": \"权威库\",\n \"Comparemsg\": \"成功\",\n \"Comparestatus\": 0,\n \"ErrCode\": 0,\n \"ErrMsg\": \"成功\",\n \"Extra\": \"\",\n \"IdCard\": \"11204416541220243X\",\n \"IdInfoFrom\": \"其他\",\n \"LiveMsg\": \"成功\",\n \"LiveStatus\": 0,\n \"LivenessDetail\": [\n {\n \"CompareLibType\": \"权威库\",\n \"Comparemsg\": \"成功\",\n \"Comparestatus\": 0,\n \"Errcode\": 0,\n \"Errmsg\": \"成功\",\n \"Idcard\": \"11204416541220243X\",\n \"IsNeedCharge\": true,\n \"Livemsg\": \"成功\",\n \"LivenessMode\": 1,\n \"Livestatus\": 0,\n \"Name\": \"韦小宝\",\n \"ReqTime\": \"1730444265275\",\n \"Seq\": \"1f330eea-f5db-4726-a7b4-38cdf1aefb02\",\n \"Sim\": \"95.51\"\n }\n ],\n \"LivenessInfoTag\": null,\n \"LivenessMode\": 1,\n \"Location\": null,\n \"Mobile\": \"\",\n \"NFCBillingCounts\": 0,\n \"NFCRequestIds\": [],\n \"Name\": \"韦小宝\",\n \"OcrAddress\": null,\n \"OcrAuthority\": null,\n \"OcrBirth\": null,\n \"OcrGender\": null,\n \"OcrIdCard\": \"\",\n \"OcrName\": \"\",\n \"OcrNation\": null,\n \"OcrValidDate\": null,\n \"PassNo\": null,\n \"Sim\": \"95.51\",\n \"UseIDType\": 0,\n \"VisaNum\": null\n },\n \"VideoData\": {\n \"LivenessVideo\": \"AAAAGGZ0eX...VyYWxidW0h\"\n }\n }\n}",
196
196
  "title": "获取结果信息成功示例"
197
197
  },
198
198
  {
@@ -206,7 +206,7 @@
206
206
  {
207
207
  "document": "成功获取E证通结果信息。",
208
208
  "input": "POST / HTTP/1.1\nHost: faceid.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: GetEidResult\n<公共请求参数>\n\n{\n \"InfoType\": \"1\",\n \"EidToken\": \"CE661F1A-0F1E-45BD-BE133-34C05CEA76812\"\n}",
209
- "output": "{\n \"Response\": {\n \"BestFrame\": {\n \"BestFrame\": \"/9j/4AAQSk...UVoYn/2Q==\",\n \"BestFrames\": [\n \"/9j/4AAQSk...AT/U//2Q==\"\n ]\n },\n \"EidInfo\": {\n \"DesKey\": \"\",\n \"EidCode\": \"OMKhJ5hkbPnA5PKGrzD1oKZ/e8W9w2g1yAOUIry7G/4xMDAw\",\n \"EidSign\": \"MEQCIDt0Xa...YygK4Fhw==\",\n \"UserInfo\": \"\"\n },\n \"IdCardData\": {\n \"Avatar\": \"\",\n \"BackWarnInfos\": null,\n \"OcrBack\": \"\",\n \"OcrFront\": \"\",\n \"ProcessedBackImage\": \"\",\n \"ProcessedFrontImage\": \"\",\n \"WarnInfos\": null\n },\n \"IntentionActionResult\": null,\n \"IntentionQuestionResult\": {\n \"AsrResult\": null,\n \"Audios\": null,\n \"FinalResultCode\": \"\",\n \"FinalResultDetailCode\": null,\n \"FinalResultMessage\": null,\n \"ResultCode\": null,\n \"ScreenShot\": null,\n \"Video\": \"\"\n },\n \"IntentionVerifyData\": {\n \"AsrResult\": \"\",\n \"AsrResultSimilarity\": \"\",\n \"ErrorCode\": 0,\n \"ErrorMessage\": \"\",\n \"IntentionVerifyBestFrame\": \"\",\n \"IntentionVerifyVideo\": \"\"\n },\n \"RequestId\": \"29a30ec8-0c15-4566-a5ab-99f88a3f0821\",\n \"Text\": {\n \"CompareLibType\": \"权威库\",\n \"Comparemsg\": \"成功\",\n \"Comparestatus\": 0,\n \"ErrCode\": 0,\n \"ErrMsg\": \"成功\",\n \"Extra\": \"\",\n \"IdCard\": \"\",\n \"IdInfoFrom\": \"其他\",\n \"LiveMsg\": \"成功\",\n \"LiveStatus\": 0,\n \"LivenessInfoTag\": [\n \"01\"\n ],\n \"LivenessDetail\": [\n {\n \"CompareLibType\": \"权威库\",\n \"Comparemsg\": \"成功\",\n \"Comparestatus\": 0,\n \"Errcode\": 0,\n \"Errmsg\": \"成功\",\n \"Idcard\": \"\",\n \"IsNeedCharge\": true,\n \"Livemsg\": \"成功\",\n \"LivenessMode\": 4,\n \"Livestatus\": 0,\n \"Name\": \"\",\n \"ReqTime\": \"1730451371368\",\n \"Seq\": \"092ff8ca-4d1c-4c2122-b513-ec8ced564c9a\",\n \"Sim\": \"97.31\"\n }\n ],\n \"LivenessMode\": 4,\n \"Location\": \"\",\n \"Mobile\": \"\",\n \"NFCBillingCounts\": 0,\n \"NFCRequestIds\": null,\n \"Name\": \"\",\n \"OcrAddress\": \"\",\n \"OcrAuthority\": \"\",\n \"OcrBirth\": \"\",\n \"OcrGender\": \"\",\n \"OcrIdCard\": \"\",\n \"OcrName\": \"\",\n \"OcrNation\": \"\",\n \"OcrValidDate\": \"\",\n \"PassNo\": \"\",\n \"Sim\": \"97.31\",\n \"UseIDType\": 0,\n \"VisaNum\": \"\"\n }\n }\n}",
209
+ "output": "{\n \"Response\": {\n \"BestFrame\": {\n \"BestFrame\": \"/9j/4AAQSk...UVoYn/2Q==\",\n \"BestFrames\": [\n \"/9j/4AAQSk...AT/U//2Q==\"\n ]\n },\n \"EidInfo\": {\n \"DesKey\": \"\",\n \"EidCode\": \"OMKhJ5hkbPnA5PKGrzD1oKZ/e8W9w2g1yAOUIry7G/4xMDAw\",\n \"EidSign\": \"MEQCIDt0Xa...YygK4Fhw==\",\n \"UserInfo\": \"\"\n },\n \"IdCardData\": {\n \"Avatar\": \"\",\n \"BackWarnInfos\": null,\n \"OcrBack\": \"\",\n \"OcrFront\": \"\",\n \"ProcessedBackImage\": \"\",\n \"ProcessedFrontImage\": \"\",\n \"WarnInfos\": null\n },\n \"IsVerifyIntention\": false,\n \"IntentionVerifyType\": \"\",\n \"IntentionActionResult\": null,\n \"IntentionQuestionResult\": {\n \"AsrResult\": null,\n \"Audios\": null,\n \"FinalResultCode\": \"\",\n \"FinalResultDetailCode\": null,\n \"FinalResultMessage\": null,\n \"ResultCode\": null,\n \"ScreenShot\": null,\n \"Video\": \"\"\n },\n \"IntentionVerifyData\": {\n \"AsrResult\": \"\",\n \"AsrResultSimilarity\": \"\",\n \"ErrorCode\": 0,\n \"ErrorMessage\": \"\",\n \"IntentionVerifyBestFrame\": \"\",\n \"IntentionVerifyVideo\": \"\"\n },\n \"RequestId\": \"29a30ec8-0c15-4566-a5ab-99f88a3f0821\",\n \"Text\": {\n \"CompareLibType\": \"权威库\",\n \"Comparemsg\": \"成功\",\n \"Comparestatus\": 0,\n \"ErrCode\": 0,\n \"ErrMsg\": \"成功\",\n \"Extra\": \"\",\n \"IdCard\": \"\",\n \"IdInfoFrom\": \"其他\",\n \"LiveMsg\": \"成功\",\n \"LiveStatus\": 0,\n \"LivenessInfoTag\": [\n \"01\"\n ],\n \"LivenessDetail\": [\n {\n \"CompareLibType\": \"权威库\",\n \"Comparemsg\": \"成功\",\n \"Comparestatus\": 0,\n \"Errcode\": 0,\n \"Errmsg\": \"成功\",\n \"Idcard\": \"\",\n \"IsNeedCharge\": true,\n \"Livemsg\": \"成功\",\n \"LivenessMode\": 4,\n \"Livestatus\": 0,\n \"Name\": \"\",\n \"ReqTime\": \"1730451371368\",\n \"Seq\": \"092ff8ca-4d1c-4c2122-b513-ec8ced564c9a\",\n \"Sim\": \"97.31\"\n }\n ],\n \"LivenessMode\": 4,\n \"Location\": \"\",\n \"Mobile\": \"\",\n \"NFCBillingCounts\": 0,\n \"NFCRequestIds\": null,\n \"Name\": \"\",\n \"OcrAddress\": \"\",\n \"OcrAuthority\": \"\",\n \"OcrBirth\": \"\",\n \"OcrGender\": \"\",\n \"OcrIdCard\": \"\",\n \"OcrName\": \"\",\n \"OcrNation\": \"\",\n \"OcrValidDate\": \"\",\n \"PassNo\": \"\",\n \"Sim\": \"97.31\",\n \"UseIDType\": 0,\n \"VisaNum\": \"\"\n }\n }\n}",
210
210
  "title": "获取E证通结果信息成功示例"
211
211
  },
212
212
  {
@@ -623,6 +623,15 @@
623
623
  "name": "NeedRotateDetection",
624
624
  "required": false,
625
625
  "type": "int"
626
+ },
627
+ {
628
+ "disabled": false,
629
+ "document": "若图片中包含多张人脸,指定选取策略,默认为0。\n- 0:选取其中置信度最高的人脸\n- 1:选取其中面积最大的人脸。",
630
+ "example": "0",
631
+ "member": "uint64",
632
+ "name": "FaceMatchingStrategy",
633
+ "required": false,
634
+ "type": "int"
626
635
  }
627
636
  ],
628
637
  "type": "object"
@@ -537,6 +537,58 @@ def doImportKeyPair(args, parsed_globals):
537
537
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
538
538
 
539
539
 
540
+ def doDescribeImagesToShare(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.LighthouseClient(cred, g_param[OptionsDefine.Region], profile)
567
+ client._sdkVersion += ("_CLI_" + __version__)
568
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
569
+ model = models.DescribeImagesToShareRequest()
570
+ model.from_json_string(json.dumps(args))
571
+ start_time = time.time()
572
+ while True:
573
+ rsp = client.DescribeImagesToShare(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 doInquirePriceCreateDisks(args, parsed_globals):
541
593
  g_param = parse_global_arg(parsed_globals)
542
594
 
@@ -2773,6 +2825,58 @@ def doDetachDisks(args, parsed_globals):
2773
2825
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2774
2826
 
2775
2827
 
2828
+ def doModifyImageSharePermission(args, parsed_globals):
2829
+ g_param = parse_global_arg(parsed_globals)
2830
+
2831
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2832
+ cred = credential.CVMRoleCredential()
2833
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2834
+ cred = credential.STSAssumeRoleCredential(
2835
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2836
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2837
+ )
2838
+ 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):
2839
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2840
+ else:
2841
+ cred = credential.Credential(
2842
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2843
+ )
2844
+ http_profile = HttpProfile(
2845
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2846
+ reqMethod="POST",
2847
+ endpoint=g_param[OptionsDefine.Endpoint],
2848
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2849
+ )
2850
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2851
+ if g_param[OptionsDefine.Language]:
2852
+ profile.language = g_param[OptionsDefine.Language]
2853
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2854
+ client = mod.LighthouseClient(cred, g_param[OptionsDefine.Region], profile)
2855
+ client._sdkVersion += ("_CLI_" + __version__)
2856
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
2857
+ model = models.ModifyImageSharePermissionRequest()
2858
+ model.from_json_string(json.dumps(args))
2859
+ start_time = time.time()
2860
+ while True:
2861
+ rsp = client.ModifyImageSharePermission(model)
2862
+ result = rsp.to_json_string()
2863
+ try:
2864
+ json_obj = json.loads(result)
2865
+ except TypeError as e:
2866
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
2867
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2868
+ break
2869
+ cur_time = time.time()
2870
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2871
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2872
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2873
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2874
+ else:
2875
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2876
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2877
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2878
+
2879
+
2776
2880
  def doStartDockerContainers(args, parsed_globals):
2777
2881
  g_param = parse_global_arg(parsed_globals)
2778
2882
 
@@ -5654,6 +5758,7 @@ ACTION_MAP = {
5654
5758
  "ModifyDisksRenewFlag": doModifyDisksRenewFlag,
5655
5759
  "RenameDockerContainer": doRenameDockerContainer,
5656
5760
  "ImportKeyPair": doImportKeyPair,
5761
+ "DescribeImagesToShare": doDescribeImagesToShare,
5657
5762
  "InquirePriceCreateDisks": doInquirePriceCreateDisks,
5658
5763
  "TerminateInstances": doTerminateInstances,
5659
5764
  "DescribeBundleDiscount": doDescribeBundleDiscount,
@@ -5697,6 +5802,7 @@ ACTION_MAP = {
5697
5802
  "CreateBlueprint": doCreateBlueprint,
5698
5803
  "DescribeDockerActivities": doDescribeDockerActivities,
5699
5804
  "DetachDisks": doDetachDisks,
5805
+ "ModifyImageSharePermission": doModifyImageSharePermission,
5700
5806
  "StartDockerContainers": doStartDockerContainers,
5701
5807
  "DescribeModifyInstanceBundles": doDescribeModifyInstanceBundles,
5702
5808
  "CreateKeyPair": doCreateKeyPair,
@@ -336,6 +336,13 @@
336
336
  "output": "DescribeGeneralResourceQuotasResponse",
337
337
  "status": "online"
338
338
  },
339
+ "DescribeImagesToShare": {
340
+ "document": "本接口 (DescribeImagesToShare) 用于查询CVM的自定义镜像列表共享到轻量应用服务器。",
341
+ "input": "DescribeImagesToShareRequest",
342
+ "name": "查询CVM镜像列表",
343
+ "output": "DescribeImagesToShareResponse",
344
+ "status": "online"
345
+ },
339
346
  "DescribeInstanceVncUrl": {
340
347
  "document": "本接口 ( DescribeInstanceVncUrl ) 用于查询实例管理终端地址,获取的地址可用于实例的 VNC 登录。\n\n* 仅处于 `RUNNING`,`RESCUE_MODE` 状态的机器,且当前机器无变更中操作,才可使用此功能。\n* 管理终端地址的有效期为 15 秒,调用接口成功后如果 15 秒内不使用该链接进行访问,管理终端地址自动失效,您需要重新查询。\n* 管理终端地址一旦被访问,将自动失效,您需要重新查询。\n* 如果连接断开,每分钟内重新连接的次数不能超过 30 次。\n* 参数 `InstanceVncUrl` :调用接口成功后会返回的 `InstanceVncUrl` 的值。\n获取到 `InstanceVncUrl` 后,您需要在链接 `https://img.qcloud.com/qcloud/app/active_vnc/index.html?` 末尾加上参数 `InstanceVncUrl=xxxx`。\n 最后组成的 URL 格式如下:\n\n```\nhttps://img.qcloud.com/qcloud/app/active_vnc/index.html?InstanceVncUrl=wss%3A%2F%2Fbjvnc.qcloud.com%3A26789%2Fvnc%3Fs%3DaHpjWnRVMFNhYmxKdDM5MjRHNlVTSVQwajNUSW0wb2tBbmFtREFCTmFrcy8vUUNPMG0wSHZNOUUxRm5PMmUzWmFDcWlOdDJIbUJxSTZDL0RXcHZxYnZZMmRkWWZWcEZia2lyb09XMzdKNmM9\n```",
341
348
  "input": "DescribeInstanceVncUrlRequest",
@@ -574,6 +581,13 @@
574
581
  "output": "ModifyFirewallTemplateResponse",
575
582
  "status": "online"
576
583
  },
584
+ "ModifyImageSharePermission": {
585
+ "document": "本接口 (ModifyImageSharePermission) 用于共享和取消共享CVM自定义镜像到轻量应用服务器服务。\nCVM镜像共享到轻量应用服务器镜像需要满足如下条件:\n1.已共享过的镜像不支持再次共享。\n2.外部导入的镜像不支持共享。\n3.整机镜像不支持共享。\n4.镜像要支持Cloudinit才支持共享。\n5.镜像的Platform和OsName要满足。\n6.NORMAL状态的镜像才支持共享。",
586
+ "input": "ModifyImageSharePermissionRequest",
587
+ "name": "修改CVM镜像共享信息",
588
+ "output": "ModifyImageSharePermissionResponse",
589
+ "status": "online"
590
+ },
577
591
  "ModifyInstancesAttribute": {
578
592
  "document": "本接口(ModifyInstancesAttribute)用于修改实例的属性。\n* “实例名称”仅为方便用户自己管理之用。\n* 支持批量操作。每次请求批量实例的上限为 100。",
579
593
  "input": "ModifyInstancesAttributeRequest",
@@ -4061,6 +4075,80 @@
4061
4075
  ],
4062
4076
  "type": "object"
4063
4077
  },
4078
+ "DescribeImagesToShareRequest": {
4079
+ "document": "DescribeImagesToShare请求参数结构体",
4080
+ "members": [
4081
+ {
4082
+ "disabled": false,
4083
+ "document": "CVM镜像 ID 列表。可通过[DescribeImages](https://cloud.tencent.com/document/api/213/15715)接口返回值中的ImageId获取。",
4084
+ "example": "[\"img-xksdu822\"]",
4085
+ "member": "string",
4086
+ "name": "ImageIds",
4087
+ "required": false,
4088
+ "type": "list"
4089
+ },
4090
+ {
4091
+ "disabled": false,
4092
+ "document": "偏移量,默认为 0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/product/1207/47578)中的相关小节。",
4093
+ "example": "0",
4094
+ "member": "int64",
4095
+ "name": "Offset",
4096
+ "required": false,
4097
+ "type": "int"
4098
+ },
4099
+ {
4100
+ "disabled": false,
4101
+ "document": "返回数量,默认为 20,最大值为 100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/product/1207/47578)中的相关小节。",
4102
+ "example": "1",
4103
+ "member": "int64",
4104
+ "name": "Limit",
4105
+ "required": false,
4106
+ "type": "int"
4107
+ },
4108
+ {
4109
+ "disabled": false,
4110
+ "document": "过滤器列表。\n<li>image-id</li>按照【CVM镜像ID】进行过滤。\n类型:String\n必选:否\n\n<li>image-name</li>按照【CVM镜像名称】进行过滤。\n类型:String\n必选:否\n\n<li>image-type</li>按照【CVM镜像类型】进行过滤。\n类型:String\n必选:否\n取值范围:\nPRIVATE_IMAGE: 私有镜像 (本账户创建的镜像)\nPUBLIC_IMAGE: 公共镜像 (腾讯云官方镜像)\nSHARED_IMAGE: 共享镜像(其他账户共享给本账户的镜像) 。\n\n每次请求的 Filters 的上限为 10,Filter.Values 的上限为 5。\n参数不可以同时指定ImageIds和Filters。",
4111
+ "example": "无",
4112
+ "member": "Filter",
4113
+ "name": "Filters",
4114
+ "required": false,
4115
+ "type": "list"
4116
+ }
4117
+ ],
4118
+ "type": "object"
4119
+ },
4120
+ "DescribeImagesToShareResponse": {
4121
+ "document": "DescribeImagesToShare返回参数结构体",
4122
+ "members": [
4123
+ {
4124
+ "disabled": false,
4125
+ "document": "符合条件的镜像数量。",
4126
+ "example": "1",
4127
+ "member": "int64",
4128
+ "name": "TotalCount",
4129
+ "required": true,
4130
+ "type": "int",
4131
+ "value_allowed_null": false
4132
+ },
4133
+ {
4134
+ "disabled": false,
4135
+ "document": "CVM镜像详细信息列表。",
4136
+ "example": "无",
4137
+ "member": "Image",
4138
+ "name": "ImageSet",
4139
+ "required": true,
4140
+ "type": "list",
4141
+ "value_allowed_null": false
4142
+ },
4143
+ {
4144
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
4145
+ "member": "string",
4146
+ "name": "RequestId",
4147
+ "type": "string"
4148
+ }
4149
+ ],
4150
+ "type": "object"
4151
+ },
4064
4152
  "DescribeInstanceVncUrlRequest": {
4065
4153
  "document": "DescribeInstanceVncUrl请求参数结构体",
4066
4154
  "members": [
@@ -6453,6 +6541,152 @@
6453
6541
  ],
6454
6542
  "usage": "out"
6455
6543
  },
6544
+ "Image": {
6545
+ "document": "CVM镜像信息。",
6546
+ "members": [
6547
+ {
6548
+ "disabled": false,
6549
+ "document": "CVM镜像 ID ,是Image的唯一标识。",
6550
+ "example": "img-cs2rrmp0",
6551
+ "member": "string",
6552
+ "name": "ImageId",
6553
+ "required": true,
6554
+ "type": "string",
6555
+ "value_allowed_null": false
6556
+ },
6557
+ {
6558
+ "disabled": false,
6559
+ "document": "镜像名称。",
6560
+ "example": "test-image",
6561
+ "member": "string",
6562
+ "name": "ImageName",
6563
+ "required": true,
6564
+ "type": "string",
6565
+ "value_allowed_null": false
6566
+ },
6567
+ {
6568
+ "disabled": false,
6569
+ "document": "镜像描述。",
6570
+ "example": "test-image",
6571
+ "member": "string",
6572
+ "name": "ImageDescription",
6573
+ "required": true,
6574
+ "type": "string",
6575
+ "value_allowed_null": false
6576
+ },
6577
+ {
6578
+ "disabled": false,
6579
+ "document": "镜像大小。单位GB。",
6580
+ "example": "50",
6581
+ "member": "int64",
6582
+ "name": "ImageSize",
6583
+ "required": true,
6584
+ "type": "int",
6585
+ "value_allowed_null": false
6586
+ },
6587
+ {
6588
+ "disabled": false,
6589
+ "document": "镜像来源。\n<li>CREATE_IMAGE:自定义镜像</li>\n<li>EXTERNAL_IMPORT:外部导入镜像</li>",
6590
+ "example": "CREATE_IMAGE",
6591
+ "member": "string",
6592
+ "name": "ImageSource",
6593
+ "required": true,
6594
+ "type": "string",
6595
+ "value_allowed_null": false
6596
+ },
6597
+ {
6598
+ "disabled": false,
6599
+ "document": "镜像分类\n<li>SystemImage:系统盘镜像</li>\n<li>InstanceImage:整机镜像</li>",
6600
+ "example": "SystemImage",
6601
+ "member": "string",
6602
+ "name": "ImageClass",
6603
+ "required": true,
6604
+ "type": "string",
6605
+ "value_allowed_null": false
6606
+ },
6607
+ {
6608
+ "disabled": false,
6609
+ "document": "镜像状态\nCREATING:创建中\nNORMAL:正常\nCREATEFAILED:创建失败\nUSING:使用中\nSYNCING:同步中\nIMPORTING:导入中\nIMPORTFAILED:导入失败",
6610
+ "example": "NORMAL",
6611
+ "member": "string",
6612
+ "name": "ImageState",
6613
+ "required": true,
6614
+ "type": "string",
6615
+ "value_allowed_null": false
6616
+ },
6617
+ {
6618
+ "disabled": false,
6619
+ "document": "镜像是否支持Cloudinit。",
6620
+ "example": "true",
6621
+ "member": "bool",
6622
+ "name": "IsSupportCloudinit",
6623
+ "required": true,
6624
+ "type": "bool",
6625
+ "value_allowed_null": false
6626
+ },
6627
+ {
6628
+ "disabled": false,
6629
+ "document": "镜像架构。",
6630
+ "example": "x86_64",
6631
+ "member": "string",
6632
+ "name": "Architecture",
6633
+ "required": true,
6634
+ "type": "string",
6635
+ "value_allowed_null": false
6636
+ },
6637
+ {
6638
+ "disabled": false,
6639
+ "document": "镜像操作系统。",
6640
+ "example": "Ubuntu Server 20.04 LTS 64bit",
6641
+ "member": "string",
6642
+ "name": "OsName",
6643
+ "required": true,
6644
+ "type": "string",
6645
+ "value_allowed_null": false
6646
+ },
6647
+ {
6648
+ "disabled": false,
6649
+ "document": "镜像来源平台。",
6650
+ "example": "Ubuntu",
6651
+ "member": "string",
6652
+ "name": "Platform",
6653
+ "required": true,
6654
+ "type": "string",
6655
+ "value_allowed_null": false
6656
+ },
6657
+ {
6658
+ "disabled": false,
6659
+ "document": "镜像创建时间。",
6660
+ "example": "2021-07-23T08:49:36Z",
6661
+ "member": "datetime_iso",
6662
+ "name": "CreatedTime",
6663
+ "required": true,
6664
+ "type": "string",
6665
+ "value_allowed_null": false
6666
+ },
6667
+ {
6668
+ "disabled": false,
6669
+ "document": "镜像是否可共享到轻量应用服务器。",
6670
+ "example": "true",
6671
+ "member": "bool",
6672
+ "name": "IsShareable",
6673
+ "required": true,
6674
+ "type": "bool",
6675
+ "value_allowed_null": false
6676
+ },
6677
+ {
6678
+ "disabled": false,
6679
+ "document": "不可共享的原因。",
6680
+ "example": "镜像已共享。",
6681
+ "member": "string",
6682
+ "name": "UnshareableReason",
6683
+ "required": true,
6684
+ "type": "string",
6685
+ "value_allowed_null": false
6686
+ }
6687
+ ],
6688
+ "usage": "out"
6689
+ },
6456
6690
  "ImportKeyPairRequest": {
6457
6691
  "document": "ImportKeyPair请求参数结构体",
6458
6692
  "members": [
@@ -8093,6 +8327,52 @@
8093
8327
  ],
8094
8328
  "type": "object"
8095
8329
  },
8330
+ "ModifyImageSharePermissionRequest": {
8331
+ "document": "ModifyImageSharePermission请求参数结构体",
8332
+ "members": [
8333
+ {
8334
+ "disabled": false,
8335
+ "document": "镜像 ID。可通过[DescribeImages](https://cloud.tencent.com/document/api/213/15715)接口返回值中的ImageId获取。",
8336
+ "example": "img-dw8adx",
8337
+ "member": "string",
8338
+ "name": "ImageId",
8339
+ "required": true,
8340
+ "type": "string"
8341
+ },
8342
+ {
8343
+ "disabled": false,
8344
+ "document": "共享属性,包括 SHARE,CANCEL。其中SHARE代表共享,CANCEL代表取消共享。",
8345
+ "example": "SHARE",
8346
+ "member": "string",
8347
+ "name": "Permission",
8348
+ "required": true,
8349
+ "type": "string"
8350
+ }
8351
+ ],
8352
+ "type": "object"
8353
+ },
8354
+ "ModifyImageSharePermissionResponse": {
8355
+ "document": "ModifyImageSharePermission返回参数结构体",
8356
+ "members": [
8357
+ {
8358
+ "disabled": false,
8359
+ "document": "CVM自定义镜像共享到轻量应用服务器后的镜像ID。\n注意:此字段可能返回 null,表示取不到有效值。",
8360
+ "example": "lhbp-xkeh87da",
8361
+ "member": "string",
8362
+ "name": "BlueprintId",
8363
+ "required": true,
8364
+ "type": "string",
8365
+ "value_allowed_null": true
8366
+ },
8367
+ {
8368
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
8369
+ "member": "string",
8370
+ "name": "RequestId",
8371
+ "type": "string"
8372
+ }
8373
+ ],
8374
+ "type": "object"
8375
+ },
8096
8376
  "ModifyInstancesAttributeRequest": {
8097
8377
  "document": "ModifyInstancesAttribute请求参数结构体",
8098
8378
  "members": [
@@ -390,6 +390,14 @@
390
390
  "title": "查询通用资源配额信息"
391
391
  }
392
392
  ],
393
+ "DescribeImagesToShare": [
394
+ {
395
+ "document": "",
396
+ "input": "POST / HTTP/1.1\nHost: lighthouse.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeImagesToShare\n<公共请求参数>\n\n{\n \"ImageIds\": [\n \"img-cs2rrmp0\"\n ]\n}",
397
+ "output": "{\n \"Response\": {\n \"TotalCount\": 1,\n \"ImageSet\": [\n {\n \"ImageId\": \"img-cs2rrmp0\",\n \"ImageName\": \"ubuntu\",\n \"ImageDescription\": \"ubuntu\",\n \"ImageSize\": 50,\n \"ImageSource\": \"CREATE_IMAGE\",\n \"ImageClass\": \"SystemImage\",\n \"ImageState\": \"NORMAL\",\n \"IsSupportCloudinit\": true,\n \"Architecture\": \"x86_64\",\n \"OsName\": \"Ubuntu Server 20.04 LTS 64bit\",\n \"Platform\": \"Ubuntu\",\n \"CreatedTime\": \"2021-07-23T08:49:36Z\",\n \"IsShareable\": true,\n \"UnshareableReason\": \"\"\n }\n ],\n \"RequestId\": \"c5aafa9d-20e4-400e-852c-b800f607dd91\"\n }\n}",
398
+ "title": "查询CVM的自定义镜像列表共享到轻量应用服务器"
399
+ }
400
+ ],
393
401
  "DescribeInstanceVncUrl": [
394
402
  {
395
403
  "document": "本示例用于查询实例管理终端地址。",
@@ -662,6 +670,20 @@
662
670
  "title": "修改防火墙模板"
663
671
  }
664
672
  ],
673
+ "ModifyImageSharePermission": [
674
+ {
675
+ "document": "共享CVM镜像到轻量应用服务器镜像。",
676
+ "input": "POST / HTTP/1.1\nHost: lighthouse.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyImageSharePermission\n<公共请求参数>\n\n{\n \"ImageId\": \"img-xkd784jw\",\n \"Permission\": \"SHARE\"\n}",
677
+ "output": "{\n \"Response\": {\n \"BlueprintId\": \"lhbp-su83x02a\",\n \"RequestId\": \"4fe640d6-4912-4b43-9b3a-cc3bbab4cef2\"\n }\n}",
678
+ "title": "共享CVM镜像到轻量应用服务器镜像"
679
+ },
680
+ {
681
+ "document": "CVM镜像取消共享到轻量应用服务器镜像",
682
+ "input": "POST / HTTP/1.1\nHost: lighthouse.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyImageSharePermission\n<公共请求参数>\n\n{\n \"ImageId\": \"img-xkd784jw\",\n \"Permission\": \"CANEL\"\n}",
683
+ "output": "{\n \"Response\": {\n \"BlueprintId\": null,\n \"RequestId\": \"4fe640d6-4912-4b43-9b3a-cc3bbab4cef2\"\n }\n}",
684
+ "title": "CVM镜像取消共享到轻量应用服务器镜像"
685
+ }
686
+ ],
665
687
  "ModifyInstancesAttribute": [
666
688
  {
667
689
  "document": "修改实例的名称\n",
@@ -8345,7 +8345,7 @@
8345
8345
  },
8346
8346
  {
8347
8347
  "disabled": false,
8348
- "document": "可选值:\nMainland:查询国内数据,\nOversea:则查询国外数据,\n默认:查询国内+国外的数据。\n注:LEB(快直播)只支持国内+国外数据查询。",
8348
+ "document": "可选值:Mainland:查询国内数据,Oversea:则查询国外数据,默认:查询国内+国外的数据。",
8349
8349
  "example": "Mainland",
8350
8350
  "member": "string",
8351
8351
  "name": "MainlandOrOversea",
@@ -2513,58 +2513,6 @@ def doListQACate(args, parsed_globals):
2513
2513
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2514
2514
 
2515
2515
 
2516
- def doListAppCategory(args, parsed_globals):
2517
- g_param = parse_global_arg(parsed_globals)
2518
-
2519
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2520
- cred = credential.CVMRoleCredential()
2521
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2522
- cred = credential.STSAssumeRoleCredential(
2523
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2524
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2525
- )
2526
- 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):
2527
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2528
- else:
2529
- cred = credential.Credential(
2530
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2531
- )
2532
- http_profile = HttpProfile(
2533
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2534
- reqMethod="POST",
2535
- endpoint=g_param[OptionsDefine.Endpoint],
2536
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2537
- )
2538
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2539
- if g_param[OptionsDefine.Language]:
2540
- profile.language = g_param[OptionsDefine.Language]
2541
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2542
- client = mod.LkeClient(cred, g_param[OptionsDefine.Region], profile)
2543
- client._sdkVersion += ("_CLI_" + __version__)
2544
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
2545
- model = models.ListAppCategoryRequest()
2546
- model.from_json_string(json.dumps(args))
2547
- start_time = time.time()
2548
- while True:
2549
- rsp = client.ListAppCategory(model)
2550
- result = rsp.to_json_string()
2551
- try:
2552
- json_obj = json.loads(result)
2553
- except TypeError as e:
2554
- json_obj = json.loads(result.decode('utf-8')) # python3.3
2555
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2556
- break
2557
- cur_time = time.time()
2558
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2559
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2560
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2561
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2562
- else:
2563
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2564
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2565
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2566
-
2567
-
2568
2516
  def doDescribeQA(args, parsed_globals):
2569
2517
  g_param = parse_global_arg(parsed_globals)
2570
2518
 
@@ -5640,7 +5588,6 @@ ACTION_MAP = {
5640
5588
  "DescribeNodeRun": doDescribeNodeRun,
5641
5589
  "ListWorkflowRuns": doListWorkflowRuns,
5642
5590
  "ListQACate": doListQACate,
5643
- "ListAppCategory": doListAppCategory,
5644
5591
  "DescribeQA": doDescribeQA,
5645
5592
  "CreateApp": doCreateApp,
5646
5593
  "ModifyDoc": doModifyDoc,