tccli 3.0.1035.1__py2.py3-none-any.whl → 3.0.1037.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 (292) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/examples/cdc/v20201214/DescribeDedicatedClusterHosts.md +2 -0
  3. tccli/examples/cdc/v20201214/DescribeDedicatedClusterOverview.md +59 -7
  4. tccli/examples/cdwch/v20200915/DescribeInstanceNodes.md +41 -0
  5. tccli/examples/cdwch/v20200915/DescribeSpec.md +27 -20
  6. tccli/examples/cwp/v20180228/CreateMalwareWhiteList.md +10 -4
  7. tccli/examples/cwp/v20180228/DescribeMachineFileTamperRules.md +9 -8
  8. tccli/examples/cwp/v20180228/ModifyLoginWhiteRecord.md +11 -10
  9. tccli/examples/hai/v20230812/DescribeApplications.md +6 -2
  10. tccli/examples/mrs/v20200910/ImageMaskAsync.md +25 -0
  11. tccli/examples/mrs/v20200910/ImageMaskAsyncGetResult.md +21 -0
  12. tccli/examples/tcss/v20201101/DescribeAssetSuperNodeList.md +41 -0
  13. tccli/examples/tcss/v20201101/DescribeClusterNodes.md +42 -0
  14. tccli/examples/tcss/v20201101/DescribeSuperNodePodList.md +41 -0
  15. tccli/examples/tcss/v20201101/DescribeUserPodList.md +56 -0
  16. tccli/examples/tms/v20201229/ModerateText.md +80 -0
  17. tccli/examples/vod/v20180717/PullEvents.md +2 -1
  18. tccli/services/aa/aa_client.py +2 -1
  19. tccli/services/aai/aai_client.py +5 -4
  20. tccli/services/acp/acp_client.py +9 -8
  21. tccli/services/advisor/advisor_client.py +3 -2
  22. tccli/services/af/af_client.py +4 -3
  23. tccli/services/afc/afc_client.py +4 -3
  24. tccli/services/aiart/aiart_client.py +3 -2
  25. tccli/services/aiart/v20221229/api.json +3 -3
  26. tccli/services/ame/ame_client.py +32 -31
  27. tccli/services/ams/ams_client.py +10 -9
  28. tccli/services/anicloud/anicloud_client.py +4 -3
  29. tccli/services/antiddos/antiddos_client.py +96 -95
  30. tccli/services/apcas/apcas_client.py +8 -7
  31. tccli/services/ape/ape_client.py +9 -8
  32. tccli/services/api/api_client.py +4 -3
  33. tccli/services/apigateway/apigateway_client.py +97 -96
  34. tccli/services/apm/apm_client.py +10 -9
  35. tccli/services/asr/asr_client.py +26 -25
  36. tccli/services/asw/asw_client.py +10 -9
  37. tccli/services/autoscaling/autoscaling_client.py +58 -57
  38. tccli/services/ba/ba_client.py +4 -3
  39. tccli/services/batch/batch_client.py +32 -31
  40. tccli/services/batch/v20170312/api.json +3 -3
  41. tccli/services/bda/bda_client.py +19 -18
  42. tccli/services/bi/bi_client.py +23 -22
  43. tccli/services/billing/billing_client.py +33 -32
  44. tccli/services/bizlive/bizlive_client.py +7 -6
  45. tccli/services/bm/bm_client.py +54 -53
  46. tccli/services/bma/bma_client.py +38 -37
  47. tccli/services/bmeip/bmeip_client.py +21 -20
  48. tccli/services/bmlb/bmlb_client.py +50 -49
  49. tccli/services/bmvpc/bmvpc_client.py +62 -61
  50. tccli/services/bpaas/bpaas_client.py +3 -2
  51. tccli/services/bri/bri_client.py +2 -1
  52. tccli/services/bsca/bsca_client.py +8 -7
  53. tccli/services/btoe/btoe_client.py +15 -14
  54. tccli/services/cam/cam_client.py +88 -87
  55. tccli/services/captcha/captcha_client.py +19 -18
  56. tccli/services/car/car_client.py +7 -6
  57. tccli/services/cat/cat_client.py +13 -12
  58. tccli/services/cbs/cbs_client.py +42 -41
  59. tccli/services/ccc/ccc_client.py +42 -41
  60. tccli/services/cdb/cdb_client.py +159 -158
  61. tccli/services/cdb/v20170320/api.json +1 -1
  62. tccli/services/cdc/cdc_client.py +21 -20
  63. tccli/services/cdc/v20201214/api.json +113 -27
  64. tccli/services/cdc/v20201214/examples.json +2 -2
  65. tccli/services/cdn/cdn_client.py +82 -81
  66. tccli/services/cdn/v20180606/api.json +10 -1
  67. tccli/services/cds/cds_client.py +7 -6
  68. tccli/services/cdwch/cdwch_client.py +109 -55
  69. tccli/services/cdwch/v20200915/api.json +253 -3
  70. tccli/services/cdwch/v20200915/examples.json +10 -2
  71. tccli/services/cdwdoris/cdwdoris_client.py +18 -17
  72. tccli/services/cdwdoris/v20211228/api.json +1 -1
  73. tccli/services/cdwpg/cdwpg_client.py +9 -8
  74. tccli/services/cfg/cfg_client.py +13 -12
  75. tccli/services/cfs/cfs_client.py +44 -43
  76. tccli/services/cfw/cfw_client.py +112 -111
  77. tccli/services/chdfs/chdfs_client.py +30 -29
  78. tccli/services/ciam/ciam_client.py +24 -23
  79. tccli/services/cii/cii_client.py +14 -13
  80. tccli/services/cim/cim_client.py +2 -1
  81. tccli/services/cis/cis_client.py +8 -7
  82. tccli/services/ckafka/ckafka_client.py +82 -81
  83. tccli/services/clb/clb_client.py +86 -85
  84. tccli/services/cloudaudit/cloudaudit_client.py +20 -19
  85. tccli/services/cloudhsm/cloudhsm_client.py +15 -14
  86. tccli/services/cloudstudio/cloudstudio_client.py +10 -9
  87. tccli/services/cls/cls_client.py +90 -89
  88. tccli/services/cme/cme_client.py +51 -50
  89. tccli/services/cmq/cmq_client.py +18 -17
  90. tccli/services/cms/cms_client.py +7 -6
  91. tccli/services/config/config_client.py +4 -3
  92. tccli/services/cpdp/cpdp_client.py +220 -219
  93. tccli/services/cr/cr_client.py +29 -28
  94. tccli/services/csip/csip_client.py +35 -34
  95. tccli/services/csxg/csxg_client.py +6 -5
  96. tccli/services/cvm/cvm_client.py +95 -94
  97. tccli/services/cvm/v20170312/api.json +6 -4
  98. tccli/services/cwp/cwp_client.py +519 -518
  99. tccli/services/cwp/v20180228/api.json +17 -16
  100. tccli/services/cwp/v20180228/examples.json +5 -5
  101. tccli/services/cws/cws_client.py +20 -19
  102. tccli/services/cynosdb/cynosdb_client.py +131 -130
  103. tccli/services/dasb/dasb_client.py +56 -55
  104. tccli/services/dataintegration/dataintegration_client.py +2 -1
  105. tccli/services/dayu/dayu_client.py +113 -112
  106. tccli/services/dbbrain/dbbrain_client.py +62 -61
  107. tccli/services/dbdc/dbdc_client.py +7 -6
  108. tccli/services/dc/dc_client.py +22 -21
  109. tccli/services/dcdb/dcdb_client.py +74 -73
  110. tccli/services/dlc/dlc_client.py +124 -123
  111. tccli/services/dnspod/dnspod_client.py +73 -72
  112. tccli/services/domain/domain_client.py +34 -33
  113. tccli/services/drm/drm_client.py +12 -11
  114. tccli/services/ds/ds_client.py +13 -12
  115. tccli/services/dsgc/dsgc_client.py +149 -148
  116. tccli/services/dtf/dtf_client.py +2 -1
  117. tccli/services/dts/dts_client.py +69 -68
  118. tccli/services/dts/v20211206/api.json +1 -0
  119. tccli/services/eb/eb_client.py +33 -32
  120. tccli/services/ecc/ecc_client.py +5 -4
  121. tccli/services/ecdn/ecdn_client.py +17 -16
  122. tccli/services/ecm/ecm_client.py +140 -139
  123. tccli/services/eiam/eiam_client.py +43 -42
  124. tccli/services/eis/eis_client.py +9 -8
  125. tccli/services/emr/emr_client.py +36 -35
  126. tccli/services/es/es_client.py +43 -42
  127. tccli/services/ess/ess_client.py +72 -71
  128. tccli/services/ess/v20201111/api.json +2 -2
  129. tccli/services/essbasic/essbasic_client.py +123 -122
  130. tccli/services/essbasic/v20210526/api.json +11 -11
  131. tccli/services/facefusion/facefusion_client.py +5 -4
  132. tccli/services/faceid/faceid_client.py +36 -35
  133. tccli/services/fmu/fmu_client.py +11 -10
  134. tccli/services/ft/ft_client.py +7 -6
  135. tccli/services/gaap/gaap_client.py +104 -103
  136. tccli/services/gme/gme_client.py +29 -28
  137. tccli/services/goosefs/goosefs_client.py +21 -20
  138. tccli/services/gpm/gpm_client.py +19 -18
  139. tccli/services/gs/gs_client.py +9 -8
  140. tccli/services/gse/gse_client.py +75 -74
  141. tccli/services/habo/habo_client.py +3 -2
  142. tccli/services/hai/hai_client.py +12 -11
  143. tccli/services/hai/v20230812/api.json +59 -1
  144. tccli/services/hai/v20230812/examples.json +1 -1
  145. tccli/services/hasim/hasim_client.py +23 -22
  146. tccli/services/hcm/hcm_client.py +2 -1
  147. tccli/services/hunyuan/hunyuan_client.py +4 -3
  148. tccli/services/iai/iai_client.py +36 -35
  149. tccli/services/ic/ic_client.py +10 -9
  150. tccli/services/icr/icr_client.py +2 -1
  151. tccli/services/ie/ie_client.py +11 -10
  152. tccli/services/iecp/iecp_client.py +103 -102
  153. tccli/services/iir/iir_client.py +2 -1
  154. tccli/services/ims/ims_client.py +3 -2
  155. tccli/services/ioa/ioa_client.py +2 -1
  156. tccli/services/iot/iot_client.py +46 -45
  157. tccli/services/iotcloud/iotcloud_client.py +86 -85
  158. tccli/services/iotexplorer/iotexplorer_client.py +93 -92
  159. tccli/services/iottid/iottid_client.py +10 -9
  160. tccli/services/iotvideo/iotvideo_client.py +158 -157
  161. tccli/services/iotvideoindustry/iotvideoindustry_client.py +105 -104
  162. tccli/services/irp/irp_client.py +12 -11
  163. tccli/services/iss/iss_client.py +83 -82
  164. tccli/services/ivld/ivld_client.py +26 -25
  165. tccli/services/keewidb/keewidb_client.py +39 -38
  166. tccli/services/kms/kms_client.py +54 -53
  167. tccli/services/lcic/lcic_client.py +61 -60
  168. tccli/services/lighthouse/lighthouse_client.py +108 -107
  169. tccli/services/lighthouse/v20200324/api.json +1 -1
  170. tccli/services/live/live_client.py +154 -153
  171. tccli/services/lowcode/lowcode_client.py +2 -1
  172. tccli/services/lp/lp_client.py +2 -1
  173. tccli/services/mall/mall_client.py +2 -1
  174. tccli/services/mariadb/mariadb_client.py +73 -72
  175. tccli/services/market/market_client.py +3 -2
  176. tccli/services/memcached/memcached_client.py +2 -1
  177. tccli/services/mgobe/mgobe_client.py +8 -7
  178. tccli/services/mmps/mmps_client.py +16 -15
  179. tccli/services/mna/mna_client.py +24 -23
  180. tccli/services/mongodb/mongodb_client.py +43 -42
  181. tccli/services/monitor/monitor_client.py +151 -150
  182. tccli/services/mps/mps_client.py +101 -100
  183. tccli/services/mrs/mrs_client.py +115 -8
  184. tccli/services/mrs/v20200910/api.json +97 -0
  185. tccli/services/mrs/v20200910/examples.json +16 -0
  186. tccli/services/ms/ms_client.py +24 -23
  187. tccli/services/msp/msp_client.py +8 -7
  188. tccli/services/mvj/mvj_client.py +2 -1
  189. tccli/services/nlp/nlp_client.py +13 -12
  190. tccli/services/npp/npp_client.py +9 -8
  191. tccli/services/oceanus/oceanus_client.py +39 -38
  192. tccli/services/oceanus/v20190422/api.json +39 -4
  193. tccli/services/ocr/ocr_client.py +82 -81
  194. tccli/services/omics/omics_client.py +16 -15
  195. tccli/services/organization/organization_client.py +48 -47
  196. tccli/services/partners/partners_client.py +20 -19
  197. tccli/services/pds/pds_client.py +3 -2
  198. tccli/services/postgres/postgres_client.py +91 -90
  199. tccli/services/privatedns/privatedns_client.py +26 -25
  200. tccli/services/pts/pts_client.py +45 -44
  201. tccli/services/rce/rce_client.py +4 -3
  202. tccli/services/redis/redis_client.py +96 -95
  203. tccli/services/region/region_client.py +4 -3
  204. tccli/services/rkp/rkp_client.py +4 -3
  205. tccli/services/rp/rp_client.py +2 -1
  206. tccli/services/rum/rum_client.py +66 -65
  207. tccli/services/scf/scf_client.py +47 -46
  208. tccli/services/ses/ses_client.py +28 -27
  209. tccli/services/smh/smh_client.py +11 -10
  210. tccli/services/smop/smop_client.py +2 -1
  211. tccli/services/smpn/smpn_client.py +6 -5
  212. tccli/services/sms/sms_client.py +19 -18
  213. tccli/services/soe/soe_client.py +5 -4
  214. tccli/services/solar/solar_client.py +18 -17
  215. tccli/services/sqlserver/sqlserver_client.py +145 -144
  216. tccli/services/ssa/ssa_client.py +24 -23
  217. tccli/services/ssl/ssl_client.py +58 -57
  218. tccli/services/sslpod/sslpod_client.py +11 -10
  219. tccli/services/ssm/ssm_client.py +25 -24
  220. tccli/services/sts/sts_client.py +7 -6
  221. tccli/services/taf/taf_client.py +4 -3
  222. tccli/services/tag/tag_client.py +32 -31
  223. tccli/services/tan/tan_client.py +2 -1
  224. tccli/services/tat/tat_client.py +29 -28
  225. tccli/services/tav/tav_client.py +5 -4
  226. tccli/services/tbaas/tbaas_client.py +26 -25
  227. tccli/services/tbm/tbm_client.py +10 -9
  228. tccli/services/tbp/tbp_client.py +5 -4
  229. tccli/services/tcaplusdb/tcaplusdb_client.py +54 -53
  230. tccli/services/tcb/tcb_client.py +90 -89
  231. tccli/services/tcbr/tcbr_client.py +11 -10
  232. tccli/services/tcex/tcex_client.py +3 -2
  233. tccli/services/tchd/tchd_client.py +2 -1
  234. tccli/services/tci/tci_client.py +42 -41
  235. tccli/services/tcm/tcm_client.py +13 -12
  236. tccli/services/tcr/tcr_client.py +110 -109
  237. tccli/services/tcss/tcss_client.py +558 -345
  238. tccli/services/tcss/v20201101/api.json +1200 -0
  239. tccli/services/tcss/v20201101/examples.json +32 -0
  240. tccli/services/tdcpg/tdcpg_client.py +26 -25
  241. tccli/services/tdid/tdid_client.py +14 -13
  242. tccli/services/tdmq/tdmq_client.py +128 -127
  243. tccli/services/tds/tds_client.py +5 -4
  244. tccli/services/tem/tem_client.py +61 -60
  245. tccli/services/teo/teo_client.py +79 -78
  246. tccli/services/thpc/thpc_client.py +19 -18
  247. tccli/services/tia/tia_client.py +11 -10
  248. tccli/services/tic/tic_client.py +14 -13
  249. tccli/services/ticm/ticm_client.py +4 -3
  250. tccli/services/tics/tics_client.py +5 -4
  251. tccli/services/tiems/tiems_client.py +26 -25
  252. tccli/services/tiia/tiia_client.py +24 -23
  253. tccli/services/tione/tione_client.py +98 -97
  254. tccli/services/tiw/tiw_client.py +61 -60
  255. tccli/services/tke/tke_client.py +219 -218
  256. tccli/services/tkgdq/tkgdq_client.py +4 -3
  257. tccli/services/tms/tms_client.py +62 -8
  258. tccli/services/tms/v20201229/api.json +371 -17
  259. tccli/services/tms/v20201229/examples.json +8 -0
  260. tccli/services/tmt/tmt_client.py +8 -7
  261. tccli/services/tourism/tourism_client.py +2 -1
  262. tccli/services/trdp/trdp_client.py +2 -1
  263. tccli/services/trocket/trocket_client.py +23 -22
  264. tccli/services/trp/trp_client.py +54 -53
  265. tccli/services/trro/trro_client.py +24 -23
  266. tccli/services/trtc/trtc_client.py +44 -43
  267. tccli/services/tse/tse_client.py +66 -65
  268. tccli/services/tsf/tsf_client.py +220 -219
  269. tccli/services/tsw/tsw_client.py +5 -4
  270. tccli/services/tts/tts_client.py +4 -3
  271. tccli/services/ump/ump_client.py +18 -17
  272. tccli/services/vm/vm_client.py +7 -6
  273. tccli/services/vms/vms_client.py +3 -2
  274. tccli/services/vod/v20180717/api.json +10 -10
  275. tccli/services/vod/v20180717/examples.json +1 -1
  276. tccli/services/vod/vod_client.py +169 -168
  277. tccli/services/vpc/vpc_client.py +317 -316
  278. tccli/services/vrs/vrs_client.py +8 -7
  279. tccli/services/waf/waf_client.py +133 -132
  280. tccli/services/wav/wav_client.py +27 -26
  281. tccli/services/wedata/wedata_client.py +319 -318
  282. tccli/services/weilingwith/weilingwith_client.py +58 -57
  283. tccli/services/wss/wss_client.py +4 -3
  284. tccli/services/yinsuda/yinsuda_client.py +21 -20
  285. tccli/services/youmall/youmall_client.py +32 -31
  286. tccli/services/yunjing/yunjing_client.py +101 -100
  287. tccli/services/yunsou/yunsou_client.py +3 -2
  288. {tccli-3.0.1035.1.dist-info → tccli-3.0.1037.1.dist-info}/METADATA +2 -2
  289. {tccli-3.0.1035.1.dist-info → tccli-3.0.1037.1.dist-info}/RECORD +292 -284
  290. {tccli-3.0.1035.1.dist-info → tccli-3.0.1037.1.dist-info}/WHEEL +0 -0
  291. {tccli-3.0.1035.1.dist-info → tccli-3.0.1037.1.dist-info}/entry_points.txt +0 -0
  292. {tccli-3.0.1035.1.dist-info → tccli-3.0.1037.1.dist-info}/license_files/LICENSE +0 -0
