tccli 3.0.1349.1__py2.py3-none-any.whl → 3.0.1351.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 (46) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/services/aiart/v20221229/api.json +1 -1
  3. tccli/services/apm/v20210622/api.json +7 -9
  4. tccli/services/batch/v20170312/api.json +2 -2
  5. tccli/services/cdn/v20180606/api.json +1 -1
  6. tccli/services/cdwch/v20200915/api.json +18 -8
  7. tccli/services/cdwch/v20200915/examples.json +2 -2
  8. tccli/services/ckafka/ckafka_client.py +0 -53
  9. tccli/services/ckafka/v20190819/api.json +0 -215
  10. tccli/services/ckafka/v20190819/examples.json +0 -8
  11. tccli/services/csip/v20221121/examples.json +15 -21
  12. tccli/services/ctem/ctem_client.py +159 -0
  13. tccli/services/ctem/v20231128/api.json +673 -89
  14. tccli/services/ctem/v20231128/examples.json +24 -0
  15. tccli/services/cvm/v20170312/api.json +2 -2
  16. tccli/services/dts/v20211206/api.json +21 -1
  17. tccli/services/emr/v20190103/api.json +2 -2
  18. tccli/services/faceid/v20180301/api.json +3 -3
  19. tccli/services/gme/v20180711/api.json +40 -0
  20. tccli/services/kms/v20190118/api.json +188 -0
  21. tccli/services/live/live_client.py +224 -65
  22. tccli/services/live/v20180801/api.json +72 -0
  23. tccli/services/live/v20180801/examples.json +24 -0
  24. tccli/services/lke/lke_client.py +12 -436
  25. tccli/services/lke/v20231130/api.json +25 -1065
  26. tccli/services/lke/v20231130/examples.json +0 -64
  27. tccli/services/monitor/monitor_client.py +53 -0
  28. tccli/services/monitor/v20180724/examples.json +2 -2
  29. tccli/services/monitor/v20230616/api.json +58 -195
  30. tccli/services/monitor/v20230616/examples.json +4 -10
  31. tccli/services/mps/v20190612/api.json +6 -6
  32. tccli/services/omics/v20221128/api.json +3 -3
  33. tccli/services/redis/v20180412/api.json +24 -5
  34. tccli/services/redis/v20180412/examples.json +1 -1
  35. tccli/services/scf/v20180416/api.json +3 -0
  36. tccli/services/ssl/v20191205/api.json +31 -1
  37. tccli/services/tke/v20180525/api.json +2 -2
  38. tccli/services/tse/tse_client.py +80 -27
  39. tccli/services/tse/v20201207/api.json +193 -0
  40. tccli/services/tse/v20201207/examples.json +8 -0
  41. tccli/services/vclm/v20240523/api.json +2 -2
  42. {tccli-3.0.1349.1.dist-info → tccli-3.0.1351.1.dist-info}/METADATA +2 -2
  43. {tccli-3.0.1349.1.dist-info → tccli-3.0.1351.1.dist-info}/RECORD +46 -46
  44. {tccli-3.0.1349.1.dist-info → tccli-3.0.1351.1.dist-info}/WHEEL +0 -0
  45. {tccli-3.0.1349.1.dist-info → tccli-3.0.1351.1.dist-info}/entry_points.txt +0 -0
  46. {tccli-3.0.1349.1.dist-info → tccli-3.0.1351.1.dist-info}/license_files/LICENSE +0 -0
