tccli 3.0.1371.1__py2.py3-none-any.whl → 3.0.1373.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.
- tccli/__init__.py +1 -1
- tccli/services/batch/v20170312/api.json +59 -59
- tccli/services/batch/v20170312/examples.json +3 -3
- tccli/services/cfg/v20210820/api.json +5 -5
- tccli/services/cfg/v20210820/examples.json +1 -1
- tccli/services/cfs/v20190719/api.json +10 -10
- tccli/services/cfs/v20190719/examples.json +1 -1
- tccli/services/ckafka/v20190819/api.json +21 -21
- tccli/services/clb/v20180317/api.json +259 -10
- tccli/services/cls/v20201016/api.json +388 -282
- tccli/services/cls/v20201016/examples.json +33 -33
- tccli/services/csip/v20221121/examples.json +1 -1
- tccli/services/ctem/v20231128/api.json +104 -104
- tccli/services/ctem/v20231128/examples.json +8 -8
- tccli/services/dnspod/v20210323/api.json +14 -4
- tccli/services/dnspod/v20210323/examples.json +2 -2
- tccli/services/es/v20180416/api.json +23 -4
- tccli/services/ess/v20201111/api.json +3 -3
- tccli/services/essbasic/v20210526/api.json +4 -4
- tccli/services/iai/v20200303/api.json +9 -0
- tccli/services/keewidb/v20220308/api.json +24 -24
- tccli/services/lcic/v20220817/api.json +46 -18
- tccli/services/lighthouse/lighthouse_client.py +106 -0
- tccli/services/lighthouse/v20200324/api.json +280 -0
- tccli/services/lighthouse/v20200324/examples.json +22 -0
- tccli/services/live/v20180801/api.json +1 -1
- tccli/services/lke/lke_client.py +0 -53
- tccli/services/lke/v20231130/api.json +29 -79
- tccli/services/lke/v20231130/examples.json +0 -8
- tccli/services/mongodb/v20190725/api.json +4 -4
- tccli/services/monitor/v20180724/api.json +7 -7
- tccli/services/mps/v20190612/api.json +42 -2
- tccli/services/ocr/v20181119/api.json +43 -14
- tccli/services/organization/v20210331/api.json +25 -25
- tccli/services/organization/v20210331/examples.json +1 -1
- tccli/services/postgres/postgres_client.py +12 -171
- tccli/services/postgres/v20170312/api.json +20 -819
- tccli/services/postgres/v20170312/examples.json +6 -30
- tccli/services/scf/v20180416/api.json +2 -0
- tccli/services/ssl/v20191205/api.json +1 -1
- tccli/services/sts/v20180813/api.json +4 -4
- tccli/services/tcbr/v20220217/api.json +92 -0
- tccli/services/tcss/v20201101/api.json +32 -2
- tccli/services/tcss/v20201101/examples.json +3 -3
- tccli/services/teo/v20220901/api.json +12 -12
- tccli/services/tione/v20211111/api.json +18 -18
- tccli/services/tke/v20180525/api.json +10 -1
- tccli/services/tms/v20201229/api.json +6 -6
- tccli/services/trabbit/v20230418/api.json +41 -2
- tccli/services/trocket/trocket_client.py +65 -12
- tccli/services/trocket/v20230308/api.json +156 -0
- tccli/services/trocket/v20230308/examples.json +8 -0
- tccli/services/trtc/trtc_client.py +159 -0
- tccli/services/trtc/v20190722/api.json +273 -9
- tccli/services/trtc/v20190722/examples.json +24 -0
- tccli/services/tse/v20201207/api.json +23 -5
- tccli/services/tse/v20201207/examples.json +2 -2
- tccli/services/tsf/v20180326/api.json +907 -802
- tccli/services/tsf/v20180326/examples.json +29 -29
- tccli/services/vod/v20180717/api.json +73 -33
- tccli/services/vod/v20180717/examples.json +1 -1
- tccli/services/vpc/v20170312/api.json +12 -2
- tccli/services/vpc/v20170312/examples.json +2 -2
- tccli/services/waf/v20180125/api.json +717 -38
- tccli/services/waf/v20180125/examples.json +56 -0
- tccli/services/waf/waf_client.py +444 -73
- tccli/services/wedata/v20210820/api.json +138 -6
- tccli/services/wsa/v20250508/api.json +21 -3
- {tccli-3.0.1371.1.dist-info → tccli-3.0.1373.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1371.1.dist-info → tccli-3.0.1373.1.dist-info}/RECORD +73 -73
- {tccli-3.0.1371.1.dist-info → tccli-3.0.1373.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1371.1.dist-info → tccli-3.0.1373.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1371.1.dist-info → tccli-3.0.1373.1.dist-info}/license_files/LICENSE +0 -0
tccli/services/waf/waf_client.py
CHANGED
@@ -1057,6 +1057,58 @@ def doDescribeScanIp(args, parsed_globals):
|
|
1057
1057
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1058
1058
|
|
1059
1059
|
|
1060
|
+
def doDeleteOwaspRuleStatus(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.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
1087
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1088
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1089
|
+
model = models.DeleteOwaspRuleStatusRequest()
|
1090
|
+
model.from_json_string(json.dumps(args))
|
1091
|
+
start_time = time.time()
|
1092
|
+
while True:
|
1093
|
+
rsp = client.DeleteOwaspRuleStatus(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
|
+
|
1060
1112
|
def doCreatePostCKafkaFlow(args, parsed_globals):
|
1061
1113
|
g_param = parse_global_arg(parsed_globals)
|
1062
1114
|
|
@@ -1473,7 +1525,7 @@ def doDescribeUserDomainInfo(args, parsed_globals):
|
|
1473
1525
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1474
1526
|
|
1475
1527
|
|
1476
|
-
def
|
1528
|
+
def doDeleteCCRule(args, parsed_globals):
|
1477
1529
|
g_param = parse_global_arg(parsed_globals)
|
1478
1530
|
|
1479
1531
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1502,11 +1554,11 @@ def doDescribeProtectionModes(args, parsed_globals):
|
|
1502
1554
|
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
1503
1555
|
client._sdkVersion += ("_CLI_" + __version__)
|
1504
1556
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1505
|
-
model = models.
|
1557
|
+
model = models.DeleteCCRuleRequest()
|
1506
1558
|
model.from_json_string(json.dumps(args))
|
1507
1559
|
start_time = time.time()
|
1508
1560
|
while True:
|
1509
|
-
rsp = client.
|
1561
|
+
rsp = client.DeleteCCRule(model)
|
1510
1562
|
result = rsp.to_json_string()
|
1511
1563
|
try:
|
1512
1564
|
json_obj = json.loads(result)
|
@@ -1785,6 +1837,58 @@ def doDescribeIpHitItems(args, parsed_globals):
|
|
1785
1837
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1786
1838
|
|
1787
1839
|
|
1840
|
+
def doDescribeOwaspRuleTypes(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.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
1867
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1868
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1869
|
+
model = models.DescribeOwaspRuleTypesRequest()
|
1870
|
+
model.from_json_string(json.dumps(args))
|
1871
|
+
start_time = time.time()
|
1872
|
+
while True:
|
1873
|
+
rsp = client.DescribeOwaspRuleTypes(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
|
+
|
1788
1892
|
def doDescribeHistogram(args, parsed_globals):
|
1789
1893
|
g_param = parse_global_arg(parsed_globals)
|
1790
1894
|
|
@@ -2097,6 +2201,58 @@ def doModifyAreaBanAreas(args, parsed_globals):
|
|
2097
2201
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2098
2202
|
|
2099
2203
|
|
2204
|
+
def doModifyOwaspRuleStatus(args, parsed_globals):
|
2205
|
+
g_param = parse_global_arg(parsed_globals)
|
2206
|
+
|
2207
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2208
|
+
cred = credential.CVMRoleCredential()
|
2209
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2210
|
+
cred = credential.STSAssumeRoleCredential(
|
2211
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2212
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2213
|
+
)
|
2214
|
+
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):
|
2215
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2216
|
+
else:
|
2217
|
+
cred = credential.Credential(
|
2218
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2219
|
+
)
|
2220
|
+
http_profile = HttpProfile(
|
2221
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2222
|
+
reqMethod="POST",
|
2223
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2224
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2225
|
+
)
|
2226
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2227
|
+
if g_param[OptionsDefine.Language]:
|
2228
|
+
profile.language = g_param[OptionsDefine.Language]
|
2229
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2230
|
+
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
2231
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2232
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2233
|
+
model = models.ModifyOwaspRuleStatusRequest()
|
2234
|
+
model.from_json_string(json.dumps(args))
|
2235
|
+
start_time = time.time()
|
2236
|
+
while True:
|
2237
|
+
rsp = client.ModifyOwaspRuleStatus(model)
|
2238
|
+
result = rsp.to_json_string()
|
2239
|
+
try:
|
2240
|
+
json_obj = json.loads(result)
|
2241
|
+
except TypeError as e:
|
2242
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2243
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2244
|
+
break
|
2245
|
+
cur_time = time.time()
|
2246
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2247
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2248
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2249
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2250
|
+
else:
|
2251
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2252
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2253
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2254
|
+
|
2255
|
+
|
2100
2256
|
def doCreateDeals(args, parsed_globals):
|
2101
2257
|
g_param = parse_global_arg(parsed_globals)
|
2102
2258
|
|
@@ -2461,7 +2617,7 @@ def doDescribeWafThreatenIntelligence(args, parsed_globals):
|
|
2461
2617
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2462
2618
|
|
2463
2619
|
|
2464
|
-
def
|
2620
|
+
def doModifySpartaProtectionMode(args, parsed_globals):
|
2465
2621
|
g_param = parse_global_arg(parsed_globals)
|
2466
2622
|
|
2467
2623
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2490,11 +2646,11 @@ def doDescribeModuleStatus(args, parsed_globals):
|
|
2490
2646
|
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
2491
2647
|
client._sdkVersion += ("_CLI_" + __version__)
|
2492
2648
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2493
|
-
model = models.
|
2649
|
+
model = models.ModifySpartaProtectionModeRequest()
|
2494
2650
|
model.from_json_string(json.dumps(args))
|
2495
2651
|
start_time = time.time()
|
2496
2652
|
while True:
|
2497
|
-
rsp = client.
|
2653
|
+
rsp = client.ModifySpartaProtectionMode(model)
|
2498
2654
|
result = rsp.to_json_string()
|
2499
2655
|
try:
|
2500
2656
|
json_obj = json.loads(result)
|
@@ -3397,6 +3553,58 @@ def doDescribeUserLevel(args, parsed_globals):
|
|
3397
3553
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3398
3554
|
|
3399
3555
|
|
3556
|
+
def doModifyOwaspRuleTypeAction(args, parsed_globals):
|
3557
|
+
g_param = parse_global_arg(parsed_globals)
|
3558
|
+
|
3559
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3560
|
+
cred = credential.CVMRoleCredential()
|
3561
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3562
|
+
cred = credential.STSAssumeRoleCredential(
|
3563
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3564
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3565
|
+
)
|
3566
|
+
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):
|
3567
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3568
|
+
else:
|
3569
|
+
cred = credential.Credential(
|
3570
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3571
|
+
)
|
3572
|
+
http_profile = HttpProfile(
|
3573
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3574
|
+
reqMethod="POST",
|
3575
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3576
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3577
|
+
)
|
3578
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3579
|
+
if g_param[OptionsDefine.Language]:
|
3580
|
+
profile.language = g_param[OptionsDefine.Language]
|
3581
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3582
|
+
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
3583
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3584
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3585
|
+
model = models.ModifyOwaspRuleTypeActionRequest()
|
3586
|
+
model.from_json_string(json.dumps(args))
|
3587
|
+
start_time = time.time()
|
3588
|
+
while True:
|
3589
|
+
rsp = client.ModifyOwaspRuleTypeAction(model)
|
3590
|
+
result = rsp.to_json_string()
|
3591
|
+
try:
|
3592
|
+
json_obj = json.loads(result)
|
3593
|
+
except TypeError as e:
|
3594
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3595
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3596
|
+
break
|
3597
|
+
cur_time = time.time()
|
3598
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3599
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3600
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3601
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3602
|
+
else:
|
3603
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3604
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3605
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3606
|
+
|
3607
|
+
|
3400
3608
|
def doDescribePeakValue(args, parsed_globals):
|
3401
3609
|
g_param = parse_global_arg(parsed_globals)
|
3402
3610
|
|
@@ -4333,7 +4541,7 @@ def doDescribeCiphersDetail(args, parsed_globals):
|
|
4333
4541
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4334
4542
|
|
4335
4543
|
|
4336
|
-
def
|
4544
|
+
def doModifyOwaspRuleTypeLevel(args, parsed_globals):
|
4337
4545
|
g_param = parse_global_arg(parsed_globals)
|
4338
4546
|
|
4339
4547
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -4362,11 +4570,11 @@ def doDescribeOwaspWhiteRules(args, parsed_globals):
|
|
4362
4570
|
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
4363
4571
|
client._sdkVersion += ("_CLI_" + __version__)
|
4364
4572
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
4365
|
-
model = models.
|
4573
|
+
model = models.ModifyOwaspRuleTypeLevelRequest()
|
4366
4574
|
model.from_json_string(json.dumps(args))
|
4367
4575
|
start_time = time.time()
|
4368
4576
|
while True:
|
4369
|
-
rsp = client.
|
4577
|
+
rsp = client.ModifyOwaspRuleTypeLevel(model)
|
4370
4578
|
result = rsp.to_json_string()
|
4371
4579
|
try:
|
4372
4580
|
json_obj = json.loads(result)
|
@@ -5061,6 +5269,58 @@ def doDescribeFlowTrend(args, parsed_globals):
|
|
5061
5269
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5062
5270
|
|
5063
5271
|
|
5272
|
+
def doDescribeProtectionModes(args, parsed_globals):
|
5273
|
+
g_param = parse_global_arg(parsed_globals)
|
5274
|
+
|
5275
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
5276
|
+
cred = credential.CVMRoleCredential()
|
5277
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
5278
|
+
cred = credential.STSAssumeRoleCredential(
|
5279
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
5280
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
5281
|
+
)
|
5282
|
+
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):
|
5283
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
5284
|
+
else:
|
5285
|
+
cred = credential.Credential(
|
5286
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
5287
|
+
)
|
5288
|
+
http_profile = HttpProfile(
|
5289
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
5290
|
+
reqMethod="POST",
|
5291
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
5292
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
5293
|
+
)
|
5294
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
5295
|
+
if g_param[OptionsDefine.Language]:
|
5296
|
+
profile.language = g_param[OptionsDefine.Language]
|
5297
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
5298
|
+
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
5299
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
5300
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
5301
|
+
model = models.DescribeProtectionModesRequest()
|
5302
|
+
model.from_json_string(json.dumps(args))
|
5303
|
+
start_time = time.time()
|
5304
|
+
while True:
|
5305
|
+
rsp = client.DescribeProtectionModes(model)
|
5306
|
+
result = rsp.to_json_string()
|
5307
|
+
try:
|
5308
|
+
json_obj = json.loads(result)
|
5309
|
+
except TypeError as e:
|
5310
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
5311
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
5312
|
+
break
|
5313
|
+
cur_time = time.time()
|
5314
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
5315
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
5316
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
5317
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
5318
|
+
else:
|
5319
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
5320
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
5321
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5322
|
+
|
5323
|
+
|
5064
5324
|
def doDescribeUserClbWafRegions(args, parsed_globals):
|
5065
5325
|
g_param = parse_global_arg(parsed_globals)
|
5066
5326
|
|
@@ -5893,6 +6153,58 @@ def doDescribeWafAutoDenyRules(args, parsed_globals):
|
|
5893
6153
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5894
6154
|
|
5895
6155
|
|
6156
|
+
def doDescribeOwaspRules(args, parsed_globals):
|
6157
|
+
g_param = parse_global_arg(parsed_globals)
|
6158
|
+
|
6159
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
6160
|
+
cred = credential.CVMRoleCredential()
|
6161
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
6162
|
+
cred = credential.STSAssumeRoleCredential(
|
6163
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
6164
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
6165
|
+
)
|
6166
|
+
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):
|
6167
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
6168
|
+
else:
|
6169
|
+
cred = credential.Credential(
|
6170
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
6171
|
+
)
|
6172
|
+
http_profile = HttpProfile(
|
6173
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
6174
|
+
reqMethod="POST",
|
6175
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
6176
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
6177
|
+
)
|
6178
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
6179
|
+
if g_param[OptionsDefine.Language]:
|
6180
|
+
profile.language = g_param[OptionsDefine.Language]
|
6181
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
6182
|
+
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
6183
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
6184
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
6185
|
+
model = models.DescribeOwaspRulesRequest()
|
6186
|
+
model.from_json_string(json.dumps(args))
|
6187
|
+
start_time = time.time()
|
6188
|
+
while True:
|
6189
|
+
rsp = client.DescribeOwaspRules(model)
|
6190
|
+
result = rsp.to_json_string()
|
6191
|
+
try:
|
6192
|
+
json_obj = json.loads(result)
|
6193
|
+
except TypeError as e:
|
6194
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
6195
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
6196
|
+
break
|
6197
|
+
cur_time = time.time()
|
6198
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
6199
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
6200
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
6201
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
6202
|
+
else:
|
6203
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
6204
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
6205
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
6206
|
+
|
6207
|
+
|
5896
6208
|
def doDeleteSession(args, parsed_globals):
|
5897
6209
|
g_param = parse_global_arg(parsed_globals)
|
5898
6210
|
|
@@ -6465,6 +6777,58 @@ def doModifyGenerateDeals(args, parsed_globals):
|
|
6465
6777
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
6466
6778
|
|
6467
6779
|
|
6780
|
+
def doDescribeOwaspWhiteRules(args, parsed_globals):
|
6781
|
+
g_param = parse_global_arg(parsed_globals)
|
6782
|
+
|
6783
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
6784
|
+
cred = credential.CVMRoleCredential()
|
6785
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
6786
|
+
cred = credential.STSAssumeRoleCredential(
|
6787
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
6788
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
6789
|
+
)
|
6790
|
+
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):
|
6791
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
6792
|
+
else:
|
6793
|
+
cred = credential.Credential(
|
6794
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
6795
|
+
)
|
6796
|
+
http_profile = HttpProfile(
|
6797
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
6798
|
+
reqMethod="POST",
|
6799
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
6800
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
6801
|
+
)
|
6802
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
6803
|
+
if g_param[OptionsDefine.Language]:
|
6804
|
+
profile.language = g_param[OptionsDefine.Language]
|
6805
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
6806
|
+
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
6807
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
6808
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
6809
|
+
model = models.DescribeOwaspWhiteRulesRequest()
|
6810
|
+
model.from_json_string(json.dumps(args))
|
6811
|
+
start_time = time.time()
|
6812
|
+
while True:
|
6813
|
+
rsp = client.DescribeOwaspWhiteRules(model)
|
6814
|
+
result = rsp.to_json_string()
|
6815
|
+
try:
|
6816
|
+
json_obj = json.loads(result)
|
6817
|
+
except TypeError as e:
|
6818
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
6819
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
6820
|
+
break
|
6821
|
+
cur_time = time.time()
|
6822
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
6823
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
6824
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
6825
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
6826
|
+
else:
|
6827
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
6828
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
6829
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
6830
|
+
|
6831
|
+
|
6468
6832
|
def doDescribeHostLimit(args, parsed_globals):
|
6469
6833
|
g_param = parse_global_arg(parsed_globals)
|
6470
6834
|
|
@@ -6777,6 +7141,58 @@ def doDescribeDomainVerifyResult(args, parsed_globals):
|
|
6777
7141
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
6778
7142
|
|
6779
7143
|
|
7144
|
+
def doModifyAttackWhiteRule(args, parsed_globals):
|
7145
|
+
g_param = parse_global_arg(parsed_globals)
|
7146
|
+
|
7147
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
7148
|
+
cred = credential.CVMRoleCredential()
|
7149
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
7150
|
+
cred = credential.STSAssumeRoleCredential(
|
7151
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
7152
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
7153
|
+
)
|
7154
|
+
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):
|
7155
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
7156
|
+
else:
|
7157
|
+
cred = credential.Credential(
|
7158
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
7159
|
+
)
|
7160
|
+
http_profile = HttpProfile(
|
7161
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
7162
|
+
reqMethod="POST",
|
7163
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
7164
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
7165
|
+
)
|
7166
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
7167
|
+
if g_param[OptionsDefine.Language]:
|
7168
|
+
profile.language = g_param[OptionsDefine.Language]
|
7169
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
7170
|
+
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
7171
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
7172
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
7173
|
+
model = models.ModifyAttackWhiteRuleRequest()
|
7174
|
+
model.from_json_string(json.dumps(args))
|
7175
|
+
start_time = time.time()
|
7176
|
+
while True:
|
7177
|
+
rsp = client.ModifyAttackWhiteRule(model)
|
7178
|
+
result = rsp.to_json_string()
|
7179
|
+
try:
|
7180
|
+
json_obj = json.loads(result)
|
7181
|
+
except TypeError as e:
|
7182
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
7183
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
7184
|
+
break
|
7185
|
+
cur_time = time.time()
|
7186
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
7187
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
7188
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
7189
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
7190
|
+
else:
|
7191
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
7192
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
7193
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
7194
|
+
|
7195
|
+
|
6780
7196
|
def doCreateAccessExport(args, parsed_globals):
|
6781
7197
|
g_param = parse_global_arg(parsed_globals)
|
6782
7198
|
|
@@ -6933,7 +7349,7 @@ def doDescribeInstances(args, parsed_globals):
|
|
6933
7349
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
6934
7350
|
|
6935
7351
|
|
6936
|
-
def
|
7352
|
+
def doModifyOwaspRuleTypeStatus(args, parsed_globals):
|
6937
7353
|
g_param = parse_global_arg(parsed_globals)
|
6938
7354
|
|
6939
7355
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -6962,11 +7378,11 @@ def doModifyAttackWhiteRule(args, parsed_globals):
|
|
6962
7378
|
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
6963
7379
|
client._sdkVersion += ("_CLI_" + __version__)
|
6964
7380
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
6965
|
-
model = models.
|
7381
|
+
model = models.ModifyOwaspRuleTypeStatusRequest()
|
6966
7382
|
model.from_json_string(json.dumps(args))
|
6967
7383
|
start_time = time.time()
|
6968
7384
|
while True:
|
6969
|
-
rsp = client.
|
7385
|
+
rsp = client.ModifyOwaspRuleTypeStatus(model)
|
6970
7386
|
result = rsp.to_json_string()
|
6971
7387
|
try:
|
6972
7388
|
json_obj = json.loads(result)
|
@@ -7661,7 +8077,7 @@ def doModifyDomainPostAction(args, parsed_globals):
|
|
7661
8077
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
7662
8078
|
|
7663
8079
|
|
7664
|
-
def
|
8080
|
+
def doDescribeModuleStatus(args, parsed_globals):
|
7665
8081
|
g_param = parse_global_arg(parsed_globals)
|
7666
8082
|
|
7667
8083
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -7690,11 +8106,11 @@ def doModifySpartaProtectionMode(args, parsed_globals):
|
|
7690
8106
|
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
7691
8107
|
client._sdkVersion += ("_CLI_" + __version__)
|
7692
8108
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
7693
|
-
model = models.
|
8109
|
+
model = models.DescribeModuleStatusRequest()
|
7694
8110
|
model.from_json_string(json.dumps(args))
|
7695
8111
|
start_time = time.time()
|
7696
8112
|
while True:
|
7697
|
-
rsp = client.
|
8113
|
+
rsp = client.DescribeModuleStatus(model)
|
7698
8114
|
result = rsp.to_json_string()
|
7699
8115
|
try:
|
7700
8116
|
json_obj = json.loads(result)
|
@@ -7921,58 +8337,6 @@ def doDescribeCCRuleList(args, parsed_globals):
|
|
7921
8337
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
7922
8338
|
|
7923
8339
|
|
7924
|
-
def doDeleteCCRule(args, parsed_globals):
|
7925
|
-
g_param = parse_global_arg(parsed_globals)
|
7926
|
-
|
7927
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
7928
|
-
cred = credential.CVMRoleCredential()
|
7929
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
7930
|
-
cred = credential.STSAssumeRoleCredential(
|
7931
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
7932
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
7933
|
-
)
|
7934
|
-
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):
|
7935
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
7936
|
-
else:
|
7937
|
-
cred = credential.Credential(
|
7938
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
7939
|
-
)
|
7940
|
-
http_profile = HttpProfile(
|
7941
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
7942
|
-
reqMethod="POST",
|
7943
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
7944
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
7945
|
-
)
|
7946
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
7947
|
-
if g_param[OptionsDefine.Language]:
|
7948
|
-
profile.language = g_param[OptionsDefine.Language]
|
7949
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
7950
|
-
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
7951
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
7952
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
7953
|
-
model = models.DeleteCCRuleRequest()
|
7954
|
-
model.from_json_string(json.dumps(args))
|
7955
|
-
start_time = time.time()
|
7956
|
-
while True:
|
7957
|
-
rsp = client.DeleteCCRule(model)
|
7958
|
-
result = rsp.to_json_string()
|
7959
|
-
try:
|
7960
|
-
json_obj = json.loads(result)
|
7961
|
-
except TypeError as e:
|
7962
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
7963
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
7964
|
-
break
|
7965
|
-
cur_time = time.time()
|
7966
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
7967
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
7968
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
7969
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
7970
|
-
else:
|
7971
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
7972
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
7973
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
7974
|
-
|
7975
|
-
|
7976
8340
|
def doModifyWebshellStatus(args, parsed_globals):
|
7977
8341
|
g_param = parse_global_arg(parsed_globals)
|
7978
8342
|
|
@@ -8784,6 +9148,7 @@ ACTION_MAP = {
|
|
8784
9148
|
"GetAttackDownloadRecords": doGetAttackDownloadRecords,
|
8785
9149
|
"DescribeApiDetail": doDescribeApiDetail,
|
8786
9150
|
"DescribeScanIp": doDescribeScanIp,
|
9151
|
+
"DeleteOwaspRuleStatus": doDeleteOwaspRuleStatus,
|
8787
9152
|
"CreatePostCKafkaFlow": doCreatePostCKafkaFlow,
|
8788
9153
|
"DeleteCustomRule": doDeleteCustomRule,
|
8789
9154
|
"ModifyAntiFakeUrl": doModifyAntiFakeUrl,
|
@@ -8792,18 +9157,20 @@ ACTION_MAP = {
|
|
8792
9157
|
"DescribeUserCdcClbWafRegions": doDescribeUserCdcClbWafRegions,
|
8793
9158
|
"ModifyWafAutoDenyRules": doModifyWafAutoDenyRules,
|
8794
9159
|
"DescribeUserDomainInfo": doDescribeUserDomainInfo,
|
8795
|
-
"
|
9160
|
+
"DeleteCCRule": doDeleteCCRule,
|
8796
9161
|
"DescribeAntiInfoLeakageRules": doDescribeAntiInfoLeakageRules,
|
8797
9162
|
"SearchAccessLog": doSearchAccessLog,
|
8798
9163
|
"ModifyBotSceneUCBRule": doModifyBotSceneUCBRule,
|
8799
9164
|
"DescribeBotSceneUCBRule": doDescribeBotSceneUCBRule,
|
8800
9165
|
"DescribeIpHitItems": doDescribeIpHitItems,
|
9166
|
+
"DescribeOwaspRuleTypes": doDescribeOwaspRuleTypes,
|
8801
9167
|
"DescribeHistogram": doDescribeHistogram,
|
8802
9168
|
"DescribeWebshellStatus": doDescribeWebshellStatus,
|
8803
9169
|
"DescribeDomainWhiteRules": doDescribeDomainWhiteRules,
|
8804
9170
|
"DeleteAntiInfoLeakRule": doDeleteAntiInfoLeakRule,
|
8805
9171
|
"CreateOwaspWhiteRule": doCreateOwaspWhiteRule,
|
8806
9172
|
"ModifyAreaBanAreas": doModifyAreaBanAreas,
|
9173
|
+
"ModifyOwaspRuleStatus": doModifyOwaspRuleStatus,
|
8807
9174
|
"CreateDeals": doCreateDeals,
|
8808
9175
|
"DescribeAreaBanSupportAreas": doDescribeAreaBanSupportAreas,
|
8809
9176
|
"ModifyInstanceAttackLogPost": doModifyInstanceAttackLogPost,
|
@@ -8811,7 +9178,7 @@ ACTION_MAP = {
|
|
8811
9178
|
"DescribeDomains": doDescribeDomains,
|
8812
9179
|
"ModifyHostStatus": doModifyHostStatus,
|
8813
9180
|
"DescribeWafThreatenIntelligence": doDescribeWafThreatenIntelligence,
|
8814
|
-
"
|
9181
|
+
"ModifySpartaProtectionMode": doModifySpartaProtectionMode,
|
8815
9182
|
"UpsertIpAccessControl": doUpsertIpAccessControl,
|
8816
9183
|
"CreatePostCLSFlow": doCreatePostCLSFlow,
|
8817
9184
|
"GetAttackHistogram": doGetAttackHistogram,
|
@@ -8829,6 +9196,7 @@ ACTION_MAP = {
|
|
8829
9196
|
"ModifyInstanceRenewFlag": doModifyInstanceRenewFlag,
|
8830
9197
|
"DescribeCCRule": doDescribeCCRule,
|
8831
9198
|
"DescribeUserLevel": doDescribeUserLevel,
|
9199
|
+
"ModifyOwaspRuleTypeAction": doModifyOwaspRuleTypeAction,
|
8832
9200
|
"DescribePeakValue": doDescribePeakValue,
|
8833
9201
|
"ModifyWafThreatenIntelligence": doModifyWafThreatenIntelligence,
|
8834
9202
|
"DeleteAttackDownloadRecord": doDeleteAttackDownloadRecord,
|
@@ -8847,7 +9215,7 @@ ACTION_MAP = {
|
|
8847
9215
|
"DescribeTlsVersion": doDescribeTlsVersion,
|
8848
9216
|
"ModifyProtectionStatus": doModifyProtectionStatus,
|
8849
9217
|
"DescribeCiphersDetail": doDescribeCiphersDetail,
|
8850
|
-
"
|
9218
|
+
"ModifyOwaspRuleTypeLevel": doModifyOwaspRuleTypeLevel,
|
8851
9219
|
"ModifyAreaBanStatus": doModifyAreaBanStatus,
|
8852
9220
|
"ModifyIpAccessControl": doModifyIpAccessControl,
|
8853
9221
|
"DescribeAntiFakeRules": doDescribeAntiFakeRules,
|
@@ -8861,6 +9229,7 @@ ACTION_MAP = {
|
|
8861
9229
|
"CreateIpAccessControl": doCreateIpAccessControl,
|
8862
9230
|
"AddAntiFakeUrl": doAddAntiFakeUrl,
|
8863
9231
|
"DescribeFlowTrend": doDescribeFlowTrend,
|
9232
|
+
"DescribeProtectionModes": doDescribeProtectionModes,
|
8864
9233
|
"DescribeUserClbWafRegions": doDescribeUserClbWafRegions,
|
8865
9234
|
"DescribeObjects": doDescribeObjects,
|
8866
9235
|
"ModifyDomainWhiteRule": doModifyDomainWhiteRule,
|
@@ -8877,6 +9246,7 @@ ACTION_MAP = {
|
|
8877
9246
|
"DestroyPostCLSFlow": doDestroyPostCLSFlow,
|
8878
9247
|
"AddCustomWhiteRule": doAddCustomWhiteRule,
|
8879
9248
|
"DescribeWafAutoDenyRules": doDescribeWafAutoDenyRules,
|
9249
|
+
"DescribeOwaspRules": doDescribeOwaspRules,
|
8880
9250
|
"DeleteSession": doDeleteSession,
|
8881
9251
|
"GenerateDealsAndPayNew": doGenerateDealsAndPayNew,
|
8882
9252
|
"CreateHost": doCreateHost,
|
@@ -8888,16 +9258,18 @@ ACTION_MAP = {
|
|
8888
9258
|
"ModifyUserSignatureRuleV2": doModifyUserSignatureRuleV2,
|
8889
9259
|
"DescribeAccessExports": doDescribeAccessExports,
|
8890
9260
|
"ModifyGenerateDeals": doModifyGenerateDeals,
|
9261
|
+
"DescribeOwaspWhiteRules": doDescribeOwaspWhiteRules,
|
8891
9262
|
"DescribeHostLimit": doDescribeHostLimit,
|
8892
9263
|
"GetInstanceQpsLimit": doGetInstanceQpsLimit,
|
8893
9264
|
"DescribeAreaBanRule": doDescribeAreaBanRule,
|
8894
9265
|
"DeleteAccessExport": doDeleteAccessExport,
|
8895
9266
|
"ModifyAntiInfoLeakRuleStatus": doModifyAntiInfoLeakRuleStatus,
|
8896
9267
|
"DescribeDomainVerifyResult": doDescribeDomainVerifyResult,
|
9268
|
+
"ModifyAttackWhiteRule": doModifyAttackWhiteRule,
|
8897
9269
|
"CreateAccessExport": doCreateAccessExport,
|
8898
9270
|
"SearchAttackLog": doSearchAttackLog,
|
8899
9271
|
"DescribeInstances": doDescribeInstances,
|
8900
|
-
"
|
9272
|
+
"ModifyOwaspRuleTypeStatus": doModifyOwaspRuleTypeStatus,
|
8901
9273
|
"AddCustomRule": doAddCustomRule,
|
8902
9274
|
"ModifyUserSignatureRule": doModifyUserSignatureRule,
|
8903
9275
|
"ModifyHostFlowMode": doModifyHostFlowMode,
|
@@ -8911,12 +9283,11 @@ ACTION_MAP = {
|
|
8911
9283
|
"DescribePorts": doDescribePorts,
|
8912
9284
|
"ModifyHostMode": doModifyHostMode,
|
8913
9285
|
"ModifyDomainPostAction": doModifyDomainPostAction,
|
8914
|
-
"
|
9286
|
+
"DescribeModuleStatus": doDescribeModuleStatus,
|
8915
9287
|
"UpsertCCRule": doUpsertCCRule,
|
8916
9288
|
"ModifyObject": doModifyObject,
|
8917
9289
|
"DeleteAntiFakeUrl": doDeleteAntiFakeUrl,
|
8918
9290
|
"DescribeCCRuleList": doDescribeCCRuleList,
|
8919
|
-
"DeleteCCRule": doDeleteCCRule,
|
8920
9291
|
"ModifyWebshellStatus": doModifyWebshellStatus,
|
8921
9292
|
"DeleteBotSceneUCBRule": doDeleteBotSceneUCBRule,
|
8922
9293
|
"UpsertSession": doUpsertSession,
|