@@ -25,7 +25,7 @@ def doImageToClass(args, parsed_globals):
25
25
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
26
26
  cred = credential.STSAssumeRoleCredential(
27
27
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
28
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
28
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
29
29
  )
30
30
  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):
31
31
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -77,7 +77,7 @@ def doTurnPDFToObjectAsyncGetResult(args, parsed_globals):
77
77
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
78
78
  cred = credential.STSAssumeRoleCredential(
79
79
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
80
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
80
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
81
81
  )
82
82
  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):
83
83
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -129,7 +129,7 @@ def doTextToObject(args, parsed_globals):
129
129
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
130
130
  cred = credential.STSAssumeRoleCredential(
131
131
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
132
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
132
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
133
133
  )
134
134
  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):
135
135
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -181,7 +181,7 @@ def doImageMask(args, parsed_globals):
181
181
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
182
182
  cred = credential.STSAssumeRoleCredential(
183
183
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
184
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
184
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
185
185
  )
186
186
  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):
187
187
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -233,7 +233,7 @@ def doImageToObject(args, parsed_globals):
233
233
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
234
234
  cred = credential.STSAssumeRoleCredential(
235
235
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
236
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
236
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
237
237
  )
238
238
  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):
239
239
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -285,7 +285,7 @@ def doTurnPDFToObjectAsync(args, parsed_globals):
285
285
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
286
286
  cred = credential.STSAssumeRoleCredential(
287
287
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
288
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
288
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
289
289
  )
