tccli 3.0.1239.1__py2.py3-none-any.whl → 3.0.1241.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 (99) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/services/apm/v20210622/api.json +66 -69
  3. tccli/services/apm/v20210622/examples.json +26 -26
  4. tccli/services/autoscaling/v20180419/api.json +12 -1
  5. tccli/services/batch/v20170312/api.json +11 -11
  6. tccli/services/billing/v20180709/api.json +20 -0
  7. tccli/services/cam/v20190116/api.json +1 -1
  8. tccli/services/car/v20220110/api.json +1 -1
  9. tccli/services/car/v20220110/examples.json +3 -3
  10. tccli/services/cdb/v20170320/api.json +582 -579
  11. tccli/services/cdb/v20170320/examples.json +9 -9
  12. tccli/services/cdwdoris/v20211228/api.json +40 -0
  13. tccli/services/cfg/v20210820/api.json +11 -0
  14. tccli/services/chdfs/v20201112/api.json +10 -10
  15. tccli/services/chdfs/v20201112/examples.json +1 -1
  16. tccli/services/cls/v20201016/api.json +1 -1
  17. tccli/services/cmq/v20190304/api.json +77 -77
  18. tccli/services/csip/csip_client.py +281 -16
  19. tccli/services/csip/v20221121/api.json +1631 -101
  20. tccli/services/csip/v20221121/examples.json +40 -0
  21. tccli/services/cvm/cvm_client.py +60 -325
  22. tccli/services/cvm/v20170312/api.json +618 -1401
  23. tccli/services/cvm/v20170312/examples.json +8 -48
  24. tccli/services/cwp/cwp_client.py +0 -53
  25. tccli/services/cwp/v20180228/api.json +0 -34
  26. tccli/services/cwp/v20180228/examples.json +0 -8
  27. tccli/services/cynosdb/v20190107/api.json +452 -458
  28. tccli/services/cynosdb/v20190107/examples.json +23 -23
  29. tccli/services/dbbrain/v20191016/api.json +16 -4
  30. tccli/services/dbbrain/v20191016/examples.json +5 -5
  31. tccli/services/dbbrain/v20210527/api.json +44 -44
  32. tccli/services/dbbrain/v20210527/examples.json +8 -8
  33. tccli/services/dts/v20180330/api.json +30 -30
  34. tccli/services/dts/v20180330/examples.json +4 -4
  35. tccli/services/dts/v20211206/api.json +19 -9
  36. tccli/services/dts/v20211206/examples.json +5 -5
  37. tccli/services/ecm/v20190719/api.json +55 -48
  38. tccli/services/ecm/v20190719/examples.json +7 -7
  39. tccli/services/emr/emr_client.py +493 -16
  40. tccli/services/emr/v20190103/api.json +1323 -246
  41. tccli/services/emr/v20190103/examples.json +72 -0
  42. tccli/services/ess/v20201111/api.json +15 -6
  43. tccli/services/ess/v20201111/examples.json +12 -0
  44. tccli/services/essbasic/v20210526/api.json +11 -2
  45. tccli/services/essbasic/v20210526/examples.json +12 -0
  46. tccli/services/faceid/v20180301/api.json +3 -3
  47. tccli/services/gaap/v20180529/api.json +181 -183
  48. tccli/services/gaap/v20180529/examples.json +31 -37
  49. tccli/services/gs/v20191118/api.json +3 -3
  50. tccli/services/gs/v20191118/examples.json +3 -3
  51. tccli/services/iai/iai_client.py +53 -0
  52. tccli/services/iai/v20200303/api.json +80 -0
  53. tccli/services/iai/v20200303/examples.json +14 -0
  54. tccli/services/iotexplorer/v20190423/api.json +10 -0
  55. tccli/services/keewidb/v20220308/api.json +188 -190
  56. tccli/services/live/v20180801/api.json +323 -222
  57. tccli/services/live/v20180801/examples.json +79 -79
  58. tccli/services/mna/v20210119/api.json +20 -20
  59. tccli/services/mps/v20190612/api.json +40 -0
  60. tccli/services/oceanus/v20190422/api.json +407 -39
  61. tccli/services/oceanus/v20190422/examples.json +1 -1
  62. tccli/services/ocr/v20181119/api.json +50 -0
  63. tccli/services/sms/v20190711/api.json +81 -81
  64. tccli/services/sms/v20190711/examples.json +8 -8
  65. tccli/services/sms/v20210111/api.json +39 -39
  66. tccli/services/sqlserver/v20180328/api.json +235 -139
  67. tccli/services/sqlserver/v20180328/examples.json +2 -2
  68. tccli/services/ssl/v20191205/api.json +777 -779
  69. tccli/services/ssl/v20191205/examples.json +8 -8
  70. tccli/services/tbaas/v20180416/api.json +118 -82
  71. tccli/services/tbaas/v20180416/examples.json +7 -7
  72. tccli/services/tcb/v20180608/api.json +18 -18
  73. tccli/services/tcb/v20180608/examples.json +2 -2
  74. tccli/services/tcm/v20210413/api.json +6 -6
  75. tccli/services/tcm/v20210413/examples.json +1 -1
  76. tccli/services/tcr/v20190924/api.json +17 -12
  77. tccli/services/tdmq/v20200217/api.json +18 -0
  78. tccli/services/tem/v20210701/api.json +439 -280
  79. tccli/services/tem/v20210701/examples.json +39 -39
  80. tccli/services/tke/v20180525/api.json +50 -39
  81. tccli/services/tke/v20180525/examples.json +51 -21
  82. tccli/services/trro/v20220325/api.json +27 -27
  83. tccli/services/trro/v20220325/examples.json +1 -1
  84. tccli/services/tse/v20201207/api.json +46 -9
  85. tccli/services/tse/v20201207/examples.json +31 -31
  86. tccli/services/tsf/v20180326/api.json +448 -434
  87. tccli/services/tsf/v20180326/examples.json +122 -122
  88. tccli/services/tts/v20190823/api.json +1 -1
  89. tccli/services/vpc/v20170312/api.json +278 -37
  90. tccli/services/vpc/v20170312/examples.json +56 -8
  91. tccli/services/vpc/vpc_client.py +159 -0
  92. tccli/services/waf/v20180125/api.json +303 -4
  93. tccli/services/waf/v20180125/examples.json +25 -1
  94. tccli/services/waf/waf_client.py +163 -4
  95. {tccli-3.0.1239.1.dist-info → tccli-3.0.1241.1.dist-info}/METADATA +2 -2
  96. {tccli-3.0.1239.1.dist-info → tccli-3.0.1241.1.dist-info}/RECORD +99 -99
  97. {tccli-3.0.1239.1.dist-info → tccli-3.0.1241.1.dist-info}/WHEEL +0 -0
  98. {tccli-3.0.1239.1.dist-info → tccli-3.0.1241.1.dist-info}/entry_points.txt +0 -0
  99. {tccli-3.0.1239.1.dist-info → tccli-3.0.1241.1.dist-info}/license_files/LICENSE +0 -0