@@ -60,16 +60,16 @@
60
60
  {
61
61
  "document": "",
62
62
  "input": "POST / HTTP/1.1\nHost: csip.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeAbnormalCallRecord\n<公共请求参数>\n\n{\n \"AlarmRuleID\": 10007,\n \"Filter\": {\n \"Limit\": 1\n }\n}",
63
- "output": "{\n \"Response\": {\n \"Data\": [\n {\n \"AccessKey\": \"AKID6*******tZBU1Hi\",\n \"AccessKeyID\": 10093,\n \"AccessKeyRemark\": \"飞快的云镜-临时密钥\",\n \"AppID\": 1256299843,\n \"CallCount\": 50,\n \"CallID\": \"13\",\n \"Code\": 0,\n \"Date\": \"2025-02-26 00:00:00\",\n \"EventName\": \"ListAccessKeys\",\n \"EventType\": 1,\n \"FirstCallTime\": \"2025-02-26 23:37:59\",\n \"IPType\": 1,\n \"InstanceID\": \"\",\n \"InstanceName\": \"\",\n \"LastCallTime\": \"2025-02-26 23:39:46\",\n \"PolicySet\": [],\n \"ProductName\": \"cam\",\n \"Region\": \"\",\n \"SourceIP\": \"30.49.109.154\",\n \"SourceIPRemark\": \"\",\n \"UserName\": \"100024699394\",\n \"UserType\": \"AssumedRole\"\n }\n ],\n \"RequestId\": \"1a431738-b670-4c86-94c1-cae98e11af64\",\n \"Total\": 2\n }\n}",
64
- "title": "1"
63
+ "output": "{\n \"Response\": {\n \"Data\": [\n {\n \"AccessKey\": \"AKID*******\",\n \"AccessKeyID\": 10093,\n \"AccessKeyRemark\": \"临时密钥\",\n \"AppID\": 100001,\n \"CallCount\": 50,\n \"CallID\": \"13\",\n \"Code\": 0,\n \"Date\": \"2025-02-26 00:00:00\",\n \"EventName\": \"ListAccessKeys\",\n \"EventType\": 1,\n \"FirstCallTime\": \"2025-02-26 23:37:59\",\n \"IPType\": 1,\n \"InstanceID\": \"\",\n \"InstanceName\": \"\",\n \"LastCallTime\": \"2025-02-26 23:39:46\",\n \"PolicySet\": [],\n \"ProductName\": \"cam\",\n \"Region\": \"\",\n \"SourceIP\": \"30.49.109.***\",\n \"SourceIPRemark\": \"\",\n \"UserName\": \"1000246***\",\n \"UserType\": \"AssumedRole\"\n }\n ],\n \"RequestId\": \"1a431738-b670-4c86-94c1-cae98e11af64\",\n \"Total\": 2\n }\n}",
64
+ "title": "获取调用记录列表"
65
65
  }
66
66
  ],
67
67
  "DescribeAccessKeyAlarm": [
68
68
  {
69
69
  "document": "",
70
- "input": "POST / HTTP/1.1\nHost: csip.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeAccessKeyAlarm\n<公共请求参数>\n\n{\n \"Filter\": {\n \"Limit\": 1\n }\n}",
71
- "output": "{\n \"Response\": {\n \"Data\": [\n {\n \"AccessKey\": \"TEMP_AK\",\n \"AccessKeyID\": 10093,\n \"AccessKeyRemark\": \"飞快的云镜-临时密钥\",\n \"AlarmRuleID\": 94865,\n \"AlarmType\": 0,\n \"AppID\": 1256299843,\n \"Date\": \"2025-03-13\",\n \"ID\": 10185,\n \"LastAlarmTime\": \"2025-03-13 16:50:44\",\n \"Level\": 5,\n \"Name\": \"可疑IP调用高危接口\",\n \"Nickname\": \"飞快的云镜\",\n \"Status\": 0,\n \"SubNickname\": \"飞快的云镜\",\n \"SubUin\": \"100004506473\",\n \"Tag\": [],\n \"Type\": 2,\n \"Uin\": \"100004506473\"\n }\n ],\n \"RequestId\": \"1249df92-930b-4574-a517-45dc70580764\",\n \"Total\": 28\n }\n}",
72
- "title": "1"
70
+ "input": "POST / HTTP/1.1\nHost: csip.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeAccessKeyAlarm\n<公共请求参数>\n\n{}",
71
+ "output": "{\n \"Response\": {\n \"Data\": [\n {\n \"AccessKey\": \"TEMP_AK\",\n \"AccessKeyID\": 10093,\n \"AccessKeyRemark\": \"临时密钥\",\n \"AlarmRuleID\": 94865,\n \"AlarmType\": 0,\n \"AppID\": 1200001,\n \"Date\": \"2025-03-13\",\n \"ID\": 10185,\n \"LastAlarmTime\": \"2025-03-13 16:50:44\",\n \"Level\": 5,\n \"Name\": \"可疑IP调用高危接口\",\n \"Nickname\": \"name\",\n \"Status\": 0,\n \"SubNickname\": \"name\",\n \"SubUin\": \"10000**\",\n \"Tag\": [],\n \"Type\": 2,\n \"Uin\": \"10000**\"\n }\n ],\n \"RequestId\": \"1249df92-930b-4574-a517-45dc70580764\",\n \"Total\": 1\n }\n}",
72
+ "title": "访问密钥告警记录列表"
73
73
  }
74
74
  ],