290
290
  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):
291
291
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -329,6 +329,110 @@ def doTurnPDFToObjectAsync(args, parsed_globals):
329
329
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
330
330
 
331
331
 
332
+ def doImageMaskAsync(args, parsed_globals):
333
+ g_param = parse_global_arg(parsed_globals)
334
+
335
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
336
+ cred = credential.CVMRoleCredential()
337
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
338
+ cred = credential.STSAssumeRoleCredential(
339
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
340
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
341
+ )
342
+ 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):
343
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
344
+ else:
345
+ cred = credential.Credential(
346
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
347
+ )
348
+ http_profile = HttpProfile(
349
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
350
+ reqMethod="POST",
351
+ endpoint=g_param[OptionsDefine.Endpoint],
352
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
353
+ )
354
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
355
+ if g_param[OptionsDefine.Language]:
356
+ profile.language = g_param[OptionsDefine.Language]
357
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
358
+ client = mod.MrsClient(cred, g_param[OptionsDefine.Region], profile)
359
+ client._sdkVersion += ("_CLI_" + __version__)
360
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
361
+ model = models.ImageMaskAsyncRequest()
362
+ model.from_json_string(json.dumps(args))
363
+ start_time = time.time()
364
+ while True:
365
+ rsp = client.ImageMaskAsync(model)
366
+ result = rsp.to_json_string()
367
+ try:
368
+ json_obj = json.loads(result)
369
+ except TypeError as e:
370
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
371
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
372
+ break
373
+ cur_time = time.time()
374
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
375
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
376
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
377
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
378
+ else:
379
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
380
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
381
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
382
+
383
+
384
+ def doImageMaskAsyncGetResult(args, parsed_globals):
385
+ g_param = parse_global_arg(parsed_globals)
386
+
387
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
388
+ cred = credential.CVMRoleCredential()
389
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
390
+ cred = credential.STSAssumeRoleCredential(
391
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
392
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
393
+ )
394
+ 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):
395
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
396
+ else:
397
+ cred = credential.Credential(
398
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
399
+ )
400
+ http_profile = HttpProfile(
401
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
402
+ reqMethod="POST",
403
+ endpoint=g_param[OptionsDefine.Endpoint],
404
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
405
+ )
406
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
407
+ if g_param[OptionsDefine.Language]:
408
+ profile.language = g_param[OptionsDefine.Language]
409
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
410
+ client = mod.MrsClient(cred, g_param[OptionsDefine.Region], profile)
411
+ client._sdkVersion += ("_CLI_" + __version__)
412
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
413
+ model = models.ImageMaskAsyncGetResultRequest()
414
+ model.from_json_string(json.dumps(args))
415
+ start_time = time.time()
416
+ while True:
417
+ rsp = client.ImageMaskAsyncGetResult(model)
418
+ result = rsp.to_json_string()
419
+ try:
420
+ json_obj = json.loads(result)
421
+ except TypeError as e:
422
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
423
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
424
+ break
425
+ cur_time = time.time()
426
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
427
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
428
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
429
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
430
+ else:
431
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
432
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
433
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
434
+
435
+
332
436
  def doTurnPDFToObject(args, parsed_globals):