@@ -17,6 +17,58 @@ from tencentcloud.csip.v20221121 import models as models_v20221121
17
17
  from jmespath import search
18
18
  import time
19
19
 
20
+ def doDescribeUebaRule(args, parsed_globals):
21
+ g_param = parse_global_arg(parsed_globals)
22
+
23
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
24
+ cred = credential.CVMRoleCredential()
25
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
26
+ cred = credential.STSAssumeRoleCredential(
27
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
28
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
29
+ )
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
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
32
+ else:
33
+ cred = credential.Credential(
34
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
35
+ )
36
+ http_profile = HttpProfile(
37
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
38
+ reqMethod="POST",
39
+ endpoint=g_param[OptionsDefine.Endpoint],
40
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
41
+ )
42
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
43
+ if g_param[OptionsDefine.Language]:
44
+ profile.language = g_param[OptionsDefine.Language]
45
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
46
+ client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
47
+ client._sdkVersion += ("_CLI_" + __version__)
48
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
49
+ model = models.DescribeUebaRuleRequest()
50
+ model.from_json_string(json.dumps(args))
51
+ start_time = time.time()
52
+ while True:
53
+ rsp = client.DescribeUebaRule(model)
54
+ result = rsp.to_json_string()
55
+ try:
56
+ json_obj = json.loads(result)
57
+ except TypeError as e:
58
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
59
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
60
+ break
61
+ cur_time = time.time()
62
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
63
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
64
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
65
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
66
+ else:
67
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
68
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
69
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
70
+
71
+
20
72
  def doDeleteDomainAndIp(args, parsed_globals):