75
75
  "DescribeAccessKeyAlarmDetail": [
@@ -114,16 +114,16 @@
114
114
  {
115
115
  "document": "",
116
116
  "input": "POST / HTTP/1.1\nHost: csip.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeAccessKeyUserDetail\n<公共请求参数>\n\n{\n \"SubUin\": \"1000***1**78\"\n}",
117
- "output": "{\n \"Response\": {\n \"RequestId\": \"85ffe508-b4a0-4125-b2b5-b78519c30d69\",\n \"User\": {\n \"AccessKeyAlarmList\": [],\n \"AccessKeyRiskList\": [\n {\n \"Count\": 6,\n \"Type\": 0\n }\n ],\n \"AccessType\": 1,\n \"ActionFlag\": 0,\n \"Advice\": 2,\n \"AppID\": 1300008,\n \"CheckStatus\": 0,\n \"ID\": 200637,\n \"ISP\": \"电信\",\n \"LoginFlag\": 0,\n \"LoginIP\": \"119.147.10.163\",\n \"LoginLocation\": \"中国-广东省-深圳市\",\n \"LoginTime\": \"2025-05-22 10:45:34\",\n \"Name\": \"cfw-test\",\n \"Nickname\": \"天空之蓝\",\n \"SubNickname\": \"cfw-test\",\n \"SubUin\": \"1000***1**78\",\n \"Type\": 1,\n \"Uin\": \"1000*****18\"\n }\n }\n}",
118
- "title": "1"
117
+ "output": "{\n \"Response\": {\n \"RequestId\": \"85ffe508-b4a0-4125-b2b5-b78519c30d69\",\n \"User\": {\n \"AccessKeyAlarmList\": [],\n \"AccessKeyRiskList\": [\n {\n \"Count\": 6,\n \"Type\": 0\n }\n ],\n \"AccessType\": 1,\n \"ActionFlag\": 0,\n \"Advice\": 2,\n \"AppID\": 1300008,\n \"CheckStatus\": 0,\n \"ID\": 200637,\n \"ISP\": \"电信\",\n \"LoginFlag\": 0,\n \"LoginIP\": \"119.147.10.***\",\n \"LoginLocation\": \"中国-广东省-深圳市\",\n \"LoginTime\": \"2025-05-22 10:45:34\",\n \"Name\": \"name\",\n \"Nickname\": \"name\",\n \"SubNickname\": \"name\",\n \"SubUin\": \"1000***1**78\",\n \"Type\": 1,\n \"Uin\": \"1000*****18\"\n }\n }\n}",
118
+ "title": "查询用户的账号详情"
119
119
  }
120
120
  ],