333
437
  g_param = parse_global_arg(parsed_globals)
334
438
 
@@ -337,7 +441,7 @@ def doTurnPDFToObject(args, parsed_globals):
337
441
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
338
442
  cred = credential.STSAssumeRoleCredential(
339
443
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
340
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
444
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
341
445
  )
342
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):
343
447
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -389,7 +493,7 @@ def doTextToClass(args, parsed_globals):
389
493
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
390
494
  cred = credential.STSAssumeRoleCredential(
391
495
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
392
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
496
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
393
497
  )
394
498
  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):
395
499
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -450,6 +554,8 @@ ACTION_MAP = {
450
554
  "ImageMask": doImageMask,
451
555
  "ImageToObject": doImageToObject,
452
556
  "TurnPDFToObjectAsync": doTurnPDFToObjectAsync,
557
+ "ImageMaskAsync": doImageMaskAsync,
558
+ "ImageMaskAsyncGetResult": doImageMaskAsyncGetResult,
453
559
  "TurnPDFToObject": doTurnPDFToObject,
454
560
  "TextToClass": doTextToClass,
455
561
 
@@ -532,6 +638,7 @@ def parse_global_arg(parsed_globals):
532
638
 
533
639
  if g_param[OptionsDefine.Endpoint] is None:
534
640
  g_param[OptionsDefine.Endpoint] = conf["mrs"][OptionsDefine.Endpoint]
641
+ g_param["sts_cred_endpoint"] = conf.get("sts", {}).get("endpoint")
535
642
  except Exception as err:
536
643
  raise ConfigurationError("config file:%s error, %s" % (conf_path, str(err)))
537
644
 
@@ -7,6 +7,20 @@
7
7
  "output": "ImageMaskResponse",
8
8
  "status": "online"
9
9
  },