21
73
  g_param = parse_global_arg(parsed_globals)
22
74
 
@@ -589,7 +641,7 @@ def doDeleteRiskScanTask(args, parsed_globals):
589
641
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
590
642
 
591
643
 
592
- def doDescribeRiskCenterAssetViewWeakPasswordRiskList(args, parsed_globals):
644
+ def doDescribeTaskLogList(args, parsed_globals):
593
645
  g_param = parse_global_arg(parsed_globals)
594
646
 
595
647
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -618,11 +670,11 @@ def doDescribeRiskCenterAssetViewWeakPasswordRiskList(args, parsed_globals):
618
670
  client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
619
671
  client._sdkVersion += ("_CLI_" + __version__)
620
672
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
621
- model = models.DescribeRiskCenterAssetViewWeakPasswordRiskListRequest()
673
+ model = models.DescribeTaskLogListRequest()
622
674
  model.from_json_string(json.dumps(args))
623
675
  start_time = time.time()
624
676
  while True:
625
- rsp = client.DescribeRiskCenterAssetViewWeakPasswordRiskList(model)
677
+ rsp = client.DescribeTaskLogList(model)
626
678
  result = rsp.to_json_string()
627
679
  try:
628
680
  json_obj = json.loads(result)
@@ -1005,6 +1057,58 @@ def doModifyRiskCenterScanTask(args, parsed_globals):
1005
1057
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1006
1058
 
1007
1059
 
1060
+ def doDescribeOrganizationInfo(args, parsed_globals):
1061
+ g_param = parse_global_arg(parsed_globals)
1062
+
1063
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1064
+ cred = credential.CVMRoleCredential()
1065
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1066
+ cred = credential.STSAssumeRoleCredential(
1067
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1068
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1069
+ )
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
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1072
+ else:
1073
+ cred = credential.Credential(
1074
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1075
+ )
1076
+ http_profile = HttpProfile(
1077
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1078
+ reqMethod="POST",
1079
+ endpoint=g_param[OptionsDefine.Endpoint],
1080
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1081
+ )
1082
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1083
+ if g_param[OptionsDefine.Language]:
1084
+ profile.language = g_param[OptionsDefine.Language]
1085
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1086
+ client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
1087
+ client._sdkVersion += ("_CLI_" + __version__)
1088
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1089
+ model = models.DescribeOrganizationInfoRequest()
1090
+ model.from_json_string(json.dumps(args))
1091
+ start_time = time.time()
1092
+ while True:
1093
+ rsp = client.DescribeOrganizationInfo(model)
1094
+ result = rsp.to_json_string()
1095
+ try:
1096
+ json_obj = json.loads(result)
1097
+ except TypeError as e:
1098
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1099
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1100
+ break
1101
+ cur_time = time.time()
1102
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1103
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1104
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1105
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1106
+ else:
1107
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1108
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1109
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1110
+
1111
+
1008
1112
  def doDescribeAssetViewVulRiskList(args, parsed_globals):
1009
1113
  g_param = parse_global_arg(parsed_globals)
1010
1114
 
@@ -1265,6 +1369,58 @@ def doStopRiskCenterTask(args, parsed_globals):
1265
1369
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1266
1370
 
1267
1371
 
1372
+ def doModifyUebaRuleSwitch(args, parsed_globals):
1373
+ g_param = parse_global_arg(parsed_globals)
1374
+
1375
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1376
+ cred = credential.CVMRoleCredential()
1377
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1378
+ cred = credential.STSAssumeRoleCredential(
1379
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1380
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1381
+ )
1382
+ 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):
1383
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1384
+ else:
1385
+ cred = credential.Credential(
1386
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1387
+ )
1388
+ http_profile = HttpProfile(
1389
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1390
+ reqMethod="POST",
1391
+ endpoint=g_param[OptionsDefine.Endpoint],
1392
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1393
+ )
1394
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1395
+ if g_param[OptionsDefine.Language]:
1396
+ profile.language = g_param[OptionsDefine.Language]
1397
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1398
+ client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
1399
+ client._sdkVersion += ("_CLI_" + __version__)
1400
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1401
+ model = models.ModifyUebaRuleSwitchRequest()
1402
+ model.from_json_string(json.dumps(args))
1403
+ start_time = time.time()
1404
+ while True:
1405
+ rsp = client.ModifyUebaRuleSwitch(model)
1406
+ result = rsp.to_json_string()
1407
+ try:
1408
+ json_obj = json.loads(result)
1409
+ except TypeError as e:
1410
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1411
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1412
+ break
1413
+ cur_time = time.time()
1414
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1415
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1416
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1417
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1418
+ else:
1419
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1420
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1421
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1422
+
1423
+
1268
1424
  def doCreateRiskCenterScanTask(args, parsed_globals):