121
121
  "DescribeAccessKeyUserList": [
122
122
  {
123
123
  "document": "",
124
- "input": "POST / HTTP/1.1\nHost: csip.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeAccessKeyUserList\n<公共请求参数>\n\n{\n \"Filter\": {\n \"Limit\": 1\n }\n}",
125
- "output": "{\n \"Response\": {\n \"Data\": [\n {\n \"AccessKeyAlarmList\": [\n {\n \"Count\": 12,\n \"Type\": 0\n }\n ],\n \"AccessKeyRiskList\": [\n {\n \"Count\": 1,\n \"Type\": 0\n }\n ],\n \"AccessType\": 1,\n \"ActionFlag\": 0,\n \"Advice\": 1,\n \"AppID\": 13000008,\n \"CheckStatus\": 0,\n \"ID\": 200631,\n \"ISP\": \"电信\",\n \"LoginFlag\": 0,\n \"LoginIP\": \"113.108.**.73\",\n \"LoginLocation\": \"中国-广东省-深圳市\",\n \"LoginTime\": \"2025-05-07 15:21:05\",\n \"Name\": \"jose***li_blue\",\n \"Nickname\": \"天空之蓝\",\n \"SubNickname\": \"josephlkli_blue\",\n \"SubUin\": \"1000***72635\",\n \"Type\": 1,\n \"Uin\": \"1000***6646\"\n }\n ],\n \"RequestId\": \"fabb0428-3853-46df-b473-afbc7021fed4\",\n \"Total\": 22\n }\n}",
126
- "title": "1"
124
+ "input": "POST / HTTP/1.1\nHost: csip.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeAccessKeyUserList\n<公共请求参数>\n\n{}",
125
+ "output": "{\n \"Response\": {\n \"Data\": [\n {\n \"AccessKeyAlarmList\": [\n {\n \"Count\": 12,\n \"Type\": 0\n }\n ],\n \"AccessKeyRiskList\": [\n {\n \"Count\": 1,\n \"Type\": 0\n }\n ],\n \"AccessType\": 1,\n \"ActionFlag\": 0,\n \"Advice\": 1,\n \"AppID\": 13000008,\n \"CheckStatus\": 0,\n \"ID\": 200631,\n \"ISP\": \"电信\",\n \"LoginFlag\": 0,\n \"LoginIP\": \"113.108.**.73\",\n \"LoginLocation\": \"中国-广东省-深圳市\",\n \"LoginTime\": \"2025-05-07 15:21:05\",\n \"Name\": \"name\",\n \"Nickname\": \"name\",\n \"SubNickname\": \"name\",\n \"SubUin\": \"1000***72635\",\n \"Type\": 1,\n \"Uin\": \"1000***6646\"\n }\n ],\n \"RequestId\": \"fabb0428-3853-46df-b473-afbc7021fed4\",\n \"Total\": 1\n }\n}",
126
+ "title": "查询用户的账号列表"
127
127
  }
128
128
  ],
129
129
  "DescribeAlertList": [
@@ -194,14 +194,8 @@
194
194
  {
195
195
  "document": "",
196
196
  "input": "POST / HTTP/1.1\nHost: csip.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeCallRecord\n<公共请求参数>\n\n{}",
197
- "output": "{\n \"Response\": {\n \"Data\": [],\n \"Total\": 0,\n \"RequestId\": \"3c140219-cfe9-470e-b241-907877d6fb03\"\n }\n}",
197
+ "output": "{\n \"Response\": {\n \"Data\": [\n {\n \"AccessKey\": \"AKID******\",\n \"AccessKeyID\": 10022,\n \"AccessKeyRemark\": \"\",\n \"AppID\": 100001,\n \"CallCount\": 241,\n \"CallID\": \"202528000005473835\",\n \"Code\": 0,\n \"Date\": \"2025-07-11 00:00:00\",\n \"EventName\": \"GetFederationToken\",\n \"EventType\": 1,\n \"FirstCallTime\": \"2025-07-11 00:00:00\",\n \"IPType\": 3,\n \"ISP\": \"腾讯云\",\n \"InstanceID\": \"\",\n \"InstanceName\": \"\",\n \"LastCallTime\": \"2025-07-11 14:19:00\",\n \"PolicySet\": [\n \"default-policy\"\n ],\n \"ProductName\": \"sts\",\n \"Region\": \"中国-广东省-广州市\",\n \"ShowStatus\": true,\n \"SourceIP\": \"106.55.123.**\",\n \"SourceIPRemark\": \"remark\",\n \"UserName\": \"name\",\n \"UserType\": \"CAMUser\"\n }\n ],\n \"Total\": 1,\n \"RequestId\": \"3c140219-cfe9-470e-b241-907877d6fb03\"\n }\n}",
198
198
  "title": "示例1"
199
- },
200
- {
201
- "document": "",
202
- "input": "POST / HTTP/1.1\nHost: csip.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeCallRecord\n<公共请求参数>\n\n{\n \"AccessKeyID\": 10058\n}",
203
- "output": "{\n \"Response\": {\n \"Data\": [],\n \"RequestId\": \"cee100be-ec33-452c-b10e-320f6e72dc1b\",\n \"Total\": 0\n }\n}",
204
- "title": "1"
205
199
  }
206
200
  ],