10
+ "ImageMaskAsync": {
11
+ "document": "图片脱敏-异步接口",
12
+ "input": "ImageMaskAsyncRequest",
13
+ "name": "图片脱敏-异步接口",
14
+ "output": "ImageMaskAsyncResponse",
15
+ "status": "online"
16
+ },
17
+ "ImageMaskAsyncGetResult": {
18
+ "document": "图片脱敏-异步获取结果接口",
19
+ "input": "ImageMaskAsyncGetResultRequest",
20
+ "name": "图片脱敏-异步获取结果接口",
21
+ "output": "ImageMaskAsyncGetResultResponse",
22
+ "status": "online"
23
+ },
10
24
  "ImageToClass": {
11
25
  "document": "图片分类",
12
26
  "input": "ImageToClassRequest",
@@ -4888,6 +4902,89 @@
4888
4902
  ],
4889
4903
  "usage": "in"
4890
4904
  },
4905
+ "ImageMaskAsyncGetResultRequest": {
4906
+ "document": "ImageMaskAsyncGetResult请求参数结构体",
4907
+ "members": [
4908
+ {
4909
+ "disabled": false,
4910
+ "document": "异步任务ID",
4911
+ "example": "无",
4912
+ "member": "string",
4913
+ "name": "TaskID",
4914
+ "required": true,
4915
+ "type": "string"
4916
+ }
4917
+ ],
4918
+ "type": "object"
4919
+ },
4920
+ "ImageMaskAsyncGetResultResponse": {
4921
+ "document": "ImageMaskAsyncGetResult返回参数结构体",
4922
+ "members": [
4923
+ {
4924
+ "disabled": false,
4925
+ "document": "脱敏后图片的base64编码",
4926
+ "example": "无",
4927
+ "member": "string",
4928
+ "name": "MaskedImage",
4929
+ "output_required": false,
4930
+ "type": "string",
4931
+ "value_allowed_null": false
4932
+ },
4933
+ {
4934
+ "document": "唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。",
4935
+ "member": "string",
4936
+ "name": "RequestId",
4937
+ "type": "string"
4938
+ }
4939
+ ],
4940
+ "type": "object"
4941
+ },
4942
+ "ImageMaskAsyncRequest": {
4943
+ "document": "ImageMaskAsync请求参数结构体",
4944
+ "members": [
4945
+ {
4946
+ "disabled": false,
4947
+ "document": "图片信息,目前只支持传图片base64",
4948
+ "example": "无",
4949
+ "member": "ImageInfo",
4950
+ "name": "Image",
4951
+ "required": true,
4952
+ "type": "object"
4953
+ },
4954
+ {
4955
+ "disabled": false,
4956
+ "document": "图片脱敏选项, 不传默认都脱敏",
4957
+ "example": "无",
4958
+ "member": "ImageMaskFlags",
4959
+ "name": "MaskFlag",
4960
+ "required": false,
4961
+ "type": "object"
4962
+ }
4963
+ ],
4964
+ "type": "object"
4965
+ },
4966
+ "ImageMaskAsyncResponse": {
4967
+ "document": "ImageMaskAsync返回参数结构体",
4968
+ "members": [
4969
+ {
4970
+ "disabled": false,
4971
+ "document": "加密任务ID",
4972
+ "example": "无",
4973
+ "member": "string",
4974
+ "name": "TaskID",
4975
+ "output_required": false,
4976
+ "type": "string",
4977
+ "value_allowed_null": false
4978
+ },
4979
+ {
4980
+ "document": "唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。",
4981
+ "member": "string",
4982
+ "name": "RequestId",
4983
+ "type": "string"
4984
+ }
4985
+ ],
4986
+ "type": "object"
4987
+ },
4891
4988
  "ImageMaskFlags": {
4892
4989
  "document": "图片脱敏选项\n不填默认敏感信息都脱敏",
4893
4990
  "members": [
@@ -8,6 +8,22 @@
8
8
  "title": "医疗报告图片脱敏接口示例"
9
9
  }
10
10
  ],