1269
1425
  g_param = parse_global_arg(parsed_globals)
1270
1426
 
@@ -1421,7 +1577,7 @@ def doDescribeSearchBugInfo(args, parsed_globals):
1421
1577
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1422
1578
 
1423
1579
 
1424
- def doDescribeTaskLogList(args, parsed_globals):
1580
+ def doDescribeRiskCenterAssetViewWeakPasswordRiskList(args, parsed_globals):
1425
1581
  g_param = parse_global_arg(parsed_globals)
1426
1582
 
1427
1583
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1450,11 +1606,11 @@ def doDescribeTaskLogList(args, parsed_globals):
1450
1606
  client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
1451
1607
  client._sdkVersion += ("_CLI_" + __version__)
1452
1608
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1453
- model = models.DescribeTaskLogListRequest()
1609
+ model = models.DescribeRiskCenterAssetViewWeakPasswordRiskListRequest()
1454
1610
  model.from_json_string(json.dumps(args))
1455
1611
  start_time = time.time()
1456
1612
  while True:
1457
- rsp = client.DescribeTaskLogList(model)
1613
+ rsp = client.DescribeRiskCenterAssetViewWeakPasswordRiskList(model)
1458
1614
  result = rsp.to_json_string()
1459
1615
  try:
1460
1616
  json_obj = json.loads(result)
@@ -1577,7 +1733,7 @@ def doDescribeScanReportList(args, parsed_globals):
1577
1733
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1578
1734
 
1579
1735
 
1580
- def doCreateDomainAndIp(args, parsed_globals):
1736
+ def doDescribeSubUserInfo(args, parsed_globals):
1581
1737
  g_param = parse_global_arg(parsed_globals)
1582
1738
 
1583
1739
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1606,11 +1762,11 @@ def doCreateDomainAndIp(args, parsed_globals):
1606
1762
  client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
1607
1763
  client._sdkVersion += ("_CLI_" + __version__)
1608
1764
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1609
- model = models.CreateDomainAndIpRequest()
1765
+ model = models.DescribeSubUserInfoRequest()
1610
1766
  model.from_json_string(json.dumps(args))
1611
1767
  start_time = time.time()
1612
1768
  while True:
1613
- rsp = client.CreateDomainAndIp(model)
1769
+ rsp = client.DescribeSubUserInfo(model)
1614
1770
  result = rsp.to_json_string()
1615
1771
  try:
1616
1772
  json_obj = json.loads(result)
@@ -1681,6 +1837,58 @@ def doDescribeAlertList(args, parsed_globals):
1681
1837
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1682
1838
 
1683
1839
 
1840
+ def doModifyRiskCenterRiskStatus(args, parsed_globals):
1841
+ g_param = parse_global_arg(parsed_globals)
1842
+
1843
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1844
+ cred = credential.CVMRoleCredential()
1845
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1846
+ cred = credential.STSAssumeRoleCredential(
1847
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1848
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1849
+ )
1850
+ 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):
1851
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1852
+ else:
1853
+ cred = credential.Credential(
1854
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1855
+ )
1856
+ http_profile = HttpProfile(
1857
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1858
+ reqMethod="POST",
1859
+ endpoint=g_param[OptionsDefine.Endpoint],
1860
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1861
+ )
1862
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1863
+ if g_param[OptionsDefine.Language]:
1864
+ profile.language = g_param[OptionsDefine.Language]
1865
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1866
+ client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
1867
+ client._sdkVersion += ("_CLI_" + __version__)
1868
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1869
+ model = models.ModifyRiskCenterRiskStatusRequest()
1870
+ model.from_json_string(json.dumps(args))
1871
+ start_time = time.time()
1872
+ while True:
1873
+ rsp = client.ModifyRiskCenterRiskStatus(model)
1874
+ result = rsp.to_json_string()
1875
+ try:
1876
+ json_obj = json.loads(result)
1877
+ except TypeError as e:
1878
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1879
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1880
+ break
1881
+ cur_time = time.time()
1882
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1883
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1884
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1885
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1886
+ else:
1887
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1888
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1889
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1890
+
1891
+
1684
1892
  def doUpdateAlertStatusList(args, parsed_globals):