207
201
  "DescribeCheckViewRisks": [
@@ -353,7 +347,7 @@
353
347
  "document": "",
354
348
  "input": "POST / HTTP/1.1\nHost: csip.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeRiskCallRecord\n<公共请求参数>\n\n{\n \"RiskID\": 10091\n}",
355
349
  "output": "{\n \"Response\": {\n \"Data\": [\n {\n \"CallCount\": 0,\n \"EventDescCN\": \"卸载主机安全客户端\",\n \"EventDescEN\": \"DeleteMachine\",\n \"EventName\": \"DeleteMachine\",\n \"ProductName\": \"cwp\",\n \"ProductNameCN\": \"主机安全\"\n }\n ],\n \"RequestId\": \"728a0b3b-230d-468e-a10a-f6e7a56c0056\",\n \"Total\": 1\n }\n}",
356
- "title": "1"
350
+ "title": "获取风险调用记录列表"
357
351
  }
358
352
  ],
359
353
  "DescribeRiskCenterAssetViewCFGRiskList": [
@@ -544,8 +538,8 @@
544
538
  {
545
539
  "document": "",
546
540
  "input": "POST / HTTP/1.1\nHost: csip.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeUserCallRecord\n<公共请求参数>\n\n{\n \"SubUin\": \"100021372635\",\n \"Filter\": {\n \"Limit\": 1\n }\n}",
547
- "output": "{\n \"Response\": {\n \"Data\": [\n {\n \"AppID\": 0,\n \"CallCount\": 5941,\n \"Code\": 0,\n \"Date\": \"\",\n \"EventType\": 1,\n \"FirstCallTime\": \"2025-05-16 00:01:44\",\n \"ISP\": \"腾讯云\",\n \"LastCallTime\": \"2025-05-22 11:09:39\",\n \"Region\": \"中国-广东省-广州市\",\n \"SourceIP\": \"106.55.***.47\",\n \"SourceIPRemark\": \"\",\n \"UserName\": \"jos***_blue\"\n }\n ],\n \"RequestId\": \"502c625d-756e-4bdb-bd5f-784d008150b5\",\n \"Total\": 76\n }\n}",
548
- "title": "1"
541
+ "output": "{\n \"Response\": {\n \"Data\": [\n {\n \"AppID\": 10001,\n \"CallCount\": 5941,\n \"Code\": 0,\n \"Date\": \"\",\n \"EventType\": 1,\n \"FirstCallTime\": \"2025-05-16 00:01:44\",\n \"ISP\": \"腾讯云\",\n \"LastCallTime\": \"2025-05-22 11:09:39\",\n \"Region\": \"中国-广东省-广州市\",\n \"SourceIP\": \"106.55.***.47\",\n \"SourceIPRemark\": \"\",\n \"UserName\": \"name\"\n }\n ],\n \"RequestId\": \"502c625d-756e-4bdb-bd5f-784d008150b5\",\n \"Total\": 1\n }\n}",
542
+ "title": "获取账号调用记录列表"
549
543
  }
550
544
  ],