11
+ "ImageMaskAsync": [
12
+ {
13
+ "document": "",
14
+ "input": "POST / HTTP/1.1\nHost: mrs.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ImageMaskAsync\n<公共请求参数>\n\n{\n \"Image\": {\n \"Base64\": \"abc\"\n },\n \"MaskFlag\": {\n \"HospitalFlag\": true,\n \"DoctorFlag\": true,\n \"PatientFlag\": true,\n \"BarFlag\": true\n }\n}",
15
+ "output": "{\n \"Response\": {\n \"TaskID\": \"abc\",\n \"RequestId\": \"abc\"\n }\n}",
16
+ "title": "医疗报告图片脱敏异步接口示例"
17
+ }
18
+ ],
19
+ "ImageMaskAsyncGetResult": [
20
+ {
21
+ "document": "",
22
+ "input": "POST / HTTP/1.1\nHost: mrs.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ImageMaskAsyncGetResult\n<公共请求参数>\n\n{\n \"TaskID\": \"taskid\"\n}",
23
+ "output": "{\n \"Response\": {\n \"MaskedImage\": \"abc\",\n \"RequestId\": \"abc\"\n }\n}",
24
+ "title": "图片脱敏异步获取结果接口示例"
25
+ }
26
+ ],
11
27
  "ImageToClass": [
12
28
  {
13
29
  "document": "输入一张图片,得到报告分类信息",
@@ -25,7 +25,7 @@ def doCreateCosSecKeyInstance(args, parsed_globals):
25
25
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
26
26
  cred = credential.STSAssumeRoleCredential(
27
27
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
28
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
28
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
29
29
  )
30
30
  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):
31
31
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -77,7 +77,7 @@ def doDescribeResourceInstances(args, parsed_globals):
77
77
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
78
78
  cred = credential.STSAssumeRoleCredential(
79
79
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
80
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
80
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
81
81
  )
82
82
  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):