1685
1893
  g_param = parse_global_arg(parsed_globals)
1686
1894
 
@@ -1993,7 +2201,7 @@ def doDescribeVULRiskAdvanceCFGList(args, parsed_globals):
1993
2201
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1994
2202
 
1995
2203
 
1996
- def doModifyRiskCenterRiskStatus(args, parsed_globals):
2204
+ def doCreateDomainAndIp(args, parsed_globals):
1997
2205
  g_param = parse_global_arg(parsed_globals)
1998
2206
 
1999
2207
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -2022,11 +2230,11 @@ def doModifyRiskCenterRiskStatus(args, parsed_globals):
2022
2230
  client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
2023
2231
  client._sdkVersion += ("_CLI_" + __version__)
2024
2232
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
2025
- model = models.ModifyRiskCenterRiskStatusRequest()
2233
+ model = models.CreateDomainAndIpRequest()
2026
2234
  model.from_json_string(json.dumps(args))
2027
2235
  start_time = time.time()
2028
2236
  while True:
2029
- rsp = client.ModifyRiskCenterRiskStatus(model)
2237
+ rsp = client.CreateDomainAndIp(model)
2030
2238
  result = rsp.to_json_string()
2031
2239
  try:
2032
2240
  json_obj = json.loads(result)
@@ -2149,6 +2357,58 @@ def doDescribeTopAttackInfo(args, parsed_globals):
2149
2357
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2150
2358
 
2151
2359
 
2360
+ def doDescribeClusterAssets(args, parsed_globals):
2361
+ g_param = parse_global_arg(parsed_globals)
2362
+
2363
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2364
+ cred = credential.CVMRoleCredential()
2365
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2366
+ cred = credential.STSAssumeRoleCredential(
2367
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2368
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2369
+ )
2370
+ 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):
2371
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2372
+ else:
2373
+ cred = credential.Credential(
2374
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2375
+ )
2376
+ http_profile = HttpProfile(
2377
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2378
+ reqMethod="POST",
2379
+ endpoint=g_param[OptionsDefine.Endpoint],
2380
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2381
+ )
2382
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2383
+ if g_param[OptionsDefine.Language]:
2384
+ profile.language = g_param[OptionsDefine.Language]
2385
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2386
+ client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
2387
+ client._sdkVersion += ("_CLI_" + __version__)
2388
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
2389
+ model = models.DescribeClusterAssetsRequest()
2390
+ model.from_json_string(json.dumps(args))
2391
+ start_time = time.time()
2392
+ while True:
2393
+ rsp = client.DescribeClusterAssets(model)
2394
+ result = rsp.to_json_string()
2395
+ try:
2396
+ json_obj = json.loads(result)
2397
+ except TypeError as e:
2398
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
2399
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2400
+ break
2401
+ cur_time = time.time()
2402
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2403
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2404
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2405
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2406
+ else:
2407
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2408
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2409
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2410
+
2411
+
2152
2412
  def doDescribeTaskLogURL(args, parsed_globals):
2153
2413
  g_param = parse_global_arg(parsed_globals)
2154
2414
 
@@ -2264,6 +2524,7 @@ MODELS_MAP = {
2264
2524
  }
2265
2525
 