551
545
  "DescribeVULList": [
@@ -641,7 +635,7 @@
641
635
  "document": "",
642
636
  "input": "POST / HTTP/1.1\nHost: csip.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: UpdateAccessKeyAlarmStatus\n<公共请求参数>\n\n{\n \"Status\": 0,\n \"RiskIDList\": [\n 91000005\n ]\n}",
643
637
  "output": "{\n \"Response\": {\n \"Code\": 0,\n \"Msg\": \"success\",\n \"RequestId\": \"2a8b1b1e-e8c7-4b5d-8674-6881faa18a96\"\n }\n}",
644
- "title": "1"
638
+ "title": "标记风险或者告警为"
645
639
  }
646
640
  ],
647
641
  "UpdateAccessKeyRemark": [
@@ -121,6 +121,58 @@ def doDescribeManages(args, parsed_globals):
121
121
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
122
122
 
123
123
 
124
+ def doDescribeLeakageDatas(args, parsed_globals):
125
+ g_param = parse_global_arg(parsed_globals)
126
+
127
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
128
+ cred = credential.CVMRoleCredential()
129
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
130
+ cred = credential.STSAssumeRoleCredential(
131
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
132
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
133
+ )
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
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
136
+ else:
137
+ cred = credential.Credential(
138
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
139
+ )
140
+ http_profile = HttpProfile(
141
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
142
+ reqMethod="POST",
143
+ endpoint=g_param[OptionsDefine.Endpoint],
144
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
145
+ )
146
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
147
+ if g_param[OptionsDefine.Language]:
148
+ profile.language = g_param[OptionsDefine.Language]
149
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
150
+ client = mod.CtemClient(cred, g_param[OptionsDefine.Region], profile)
151
+ client._sdkVersion += ("_CLI_" + __version__)
152
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
153
+ model = models.DescribeLeakageDatasRequest()
154
+ model.from_json_string(json.dumps(args))
155
+ start_time = time.time()
156
+ while True:
157
+ rsp = client.DescribeLeakageDatas(model)
158
+ result = rsp.to_json_string()
159
+ try:
160
+ json_obj = json.loads(result)
161
+ except TypeError as e:
162
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
163
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
164
+ break
165
+ cur_time = time.time()
166
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
167
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
168
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
169
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
170
+ else:
171
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
172
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
173
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
174
+
175
+
124
176
  def doModifyCustomer(args, parsed_globals):
125
177
  g_param = parse_global_arg(parsed_globals)
126
178
 
@@ -537,6 +589,58 @@ def doDescribeCustomers(args, parsed_globals):
537
589
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
538
590
 
539
591
 
592
+ def doDescribeLeakageEmails(args, parsed_globals):
593
+ g_param = parse_global_arg(parsed_globals)
594
+
595
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
596
+ cred = credential.CVMRoleCredential()
597
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
598
+ cred = credential.STSAssumeRoleCredential(
599
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
600
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
601
+ )
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
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
604
+ else:
605
+ cred = credential.Credential(
606
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
607
+ )
608
+ http_profile = HttpProfile(
609
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
610
+ reqMethod="POST",
611
+ endpoint=g_param[OptionsDefine.Endpoint],
612
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
613
+ )
614
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
615
+ if g_param[OptionsDefine.Language]:
616
+ profile.language = g_param[OptionsDefine.Language]
617
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
618
+ client = mod.CtemClient(cred, g_param[OptionsDefine.Region], profile)
619
+ client._sdkVersion += ("_CLI_" + __version__)
620
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
621
+ model = models.DescribeLeakageEmailsRequest()
622
+ model.from_json_string(json.dumps(args))
623
+ start_time = time.time()
624
+ while True:
625
+ rsp = client.DescribeLeakageEmails(model)
626
+ result = rsp.to_json_string()
627
+ try:
628
+ json_obj = json.loads(result)
629
+ except TypeError as e:
630
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
631
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
632
+ break
633
+ cur_time = time.time()
634
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
635
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
636
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
637
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
638
+ else:
639
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
640
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
641
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
642
+
643
+
540
644
  def doDescribeApps(args, parsed_globals):
541
645
  g_param = parse_global_arg(parsed_globals)
542
646
 
@@ -1005,6 +1109,58 @@ def doDescribeDarkWebs(args, parsed_globals):
1005
1109
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1006
1110
 
1007
1111
 
1112
+ def doDescribeLeakageCodes(args, parsed_globals):
1113
+ g_param = parse_global_arg(parsed_globals)
1114
+
1115
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1116
+ cred = credential.CVMRoleCredential()
1117
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1118
+ cred = credential.STSAssumeRoleCredential(
1119
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1120
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1121
+ )
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
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1124
+ else:
1125
+ cred = credential.Credential(
1126
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1127
+ )
1128
+ http_profile = HttpProfile(
1129
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1130
+ reqMethod="POST",
1131
+ endpoint=g_param[OptionsDefine.Endpoint],
1132
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1133
+ )
1134
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1135
+ if g_param[OptionsDefine.Language]:
1136
+ profile.language = g_param[OptionsDefine.Language]
1137
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1138
+ client = mod.CtemClient(cred, g_param[OptionsDefine.Region], profile)
1139
+ client._sdkVersion += ("_CLI_" + __version__)
1140
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1141
+ model = models.DescribeLeakageCodesRequest()
1142
+ model.from_json_string(json.dumps(args))
1143
+ start_time = time.time()
1144
+ while True:
1145
+ rsp = client.DescribeLeakageCodes(model)
1146
+ result = rsp.to_json_string()
1147
+ try:
1148
+ json_obj = json.loads(result)
1149
+ except TypeError as e:
1150
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1151
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1152
+ break
1153
+ cur_time = time.time()
1154
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1155
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1156
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1157
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1158
+ else:
1159
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1160
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1161
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1162
+
1163
+
1008
1164
  def doDescribeWechatOfficialAccounts(args, parsed_globals):
1009
1165
  g_param = parse_global_arg(parsed_globals)
1010
1166
 
@@ -1330,6 +1486,7 @@ MODELS_MAP = {
1330
1486
  ACTION_MAP = {
1331
1487
  "DescribeNetDisks": doDescribeNetDisks,
1332
1488
  "DescribeManages": doDescribeManages,
1489
+ "DescribeLeakageDatas": doDescribeLeakageDatas,
1333
1490
  "ModifyCustomer": doModifyCustomer,
1334
1491
  "DescribeDomains": doDescribeDomains,
1335
1492
  "DescribeVuls": doDescribeVuls,
@@ -1338,6 +1495,7 @@ ACTION_MAP = {
1338
1495
  "DescribeSensitiveInfos": doDescribeSensitiveInfos,
1339
1496
  "DescribeSubDomains": doDescribeSubDomains,
1340
1497
  "DescribeCustomers": doDescribeCustomers,
1498
+ "DescribeLeakageEmails": doDescribeLeakageEmails,
1341
1499
  "DescribeApps": doDescribeApps,
1342
1500
  "DescribeJobRecordDetails": doDescribeJobRecordDetails,
1343
1501
  "DescribeSuspiciousAssets": doDescribeSuspiciousAssets,
@@ -1347,6 +1505,7 @@ ACTION_MAP = {
1347
1505
  "DescribeHttps": doDescribeHttps,
1348
1506
  "DescribeAssets": doDescribeAssets,
1349
1507
  "DescribeDarkWebs": doDescribeDarkWebs,
1508
+ "DescribeLeakageCodes": doDescribeLeakageCodes,
1350
1509
  "DescribeWechatOfficialAccounts": doDescribeWechatOfficialAccounts,
1351
1510
  "DescribeEnterprises": doDescribeEnterprises,
1352
1511
  "CreateCustomer": doCreateCustomer,