83
83
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -129,7 +129,7 @@ def doDescribeShieldPlanInstance(args, parsed_globals):
129
129
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
130
130
  cred = credential.STSAssumeRoleCredential(
131
131
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
132
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
132
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
133
133
  )
134
134
  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):
135
135
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -181,7 +181,7 @@ def doDescribeShieldInstances(args, parsed_globals):
181
181
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
182
182
  cred = credential.STSAssumeRoleCredential(
183
183
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
184
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
184
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
185
185
  )
186
186
  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):
187
187
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -233,7 +233,7 @@ def doDescribeUrlDetectionResult(args, parsed_globals):
233
233
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
234
234
  cred = credential.STSAssumeRoleCredential(
235
235
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
236
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
236
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
237
237
  )
238
238
  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):
239
239
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -285,7 +285,7 @@ def doCreateEncryptInstance(args, parsed_globals):
285
285
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
286
286
  cred = credential.STSAssumeRoleCredential(
287
287
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
288
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
288
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
289
289
  )
290
290
  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):
291
291
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -337,7 +337,7 @@ def doDescribeEncryptPlan(args, parsed_globals):
337
337
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
338
338
  cred = credential.STSAssumeRoleCredential(
339
339
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
340
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
340
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
341
341
  )
342
342
  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):
343
343
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -389,7 +389,7 @@ def doDescribeOrderInstances(args, parsed_globals):
389
389
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
390
390
  cred = credential.STSAssumeRoleCredential(
391
391
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
392
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
392
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
393
393
  )
394
394
  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):
395
395
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -441,7 +441,7 @@ def doUpdateLocalTaskResult(args, parsed_globals):
441
441
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
442
442
  cred = credential.STSAssumeRoleCredential(
443
443
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
444
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
444
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
445
445
  )
446
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
447
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -493,7 +493,7 @@ def doCreateShieldPlanInstance(args, parsed_globals):
493
493
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
494
494
  cred = credential.STSAssumeRoleCredential(
495
495
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
496
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
496
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
497
497
  )
498
498
  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):
499
499
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -545,7 +545,7 @@ def doCreateResourceInstances(args, parsed_globals):
545
545
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
546
546
  cred = credential.STSAssumeRoleCredential(
547
547
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
548
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
548
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
549
549
  )
550
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
551
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -597,7 +597,7 @@ def doCreateBindInstance(args, parsed_globals):
597
597
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
598
598
  cred = credential.STSAssumeRoleCredential(
599
599
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
600
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
600
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
601
601
  )
602
602
  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):
603
603
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -649,7 +649,7 @@ def doCreateShieldInstance(args, parsed_globals):
649
649
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
650
650
  cred = credential.STSAssumeRoleCredential(
651
651
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
652
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
652
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
653
653
  )
654
654
  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):
655
655
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -701,7 +701,7 @@ def doDeleteShieldInstances(args, parsed_globals):
701
701
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
702
702
  cred = credential.STSAssumeRoleCredential(
703
703
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
704
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
704
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
705
705
  )
706
706
  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):
707
707
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -753,7 +753,7 @@ def doDescribeShieldResult(args, parsed_globals):
753
753
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
754
754
  cred = credential.STSAssumeRoleCredential(
755
755
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
756
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
756
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
757
757
  )
758
758
  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):