2266
2526
  ACTION_MAP = {
2527
+ "DescribeUebaRule": doDescribeUebaRule,
2267
2528
  "DeleteDomainAndIp": doDeleteDomainAndIp,
2268
2529
  "DescribeDbAssetInfo": doDescribeDbAssetInfo,
2269
2530
  "DescribeNICAssets": doDescribeNICAssets,
@@ -2275,7 +2536,7 @@ ACTION_MAP = {
2275
2536
  "DescribeListenerList": doDescribeListenerList,
2276
2537
  "DescribeOrganizationUserInfo": doDescribeOrganizationUserInfo,
2277
2538
  "DeleteRiskScanTask": doDeleteRiskScanTask,
2278
- "DescribeRiskCenterAssetViewWeakPasswordRiskList": doDescribeRiskCenterAssetViewWeakPasswordRiskList,
2539
+ "DescribeTaskLogList": doDescribeTaskLogList,
2279
2540
  "DescribeRiskCenterAssetViewVULRiskList": doDescribeRiskCenterAssetViewVULRiskList,
2280
2541
  "DescribeClusterPodAssets": doDescribeClusterPodAssets,
2281
2542
  "DescribeRiskCenterAssetViewCFGRiskList": doDescribeRiskCenterAssetViewCFGRiskList,
@@ -2283,28 +2544,32 @@ ACTION_MAP = {
2283
2544
  "DescribeRiskCenterServerRiskList": doDescribeRiskCenterServerRiskList,
2284
2545
  "DescribeCVMAssets": doDescribeCVMAssets,
2285
2546
  "ModifyRiskCenterScanTask": doModifyRiskCenterScanTask,
2547
+ "DescribeOrganizationInfo": doDescribeOrganizationInfo,
2286
2548
  "DescribeAssetViewVulRiskList": doDescribeAssetViewVulRiskList,
2287
2549
  "DescribeVULRiskDetail": doDescribeVULRiskDetail,
2288
2550
  "DescribeRiskCenterWebsiteRiskList": doDescribeRiskCenterWebsiteRiskList,
2289
2551
  "DescribeCFWAssetStatistics": doDescribeCFWAssetStatistics,
2290
2552
  "StopRiskCenterTask": doStopRiskCenterTask,
2553
+ "ModifyUebaRuleSwitch": doModifyUebaRuleSwitch,
2291
2554
  "CreateRiskCenterScanTask": doCreateRiskCenterScanTask,
2292
2555
  "DescribeGatewayAssets": doDescribeGatewayAssets,
2293
2556
  "DescribeSearchBugInfo": doDescribeSearchBugInfo,
2294
- "DescribeTaskLogList": doDescribeTaskLogList,
2557
+ "DescribeRiskCenterAssetViewWeakPasswordRiskList": doDescribeRiskCenterAssetViewWeakPasswordRiskList,
2295
2558
  "DescribeVulViewVulRiskList": doDescribeVulViewVulRiskList,
2296
2559
  "DescribeScanReportList": doDescribeScanReportList,
2297
- "CreateDomainAndIp": doCreateDomainAndIp,
2560
+ "DescribeSubUserInfo": doDescribeSubUserInfo,
2298
2561
  "DescribeAlertList": doDescribeAlertList,
2562
+ "ModifyRiskCenterRiskStatus": doModifyRiskCenterRiskStatus,
2299
2563
  "UpdateAlertStatusList": doUpdateAlertStatusList,
2300
2564
  "DescribeScanTaskList": doDescribeScanTaskList,
2301
2565
  "DescribeDbAssets": doDescribeDbAssets,
2302
2566
  "DescribeRiskCenterPortViewPortRiskList": doDescribeRiskCenterPortViewPortRiskList,
2303
2567
  "DescribeRiskCenterAssetViewPortRiskList": doDescribeRiskCenterAssetViewPortRiskList,
2304
2568
  "DescribeVULRiskAdvanceCFGList": doDescribeVULRiskAdvanceCFGList,
2305
- "ModifyRiskCenterRiskStatus": doModifyRiskCenterRiskStatus,
2569
+ "CreateDomainAndIp": doCreateDomainAndIp,
2306
2570
  "ModifyOrganizationAccountStatus": doModifyOrganizationAccountStatus,
2307
2571
  "DescribeTopAttackInfo": doDescribeTopAttackInfo,
2572
+ "DescribeClusterAssets": doDescribeClusterAssets,
2308
2573
  "DescribeTaskLogURL": doDescribeTaskLogURL,
2309
2574
  "DescribeCVMAssetInfo": doDescribeCVMAssetInfo,
2310
2575