759
759
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -805,7 +805,7 @@ def doUpdateClientState(args, parsed_globals):
805
805
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
806
806
  cred = credential.STSAssumeRoleCredential(
807
807
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
808
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
808
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
809
809
  )
810
810
  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):
811
811
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -857,7 +857,7 @@ def doDestroyResourceInstances(args, parsed_globals):
857
857
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
858
858
  cred = credential.STSAssumeRoleCredential(
859
859
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
860
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
860
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
861
861
  )
862
862
  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):
863
863
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -909,7 +909,7 @@ def doRequestLocalTask(args, parsed_globals):
909
909
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
910
910
  cred = credential.STSAssumeRoleCredential(
911
911
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
912
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
912
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
913
913
  )
914
914
  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):
915
915
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -961,7 +961,7 @@ def doCancelEncryptTask(args, parsed_globals):
961
961
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
962
962
  cred = credential.STSAssumeRoleCredential(
963
963
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
964
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
964
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
965
965
  )
966
966
  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):
967
967
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -1013,7 +1013,7 @@ def doDescribeUserBaseInfoInstance(args, parsed_globals):
1013
1013
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1014
1014
  cred = credential.STSAssumeRoleCredential(
1015
1015
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1016
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
1016
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1017
1017
  )
1018
1018
  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):
1019
1019
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -1065,7 +1065,7 @@ def doDescribeApkDetectionResult(args, parsed_globals):
1065
1065
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1066
1066
  cred = credential.STSAssumeRoleCredential(
1067
1067
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1068
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
1068
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1069
1069
  )
1070
1070
  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):
1071
1071
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -1117,7 +1117,7 @@ def doDescribeEncryptInstances(args, parsed_globals):
1117
1117
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1118
1118
  cred = credential.STSAssumeRoleCredential(
1119
1119
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1120
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
1120
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1121
1121
  )
1122
1122
  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):
1123
1123
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -1169,7 +1169,7 @@ def doCreateOrderInstance(args, parsed_globals):
1169
1169
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1170
1170
  cred = credential.STSAssumeRoleCredential(
1171
1171
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1172
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
1172
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1173
1173
  )
1174
1174
  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):
1175
1175
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -1327,6 +1327,7 @@ def parse_global_arg(parsed_globals):
1327
1327
 
1328
1328
  if g_param[OptionsDefine.Endpoint] is None:
1329
1329
  g_param[OptionsDefine.Endpoint] = conf["ms"][OptionsDefine.Endpoint]
1330
+ g_param["sts_cred_endpoint"] = conf.get("sts", {}).get("endpoint")
1330
1331
  except Exception as err:
1331
1332
  raise ConfigurationError("config file:%s error, %s" % (conf_path, str(err)))
1332
1333
 
@@ -25,7 +25,7 @@ def doListMigrationTask(args, parsed_globals):
25
25
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
26
26
  cred = credential.STSAssumeRoleCredential(
27
27
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
28
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
28
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
29
29
  )
30
30
  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):
31
31
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -77,7 +77,7 @@ def doRegisterMigrationTask(args, parsed_globals):
77
77
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
78
78
  cred = credential.STSAssumeRoleCredential(
79
79
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
80
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
80
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
81
81
  )
82
82
  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):
83
83
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -129,7 +129,7 @@ def doModifyMigrationTaskStatus(args, parsed_globals):
129
129
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
130
130
  cred = credential.STSAssumeRoleCredential(
131
131
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
132
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
132
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
133
133
  )
134
134
  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):
135
135
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -181,7 +181,7 @@ def doDeregisterMigrationTask(args, parsed_globals):
181
181
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
182
182
  cred = credential.STSAssumeRoleCredential(
183
183
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
184
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
184
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
185
185
  )
186
186
  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):
187
187
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -233,7 +233,7 @@ def doDescribeMigrationTask(args, parsed_globals):
233
233
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
234
234
  cred = credential.STSAssumeRoleCredential(
235
235
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
236
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
236
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
237
237
  )
238
238
  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):
239
239
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -285,7 +285,7 @@ def doModifyMigrationTaskBelongToProject(args, parsed_globals):
285
285
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
286
286
  cred = credential.STSAssumeRoleCredential(
287
287
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
288
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
288
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
289
289
  )
290
290
  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):
291
291
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -337,7 +337,7 @@ def doListMigrationProject(args, parsed_globals):
337
337
  elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
338
338
  cred = credential.STSAssumeRoleCredential(
339
339
  g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
340
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
340
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
341
341
  )
342
342
  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):
343
343
  cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
@@ -479,6 +479,7 @@ def parse_global_arg(parsed_globals):
479
479
 
480
480
  if g_param[OptionsDefine.Endpoint] is None:
481
481
  g_param[OptionsDefine.Endpoint] = conf["msp"][OptionsDefine.Endpoint]
482
+ g_param["sts_cred_endpoint"] = conf.get("sts", {}).get("endpoint")
482
483
  except Exception as err:
483
484
  raise ConfigurationError("config file:%s error, %s" % (conf_path, str(err)))
484
485