tccli 3.0.1266.1__py2.py3-none-any.whl → 3.0.1267.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/antiddos/v20200309/api.json +12 -6
- tccli/services/antiddos/v20200309/examples.json +2 -2
- tccli/services/ccc/v20200210/api.json +2 -2
- tccli/services/emr/v20190103/api.json +11 -1
- tccli/services/ess/ess_client.py +159 -0
- tccli/services/ess/v20201111/api.json +350 -2
- tccli/services/ess/v20201111/examples.json +36 -0
- tccli/services/gme/v20180711/api.json +77 -39
- tccli/services/gme/v20180711/examples.json +2 -2
- tccli/services/hunyuan/v20230901/api.json +5 -5
- tccli/services/hunyuan/v20230901/examples.json +6 -6
- tccli/services/lcic/v20220817/api.json +18 -18
- tccli/services/lighthouse/v20200324/api.json +10 -10
- tccli/services/live/v20180801/api.json +1 -1
- tccli/services/lkeap/v20240522/api.json +3 -3
- tccli/services/mps/v20190612/api.json +40 -0
- tccli/services/ocr/v20181119/api.json +22 -2
- tccli/services/redis/v20180412/api.json +40 -40
- tccli/services/smop/v20201203/api.json +34 -34
- tccli/services/vms/v20200902/api.json +2 -2
- tccli/services/vpc/v20170312/api.json +997 -9
- tccli/services/vpc/v20170312/examples.json +100 -4
- tccli/services/vpc/vpc_client.py +690 -54
- tccli/services/wedata/v20210820/api.json +79 -3
- {tccli-3.0.1266.1.dist-info → tccli-3.0.1267.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1266.1.dist-info → tccli-3.0.1267.1.dist-info}/RECORD +30 -30
- {tccli-3.0.1266.1.dist-info → tccli-3.0.1267.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1266.1.dist-info → tccli-3.0.1267.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1266.1.dist-info → tccli-3.0.1267.1.dist-info}/license_files/LICENSE +0 -0
tccli/services/vpc/vpc_client.py
CHANGED
@@ -3709,6 +3709,58 @@ def doAddTemplateMember(args, parsed_globals):
|
|
3709
3709
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3710
3710
|
|
3711
3711
|
|
3712
|
+
def doDeleteTrafficMirror(args, parsed_globals):
|
3713
|
+
g_param = parse_global_arg(parsed_globals)
|
3714
|
+
|
3715
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3716
|
+
cred = credential.CVMRoleCredential()
|
3717
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3718
|
+
cred = credential.STSAssumeRoleCredential(
|
3719
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3720
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3721
|
+
)
|
3722
|
+
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):
|
3723
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3724
|
+
else:
|
3725
|
+
cred = credential.Credential(
|
3726
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3727
|
+
)
|
3728
|
+
http_profile = HttpProfile(
|
3729
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3730
|
+
reqMethod="POST",
|
3731
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3732
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3733
|
+
)
|
3734
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3735
|
+
if g_param[OptionsDefine.Language]:
|
3736
|
+
profile.language = g_param[OptionsDefine.Language]
|
3737
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3738
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
3739
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3740
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3741
|
+
model = models.DeleteTrafficMirrorRequest()
|
3742
|
+
model.from_json_string(json.dumps(args))
|
3743
|
+
start_time = time.time()
|
3744
|
+
while True:
|
3745
|
+
rsp = client.DeleteTrafficMirror(model)
|
3746
|
+
result = rsp.to_json_string()
|
3747
|
+
try:
|
3748
|
+
json_obj = json.loads(result)
|
3749
|
+
except TypeError as e:
|
3750
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3751
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3752
|
+
break
|
3753
|
+
cur_time = time.time()
|
3754
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3755
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3756
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3757
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3758
|
+
else:
|
3759
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3760
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3761
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3762
|
+
|
3763
|
+
|
3712
3764
|
def doDeleteHaVip(args, parsed_globals):
|
3713
3765
|
g_param = parse_global_arg(parsed_globals)
|
3714
3766
|
|
@@ -6257,6 +6309,58 @@ def doModifyVpnGatewayRoutes(args, parsed_globals):
|
|
6257
6309
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
6258
6310
|
|
6259
6311
|
|
6312
|
+
def doCheckTrafficMirror(args, parsed_globals):
|
6313
|
+
g_param = parse_global_arg(parsed_globals)
|
6314
|
+
|
6315
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
6316
|
+
cred = credential.CVMRoleCredential()
|
6317
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
6318
|
+
cred = credential.STSAssumeRoleCredential(
|
6319
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
6320
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
6321
|
+
)
|
6322
|
+
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):
|
6323
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
6324
|
+
else:
|
6325
|
+
cred = credential.Credential(
|
6326
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
6327
|
+
)
|
6328
|
+
http_profile = HttpProfile(
|
6329
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
6330
|
+
reqMethod="POST",
|
6331
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
6332
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
6333
|
+
)
|
6334
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
6335
|
+
if g_param[OptionsDefine.Language]:
|
6336
|
+
profile.language = g_param[OptionsDefine.Language]
|
6337
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
6338
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
6339
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
6340
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
6341
|
+
model = models.CheckTrafficMirrorRequest()
|
6342
|
+
model.from_json_string(json.dumps(args))
|
6343
|
+
start_time = time.time()
|
6344
|
+
while True:
|
6345
|
+
rsp = client.CheckTrafficMirror(model)
|
6346
|
+
result = rsp.to_json_string()
|
6347
|
+
try:
|
6348
|
+
json_obj = json.loads(result)
|
6349
|
+
except TypeError as e:
|
6350
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
6351
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
6352
|
+
break
|
6353
|
+
cur_time = time.time()
|
6354
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
6355
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
6356
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
6357
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
6358
|
+
else:
|
6359
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
6360
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
6361
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
6362
|
+
|
6363
|
+
|
6260
6364
|
def doModifyIPv6AddressesBandwidth(args, parsed_globals):
|
6261
6365
|
g_param = parse_global_arg(parsed_globals)
|
6262
6366
|
|
@@ -8285,6 +8389,58 @@ def doDisableFlowLogs(args, parsed_globals):
|
|
8285
8389
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
8286
8390
|
|
8287
8391
|
|
8392
|
+
def doResetTrafficMirrorFilter(args, parsed_globals):
|
8393
|
+
g_param = parse_global_arg(parsed_globals)
|
8394
|
+
|
8395
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
8396
|
+
cred = credential.CVMRoleCredential()
|
8397
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
8398
|
+
cred = credential.STSAssumeRoleCredential(
|
8399
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
8400
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
8401
|
+
)
|
8402
|
+
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):
|
8403
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
8404
|
+
else:
|
8405
|
+
cred = credential.Credential(
|
8406
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
8407
|
+
)
|
8408
|
+
http_profile = HttpProfile(
|
8409
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
8410
|
+
reqMethod="POST",
|
8411
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
8412
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
8413
|
+
)
|
8414
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
8415
|
+
if g_param[OptionsDefine.Language]:
|
8416
|
+
profile.language = g_param[OptionsDefine.Language]
|
8417
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
8418
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
8419
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
8420
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
8421
|
+
model = models.ResetTrafficMirrorFilterRequest()
|
8422
|
+
model.from_json_string(json.dumps(args))
|
8423
|
+
start_time = time.time()
|
8424
|
+
while True:
|
8425
|
+
rsp = client.ResetTrafficMirrorFilter(model)
|
8426
|
+
result = rsp.to_json_string()
|
8427
|
+
try:
|
8428
|
+
json_obj = json.loads(result)
|
8429
|
+
except TypeError as e:
|
8430
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
8431
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
8432
|
+
break
|
8433
|
+
cur_time = time.time()
|
8434
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
8435
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
8436
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
8437
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
8438
|
+
else:
|
8439
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
8440
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
8441
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
8442
|
+
|
8443
|
+
|
8288
8444
|
def doCreateCustomerGateway(args, parsed_globals):
|
8289
8445
|
g_param = parse_global_arg(parsed_globals)
|
8290
8446
|
|
@@ -8337,6 +8493,58 @@ def doCreateCustomerGateway(args, parsed_globals):
|
|
8337
8493
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
8338
8494
|
|
8339
8495
|
|
8496
|
+
def doCreateTrafficMirror(args, parsed_globals):
|
8497
|
+
g_param = parse_global_arg(parsed_globals)
|
8498
|
+
|
8499
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
8500
|
+
cred = credential.CVMRoleCredential()
|
8501
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
8502
|
+
cred = credential.STSAssumeRoleCredential(
|
8503
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
8504
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
8505
|
+
)
|
8506
|
+
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):
|
8507
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
8508
|
+
else:
|
8509
|
+
cred = credential.Credential(
|
8510
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
8511
|
+
)
|
8512
|
+
http_profile = HttpProfile(
|
8513
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
8514
|
+
reqMethod="POST",
|
8515
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
8516
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
8517
|
+
)
|
8518
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
8519
|
+
if g_param[OptionsDefine.Language]:
|
8520
|
+
profile.language = g_param[OptionsDefine.Language]
|
8521
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
8522
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
8523
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
8524
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
8525
|
+
model = models.CreateTrafficMirrorRequest()
|
8526
|
+
model.from_json_string(json.dumps(args))
|
8527
|
+
start_time = time.time()
|
8528
|
+
while True:
|
8529
|
+
rsp = client.CreateTrafficMirror(model)
|
8530
|
+
result = rsp.to_json_string()
|
8531
|
+
try:
|
8532
|
+
json_obj = json.loads(result)
|
8533
|
+
except TypeError as e:
|
8534
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
8535
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
8536
|
+
break
|
8537
|
+
cur_time = time.time()
|
8538
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
8539
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
8540
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
8541
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
8542
|
+
else:
|
8543
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
8544
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
8545
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
8546
|
+
|
8547
|
+
|
8340
8548
|
def doAuditCrossBorderCompliance(args, parsed_globals):
|
8341
8549
|
g_param = parse_global_arg(parsed_globals)
|
8342
8550
|
|
@@ -9377,7 +9585,7 @@ def doModifyNetDetect(args, parsed_globals):
|
|
9377
9585
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
9378
9586
|
|
9379
9587
|
|
9380
|
-
def
|
9588
|
+
def doDescribeBandwidthPackageQuota(args, parsed_globals):
|
9381
9589
|
g_param = parse_global_arg(parsed_globals)
|
9382
9590
|
|
9383
9591
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -9406,11 +9614,11 @@ def doCreateNetDetect(args, parsed_globals):
|
|
9406
9614
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
9407
9615
|
client._sdkVersion += ("_CLI_" + __version__)
|
9408
9616
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
9409
|
-
model = models.
|
9617
|
+
model = models.DescribeBandwidthPackageQuotaRequest()
|
9410
9618
|
model.from_json_string(json.dumps(args))
|
9411
9619
|
start_time = time.time()
|
9412
9620
|
while True:
|
9413
|
-
rsp = client.
|
9621
|
+
rsp = client.DescribeBandwidthPackageQuota(model)
|
9414
9622
|
result = rsp.to_json_string()
|
9415
9623
|
try:
|
9416
9624
|
json_obj = json.loads(result)
|
@@ -9429,7 +9637,7 @@ def doCreateNetDetect(args, parsed_globals):
|
|
9429
9637
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
9430
9638
|
|
9431
9639
|
|
9432
|
-
def
|
9640
|
+
def doCreateSnapshotPolicies(args, parsed_globals):
|
9433
9641
|
g_param = parse_global_arg(parsed_globals)
|
9434
9642
|
|
9435
9643
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -9458,11 +9666,11 @@ def doReleaseIPv6Addresses(args, parsed_globals):
|
|
9458
9666
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
9459
9667
|
client._sdkVersion += ("_CLI_" + __version__)
|
9460
9668
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
9461
|
-
model = models.
|
9669
|
+
model = models.CreateSnapshotPoliciesRequest()
|
9462
9670
|
model.from_json_string(json.dumps(args))
|
9463
9671
|
start_time = time.time()
|
9464
9672
|
while True:
|
9465
|
-
rsp = client.
|
9673
|
+
rsp = client.CreateSnapshotPolicies(model)
|
9466
9674
|
result = rsp.to_json_string()
|
9467
9675
|
try:
|
9468
9676
|
json_obj = json.loads(result)
|
@@ -10365,7 +10573,7 @@ def doCreateNetworkAcl(args, parsed_globals):
|
|
10365
10573
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
10366
10574
|
|
10367
10575
|
|
10368
|
-
def
|
10576
|
+
def doUpdateTrafficMirrorAllFilter(args, parsed_globals):
|
10369
10577
|
g_param = parse_global_arg(parsed_globals)
|
10370
10578
|
|
10371
10579
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -10394,11 +10602,11 @@ def doCreateBandwidthPackage(args, parsed_globals):
|
|
10394
10602
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
10395
10603
|
client._sdkVersion += ("_CLI_" + __version__)
|
10396
10604
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
10397
|
-
model = models.
|
10605
|
+
model = models.UpdateTrafficMirrorAllFilterRequest()
|
10398
10606
|
model.from_json_string(json.dumps(args))
|
10399
10607
|
start_time = time.time()
|
10400
10608
|
while True:
|
10401
|
-
rsp = client.
|
10609
|
+
rsp = client.UpdateTrafficMirrorAllFilter(model)
|
10402
10610
|
result = rsp.to_json_string()
|
10403
10611
|
try:
|
10404
10612
|
json_obj = json.loads(result)
|
@@ -10417,7 +10625,7 @@ def doCreateBandwidthPackage(args, parsed_globals):
|
|
10417
10625
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
10418
10626
|
|
10419
10627
|
|
10420
|
-
def
|
10628
|
+
def doCreateBandwidthPackage(args, parsed_globals):
|
10421
10629
|
g_param = parse_global_arg(parsed_globals)
|
10422
10630
|
|
10423
10631
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -10446,11 +10654,11 @@ def doDeleteFlowLog(args, parsed_globals):
|
|
10446
10654
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
10447
10655
|
client._sdkVersion += ("_CLI_" + __version__)
|
10448
10656
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
10449
|
-
model = models.
|
10657
|
+
model = models.CreateBandwidthPackageRequest()
|
10450
10658
|
model.from_json_string(json.dumps(args))
|
10451
10659
|
start_time = time.time()
|
10452
10660
|
while True:
|
10453
|
-
rsp = client.
|
10661
|
+
rsp = client.CreateBandwidthPackage(model)
|
10454
10662
|
result = rsp.to_json_string()
|
10455
10663
|
try:
|
10456
10664
|
json_obj = json.loads(result)
|
@@ -10469,7 +10677,7 @@ def doDeleteFlowLog(args, parsed_globals):
|
|
10469
10677
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
10470
10678
|
|
10471
10679
|
|
10472
|
-
def
|
10680
|
+
def doDeleteFlowLog(args, parsed_globals):
|
10473
10681
|
g_param = parse_global_arg(parsed_globals)
|
10474
10682
|
|
10475
10683
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -10498,11 +10706,11 @@ def doReplaceRouteTableAssociation(args, parsed_globals):
|
|
10498
10706
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
10499
10707
|
client._sdkVersion += ("_CLI_" + __version__)
|
10500
10708
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
10501
|
-
model = models.
|
10709
|
+
model = models.DeleteFlowLogRequest()
|
10502
10710
|
model.from_json_string(json.dumps(args))
|
10503
10711
|
start_time = time.time()
|
10504
10712
|
while True:
|
10505
|
-
rsp = client.
|
10713
|
+
rsp = client.DeleteFlowLog(model)
|
10506
10714
|
result = rsp.to_json_string()
|
10507
10715
|
try:
|
10508
10716
|
json_obj = json.loads(result)
|
@@ -10521,7 +10729,7 @@ def doReplaceRouteTableAssociation(args, parsed_globals):
|
|
10521
10729
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
10522
10730
|
|
10523
10731
|
|
10524
|
-
def
|
10732
|
+
def doReplaceRouteTableAssociation(args, parsed_globals):
|
10525
10733
|
g_param = parse_global_arg(parsed_globals)
|
10526
10734
|
|
10527
10735
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -10550,11 +10758,11 @@ def doDeleteVpnGatewaySslServer(args, parsed_globals):
|
|
10550
10758
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
10551
10759
|
client._sdkVersion += ("_CLI_" + __version__)
|
10552
10760
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
10553
|
-
model = models.
|
10761
|
+
model = models.ReplaceRouteTableAssociationRequest()
|
10554
10762
|
model.from_json_string(json.dumps(args))
|
10555
10763
|
start_time = time.time()
|
10556
10764
|
while True:
|
10557
|
-
rsp = client.
|
10765
|
+
rsp = client.ReplaceRouteTableAssociation(model)
|
10558
10766
|
result = rsp.to_json_string()
|
10559
10767
|
try:
|
10560
10768
|
json_obj = json.loads(result)
|
@@ -10573,7 +10781,7 @@ def doDeleteVpnGatewaySslServer(args, parsed_globals):
|
|
10573
10781
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
10574
10782
|
|
10575
10783
|
|
10576
|
-
def
|
10784
|
+
def doDeleteVpnGatewaySslServer(args, parsed_globals):
|
10577
10785
|
g_param = parse_global_arg(parsed_globals)
|
10578
10786
|
|
10579
10787
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -10602,11 +10810,11 @@ def doDescribeNetworkInterfaceLimit(args, parsed_globals):
|
|
10602
10810
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
10603
10811
|
client._sdkVersion += ("_CLI_" + __version__)
|
10604
10812
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
10605
|
-
model = models.
|
10813
|
+
model = models.DeleteVpnGatewaySslServerRequest()
|
10606
10814
|
model.from_json_string(json.dumps(args))
|
10607
10815
|
start_time = time.time()
|
10608
10816
|
while True:
|
10609
|
-
rsp = client.
|
10817
|
+
rsp = client.DeleteVpnGatewaySslServer(model)
|
10610
10818
|
result = rsp.to_json_string()
|
10611
10819
|
try:
|
10612
10820
|
json_obj = json.loads(result)
|
@@ -10625,7 +10833,7 @@ def doDescribeNetworkInterfaceLimit(args, parsed_globals):
|
|
10625
10833
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
10626
10834
|
|
10627
10835
|
|
10628
|
-
def
|
10836
|
+
def doDescribeNetworkInterfaceLimit(args, parsed_globals):
|
10629
10837
|
g_param = parse_global_arg(parsed_globals)
|
10630
10838
|
|
10631
10839
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -10654,11 +10862,11 @@ def doEnableSnapshotPolicies(args, parsed_globals):
|
|
10654
10862
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
10655
10863
|
client._sdkVersion += ("_CLI_" + __version__)
|
10656
10864
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
10657
|
-
model = models.
|
10865
|
+
model = models.DescribeNetworkInterfaceLimitRequest()
|
10658
10866
|
model.from_json_string(json.dumps(args))
|
10659
10867
|
start_time = time.time()
|
10660
10868
|
while True:
|
10661
|
-
rsp = client.
|
10869
|
+
rsp = client.DescribeNetworkInterfaceLimit(model)
|
10662
10870
|
result = rsp.to_json_string()
|
10663
10871
|
try:
|
10664
10872
|
json_obj = json.loads(result)
|
@@ -10677,7 +10885,7 @@ def doEnableSnapshotPolicies(args, parsed_globals):
|
|
10677
10885
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
10678
10886
|
|
10679
10887
|
|
10680
|
-
def
|
10888
|
+
def doEnableSnapshotPolicies(args, parsed_globals):
|
10681
10889
|
g_param = parse_global_arg(parsed_globals)
|
10682
10890
|
|
10683
10891
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -10706,11 +10914,11 @@ def doDescribeUsedIpAddress(args, parsed_globals):
|
|
10706
10914
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
10707
10915
|
client._sdkVersion += ("_CLI_" + __version__)
|
10708
10916
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
10709
|
-
model = models.
|
10917
|
+
model = models.EnableSnapshotPoliciesRequest()
|
10710
10918
|
model.from_json_string(json.dumps(args))
|
10711
10919
|
start_time = time.time()
|
10712
10920
|
while True:
|
10713
|
-
rsp = client.
|
10921
|
+
rsp = client.EnableSnapshotPolicies(model)
|
10714
10922
|
result = rsp.to_json_string()
|
10715
10923
|
try:
|
10716
10924
|
json_obj = json.loads(result)
|
@@ -10729,7 +10937,7 @@ def doDescribeUsedIpAddress(args, parsed_globals):
|
|
10729
10937
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
10730
10938
|
|
10731
10939
|
|
10732
|
-
def
|
10940
|
+
def doDescribeUsedIpAddress(args, parsed_globals):
|
10733
10941
|
g_param = parse_global_arg(parsed_globals)
|
10734
10942
|
|
10735
10943
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -10758,11 +10966,11 @@ def doDescribeCustomerGatewayVendors(args, parsed_globals):
|
|
10758
10966
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
10759
10967
|
client._sdkVersion += ("_CLI_" + __version__)
|
10760
10968
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
10761
|
-
model = models.
|
10969
|
+
model = models.DescribeUsedIpAddressRequest()
|
10762
10970
|
model.from_json_string(json.dumps(args))
|
10763
10971
|
start_time = time.time()
|
10764
10972
|
while True:
|
10765
|
-
rsp = client.
|
10973
|
+
rsp = client.DescribeUsedIpAddress(model)
|
10766
10974
|
result = rsp.to_json_string()
|
10767
10975
|
try:
|
10768
10976
|
json_obj = json.loads(result)
|
@@ -10781,7 +10989,7 @@ def doDescribeCustomerGatewayVendors(args, parsed_globals):
|
|
10781
10989
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
10782
10990
|
|
10783
10991
|
|
10784
|
-
def
|
10992
|
+
def doDescribeCustomerGatewayVendors(args, parsed_globals):
|
10785
10993
|
g_param = parse_global_arg(parsed_globals)
|
10786
10994
|
|
10787
10995
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -10810,7 +11018,59 @@ def doDeleteCdcNetPlanes(args, parsed_globals):
|
|
10810
11018
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
10811
11019
|
client._sdkVersion += ("_CLI_" + __version__)
|
10812
11020
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
10813
|
-
model = models.
|
11021
|
+
model = models.DescribeCustomerGatewayVendorsRequest()
|
11022
|
+
model.from_json_string(json.dumps(args))
|
11023
|
+
start_time = time.time()
|
11024
|
+
while True:
|
11025
|
+
rsp = client.DescribeCustomerGatewayVendors(model)
|
11026
|
+
result = rsp.to_json_string()
|
11027
|
+
try:
|
11028
|
+
json_obj = json.loads(result)
|
11029
|
+
except TypeError as e:
|
11030
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
11031
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
11032
|
+
break
|
11033
|
+
cur_time = time.time()
|
11034
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
11035
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
11036
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
11037
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
11038
|
+
else:
|
11039
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
11040
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
11041
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
11042
|
+
|
11043
|
+
|
11044
|
+
def doDeleteCdcNetPlanes(args, parsed_globals):
|
11045
|
+
g_param = parse_global_arg(parsed_globals)
|
11046
|
+
|
11047
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
11048
|
+
cred = credential.CVMRoleCredential()
|
11049
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
11050
|
+
cred = credential.STSAssumeRoleCredential(
|
11051
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
11052
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
11053
|
+
)
|
11054
|
+
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):
|
11055
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
11056
|
+
else:
|
11057
|
+
cred = credential.Credential(
|
11058
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
11059
|
+
)
|
11060
|
+
http_profile = HttpProfile(
|
11061
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
11062
|
+
reqMethod="POST",
|
11063
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
11064
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
11065
|
+
)
|
11066
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
11067
|
+
if g_param[OptionsDefine.Language]:
|
11068
|
+
profile.language = g_param[OptionsDefine.Language]
|
11069
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
11070
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
11071
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
11072
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
11073
|
+
model = models.DeleteCdcNetPlanesRequest()
|
10814
11074
|
model.from_json_string(json.dumps(args))
|
10815
11075
|
start_time = time.time()
|
10816
11076
|
while True:
|
@@ -11145,6 +11405,58 @@ def doReplaceSecurityGroupPolicies(args, parsed_globals):
|
|
11145
11405
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
11146
11406
|
|
11147
11407
|
|
11408
|
+
def doDescribeTrafficMirrors(args, parsed_globals):
|
11409
|
+
g_param = parse_global_arg(parsed_globals)
|
11410
|
+
|
11411
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
11412
|
+
cred = credential.CVMRoleCredential()
|
11413
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
11414
|
+
cred = credential.STSAssumeRoleCredential(
|
11415
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
11416
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
11417
|
+
)
|
11418
|
+
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):
|
11419
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
11420
|
+
else:
|
11421
|
+
cred = credential.Credential(
|
11422
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
11423
|
+
)
|
11424
|
+
http_profile = HttpProfile(
|
11425
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
11426
|
+
reqMethod="POST",
|
11427
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
11428
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
11429
|
+
)
|
11430
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
11431
|
+
if g_param[OptionsDefine.Language]:
|
11432
|
+
profile.language = g_param[OptionsDefine.Language]
|
11433
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
11434
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
11435
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
11436
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
11437
|
+
model = models.DescribeTrafficMirrorsRequest()
|
11438
|
+
model.from_json_string(json.dumps(args))
|
11439
|
+
start_time = time.time()
|
11440
|
+
while True:
|
11441
|
+
rsp = client.DescribeTrafficMirrors(model)
|
11442
|
+
result = rsp.to_json_string()
|
11443
|
+
try:
|
11444
|
+
json_obj = json.loads(result)
|
11445
|
+
except TypeError as e:
|
11446
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
11447
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
11448
|
+
break
|
11449
|
+
cur_time = time.time()
|
11450
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
11451
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
11452
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
11453
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
11454
|
+
else:
|
11455
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
11456
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
11457
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
11458
|
+
|
11459
|
+
|
11148
11460
|
def doDeleteRouteTable(args, parsed_globals):
|
11149
11461
|
g_param = parse_global_arg(parsed_globals)
|
11150
11462
|
|
@@ -15929,6 +16241,58 @@ def doDescribeNatGateways(args, parsed_globals):
|
|
15929
16241
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
15930
16242
|
|
15931
16243
|
|
16244
|
+
def doModifyTrafficMirrorAttribute(args, parsed_globals):
|
16245
|
+
g_param = parse_global_arg(parsed_globals)
|
16246
|
+
|
16247
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
16248
|
+
cred = credential.CVMRoleCredential()
|
16249
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
16250
|
+
cred = credential.STSAssumeRoleCredential(
|
16251
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
16252
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
16253
|
+
)
|
16254
|
+
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):
|
16255
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
16256
|
+
else:
|
16257
|
+
cred = credential.Credential(
|
16258
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
16259
|
+
)
|
16260
|
+
http_profile = HttpProfile(
|
16261
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
16262
|
+
reqMethod="POST",
|
16263
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
16264
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
16265
|
+
)
|
16266
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
16267
|
+
if g_param[OptionsDefine.Language]:
|
16268
|
+
profile.language = g_param[OptionsDefine.Language]
|
16269
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
16270
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
16271
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
16272
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
16273
|
+
model = models.ModifyTrafficMirrorAttributeRequest()
|
16274
|
+
model.from_json_string(json.dumps(args))
|
16275
|
+
start_time = time.time()
|
16276
|
+
while True:
|
16277
|
+
rsp = client.ModifyTrafficMirrorAttribute(model)
|
16278
|
+
result = rsp.to_json_string()
|
16279
|
+
try:
|
16280
|
+
json_obj = json.loads(result)
|
16281
|
+
except TypeError as e:
|
16282
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
16283
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
16284
|
+
break
|
16285
|
+
cur_time = time.time()
|
16286
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
16287
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
16288
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
16289
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
16290
|
+
else:
|
16291
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
16292
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
16293
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
16294
|
+
|
16295
|
+
|
15932
16296
|
def doResetHighPriorityRoutes(args, parsed_globals):
|
15933
16297
|
g_param = parse_global_arg(parsed_globals)
|
15934
16298
|
|
@@ -17229,6 +17593,110 @@ def doModifyCcnAttachedInstancesAttribute(args, parsed_globals):
|
|
17229
17593
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
17230
17594
|
|
17231
17595
|
|
17596
|
+
def doResetTrafficMirrorTarget(args, parsed_globals):
|
17597
|
+
g_param = parse_global_arg(parsed_globals)
|
17598
|
+
|
17599
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
17600
|
+
cred = credential.CVMRoleCredential()
|
17601
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
17602
|
+
cred = credential.STSAssumeRoleCredential(
|
17603
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
17604
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
17605
|
+
)
|
17606
|
+
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):
|
17607
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
17608
|
+
else:
|
17609
|
+
cred = credential.Credential(
|
17610
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
17611
|
+
)
|
17612
|
+
http_profile = HttpProfile(
|
17613
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
17614
|
+
reqMethod="POST",
|
17615
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
17616
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
17617
|
+
)
|
17618
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
17619
|
+
if g_param[OptionsDefine.Language]:
|
17620
|
+
profile.language = g_param[OptionsDefine.Language]
|
17621
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
17622
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
17623
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
17624
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
17625
|
+
model = models.ResetTrafficMirrorTargetRequest()
|
17626
|
+
model.from_json_string(json.dumps(args))
|
17627
|
+
start_time = time.time()
|
17628
|
+
while True:
|
17629
|
+
rsp = client.ResetTrafficMirrorTarget(model)
|
17630
|
+
result = rsp.to_json_string()
|
17631
|
+
try:
|
17632
|
+
json_obj = json.loads(result)
|
17633
|
+
except TypeError as e:
|
17634
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
17635
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
17636
|
+
break
|
17637
|
+
cur_time = time.time()
|
17638
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
17639
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
17640
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
17641
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
17642
|
+
else:
|
17643
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
17644
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
17645
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
17646
|
+
|
17647
|
+
|
17648
|
+
def doDescribeSecurityGroupReferences(args, parsed_globals):
|
17649
|
+
g_param = parse_global_arg(parsed_globals)
|
17650
|
+
|
17651
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
17652
|
+
cred = credential.CVMRoleCredential()
|
17653
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
17654
|
+
cred = credential.STSAssumeRoleCredential(
|
17655
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
17656
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
17657
|
+
)
|
17658
|
+
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):
|
17659
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
17660
|
+
else:
|
17661
|
+
cred = credential.Credential(
|
17662
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
17663
|
+
)
|
17664
|
+
http_profile = HttpProfile(
|
17665
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
17666
|
+
reqMethod="POST",
|
17667
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
17668
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
17669
|
+
)
|
17670
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
17671
|
+
if g_param[OptionsDefine.Language]:
|
17672
|
+
profile.language = g_param[OptionsDefine.Language]
|
17673
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
17674
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
17675
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
17676
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
17677
|
+
model = models.DescribeSecurityGroupReferencesRequest()
|
17678
|
+
model.from_json_string(json.dumps(args))
|
17679
|
+
start_time = time.time()
|
17680
|
+
while True:
|
17681
|
+
rsp = client.DescribeSecurityGroupReferences(model)
|
17682
|
+
result = rsp.to_json_string()
|
17683
|
+
try:
|
17684
|
+
json_obj = json.loads(result)
|
17685
|
+
except TypeError as e:
|
17686
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
17687
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
17688
|
+
break
|
17689
|
+
cur_time = time.time()
|
17690
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
17691
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
17692
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
17693
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
17694
|
+
else:
|
17695
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
17696
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
17697
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
17698
|
+
|
17699
|
+
|
17232
17700
|
def doDeleteNatGateway(args, parsed_globals):
|
17233
17701
|
g_param = parse_global_arg(parsed_globals)
|
17234
17702
|
|
@@ -17385,7 +17853,7 @@ def doModifyIpv6AddressesAttribute(args, parsed_globals):
|
|
17385
17853
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
17386
17854
|
|
17387
17855
|
|
17388
|
-
def
|
17856
|
+
def doCreateNetDetect(args, parsed_globals):
|
17389
17857
|
g_param = parse_global_arg(parsed_globals)
|
17390
17858
|
|
17391
17859
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -17414,11 +17882,11 @@ def doDescribeBandwidthPackageQuota(args, parsed_globals):
|
|
17414
17882
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
17415
17883
|
client._sdkVersion += ("_CLI_" + __version__)
|
17416
17884
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
17417
|
-
model = models.
|
17885
|
+
model = models.CreateNetDetectRequest()
|
17418
17886
|
model.from_json_string(json.dumps(args))
|
17419
17887
|
start_time = time.time()
|
17420
17888
|
while True:
|
17421
|
-
rsp = client.
|
17889
|
+
rsp = client.CreateNetDetect(model)
|
17422
17890
|
result = rsp.to_json_string()
|
17423
17891
|
try:
|
17424
17892
|
json_obj = json.loads(result)
|
@@ -17489,7 +17957,7 @@ def doModifyHighPriorityRouteTableAttribute(args, parsed_globals):
|
|
17489
17957
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
17490
17958
|
|
17491
17959
|
|
17492
|
-
def
|
17960
|
+
def doReleaseIPv6Addresses(args, parsed_globals):
|
17493
17961
|
g_param = parse_global_arg(parsed_globals)
|
17494
17962
|
|
17495
17963
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -17518,11 +17986,11 @@ def doCreateSnapshotPolicies(args, parsed_globals):
|
|
17518
17986
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
17519
17987
|
client._sdkVersion += ("_CLI_" + __version__)
|
17520
17988
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
17521
|
-
model = models.
|
17989
|
+
model = models.ReleaseIPv6AddressesRequest()
|
17522
17990
|
model.from_json_string(json.dumps(args))
|
17523
17991
|
start_time = time.time()
|
17524
17992
|
while True:
|
17525
|
-
rsp = client.
|
17993
|
+
rsp = client.ReleaseIPv6Addresses(model)
|
17526
17994
|
result = rsp.to_json_string()
|
17527
17995
|
try:
|
17528
17996
|
json_obj = json.loads(result)
|
@@ -18165,7 +18633,7 @@ def doDescribeCdcUsedIdcVlan(args, parsed_globals):
|
|
18165
18633
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
18166
18634
|
|
18167
18635
|
|
18168
|
-
def
|
18636
|
+
def doStopTrafficMirror(args, parsed_globals):
|
18169
18637
|
g_param = parse_global_arg(parsed_globals)
|
18170
18638
|
|
18171
18639
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -18194,11 +18662,11 @@ def doDescribeSecurityGroupReferences(args, parsed_globals):
|
|
18194
18662
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
18195
18663
|
client._sdkVersion += ("_CLI_" + __version__)
|
18196
18664
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
18197
|
-
model = models.
|
18665
|
+
model = models.StopTrafficMirrorRequest()
|
18198
18666
|
model.from_json_string(json.dumps(args))
|
18199
18667
|
start_time = time.time()
|
18200
18668
|
while True:
|
18201
|
-
rsp = client.
|
18669
|
+
rsp = client.StopTrafficMirror(model)
|
18202
18670
|
result = rsp.to_json_string()
|
18203
18671
|
try:
|
18204
18672
|
json_obj = json.loads(result)
|
@@ -18893,6 +19361,110 @@ def doDescribeAddressQuota(args, parsed_globals):
|
|
18893
19361
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
18894
19362
|
|
18895
19363
|
|
19364
|
+
def doUpdateTrafficMirrorDirection(args, parsed_globals):
|
19365
|
+
g_param = parse_global_arg(parsed_globals)
|
19366
|
+
|
19367
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
19368
|
+
cred = credential.CVMRoleCredential()
|
19369
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
19370
|
+
cred = credential.STSAssumeRoleCredential(
|
19371
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
19372
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
19373
|
+
)
|
19374
|
+
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):
|
19375
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
19376
|
+
else:
|
19377
|
+
cred = credential.Credential(
|
19378
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
19379
|
+
)
|
19380
|
+
http_profile = HttpProfile(
|
19381
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
19382
|
+
reqMethod="POST",
|
19383
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
19384
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
19385
|
+
)
|
19386
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
19387
|
+
if g_param[OptionsDefine.Language]:
|
19388
|
+
profile.language = g_param[OptionsDefine.Language]
|
19389
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
19390
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
19391
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
19392
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
19393
|
+
model = models.UpdateTrafficMirrorDirectionRequest()
|
19394
|
+
model.from_json_string(json.dumps(args))
|
19395
|
+
start_time = time.time()
|
19396
|
+
while True:
|
19397
|
+
rsp = client.UpdateTrafficMirrorDirection(model)
|
19398
|
+
result = rsp.to_json_string()
|
19399
|
+
try:
|
19400
|
+
json_obj = json.loads(result)
|
19401
|
+
except TypeError as e:
|
19402
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
19403
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
19404
|
+
break
|
19405
|
+
cur_time = time.time()
|
19406
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
19407
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
19408
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
19409
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
19410
|
+
else:
|
19411
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
19412
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
19413
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
19414
|
+
|
19415
|
+
|
19416
|
+
def doStartTrafficMirror(args, parsed_globals):
|
19417
|
+
g_param = parse_global_arg(parsed_globals)
|
19418
|
+
|
19419
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
19420
|
+
cred = credential.CVMRoleCredential()
|
19421
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
19422
|
+
cred = credential.STSAssumeRoleCredential(
|
19423
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
19424
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
19425
|
+
)
|
19426
|
+
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):
|
19427
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
19428
|
+
else:
|
19429
|
+
cred = credential.Credential(
|
19430
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
19431
|
+
)
|
19432
|
+
http_profile = HttpProfile(
|
19433
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
19434
|
+
reqMethod="POST",
|
19435
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
19436
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
19437
|
+
)
|
19438
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
19439
|
+
if g_param[OptionsDefine.Language]:
|
19440
|
+
profile.language = g_param[OptionsDefine.Language]
|
19441
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
19442
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
19443
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
19444
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
19445
|
+
model = models.StartTrafficMirrorRequest()
|
19446
|
+
model.from_json_string(json.dumps(args))
|
19447
|
+
start_time = time.time()
|
19448
|
+
while True:
|
19449
|
+
rsp = client.StartTrafficMirror(model)
|
19450
|
+
result = rsp.to_json_string()
|
19451
|
+
try:
|
19452
|
+
json_obj = json.loads(result)
|
19453
|
+
except TypeError as e:
|
19454
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
19455
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
19456
|
+
break
|
19457
|
+
cur_time = time.time()
|
19458
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
19459
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
19460
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
19461
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
19462
|
+
else:
|
19463
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
19464
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
19465
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
19466
|
+
|
19467
|
+
|
18896
19468
|
def doCreateCcn(args, parsed_globals):
|
18897
19469
|
g_param = parse_global_arg(parsed_globals)
|
18898
19470
|
|
@@ -19621,7 +20193,7 @@ def doCreateDhcpIp(args, parsed_globals):
|
|
19621
20193
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
19622
20194
|
|
19623
20195
|
|
19624
|
-
def
|
20196
|
+
def doDescribeCdcNetPlanes(args, parsed_globals):
|
19625
20197
|
g_param = parse_global_arg(parsed_globals)
|
19626
20198
|
|
19627
20199
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -19650,11 +20222,11 @@ def doModifyVpcAttribute(args, parsed_globals):
|
|
19650
20222
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
19651
20223
|
client._sdkVersion += ("_CLI_" + __version__)
|
19652
20224
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
19653
|
-
model = models.
|
20225
|
+
model = models.DescribeCdcNetPlanesRequest()
|
19654
20226
|
model.from_json_string(json.dumps(args))
|
19655
20227
|
start_time = time.time()
|
19656
20228
|
while True:
|
19657
|
-
rsp = client.
|
20229
|
+
rsp = client.DescribeCdcNetPlanes(model)
|
19658
20230
|
result = rsp.to_json_string()
|
19659
20231
|
try:
|
19660
20232
|
json_obj = json.loads(result)
|
@@ -19985,6 +20557,58 @@ def doCreateSecurityGroupWithPolicies(args, parsed_globals):
|
|
19985
20557
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
19986
20558
|
|
19987
20559
|
|
20560
|
+
def doResetTrafficMirrorSrcs(args, parsed_globals):
|
20561
|
+
g_param = parse_global_arg(parsed_globals)
|
20562
|
+
|
20563
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
20564
|
+
cred = credential.CVMRoleCredential()
|
20565
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
20566
|
+
cred = credential.STSAssumeRoleCredential(
|
20567
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
20568
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
20569
|
+
)
|
20570
|
+
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):
|
20571
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
20572
|
+
else:
|
20573
|
+
cred = credential.Credential(
|
20574
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
20575
|
+
)
|
20576
|
+
http_profile = HttpProfile(
|
20577
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
20578
|
+
reqMethod="POST",
|
20579
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
20580
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
20581
|
+
)
|
20582
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
20583
|
+
if g_param[OptionsDefine.Language]:
|
20584
|
+
profile.language = g_param[OptionsDefine.Language]
|
20585
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
20586
|
+
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
20587
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
20588
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
20589
|
+
model = models.ResetTrafficMirrorSrcsRequest()
|
20590
|
+
model.from_json_string(json.dumps(args))
|
20591
|
+
start_time = time.time()
|
20592
|
+
while True:
|
20593
|
+
rsp = client.ResetTrafficMirrorSrcs(model)
|
20594
|
+
result = rsp.to_json_string()
|
20595
|
+
try:
|
20596
|
+
json_obj = json.loads(result)
|
20597
|
+
except TypeError as e:
|
20598
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
20599
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
20600
|
+
break
|
20601
|
+
cur_time = time.time()
|
20602
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
20603
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
20604
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
20605
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
20606
|
+
else:
|
20607
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
20608
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
20609
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
20610
|
+
|
20611
|
+
|
19988
20612
|
def doReturnNormalAddresses(args, parsed_globals):
|
19989
20613
|
g_param = parse_global_arg(parsed_globals)
|
19990
20614
|
|
@@ -20037,7 +20661,7 @@ def doReturnNormalAddresses(args, parsed_globals):
|
|
20037
20661
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
20038
20662
|
|
20039
20663
|
|
20040
|
-
def
|
20664
|
+
def doModifyVpcAttribute(args, parsed_globals):
|
20041
20665
|
g_param = parse_global_arg(parsed_globals)
|
20042
20666
|
|
20043
20667
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -20066,11 +20690,11 @@ def doDescribeCdcNetPlanes(args, parsed_globals):
|
|
20066
20690
|
client = mod.VpcClient(cred, g_param[OptionsDefine.Region], profile)
|
20067
20691
|
client._sdkVersion += ("_CLI_" + __version__)
|
20068
20692
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
20069
|
-
model = models.
|
20693
|
+
model = models.ModifyVpcAttributeRequest()
|
20070
20694
|
model.from_json_string(json.dumps(args))
|
20071
20695
|
start_time = time.time()
|
20072
20696
|
while True:
|
20073
|
-
rsp = client.
|
20697
|
+
rsp = client.ModifyVpcAttribute(model)
|
20074
20698
|
result = rsp.to_json_string()
|
20075
20699
|
try:
|
20076
20700
|
json_obj = json.loads(result)
|
@@ -20275,6 +20899,7 @@ ACTION_MAP = {
|
|
20275
20899
|
"ModifyVpcPeeringConnection": doModifyVpcPeeringConnection,
|
20276
20900
|
"DescribeVpcLimits": doDescribeVpcLimits,
|
20277
20901
|
"AddTemplateMember": doAddTemplateMember,
|
20902
|
+
"DeleteTrafficMirror": doDeleteTrafficMirror,
|
20278
20903
|
"DeleteHaVip": doDeleteHaVip,
|
20279
20904
|
"DescribeProductQuota": doDescribeProductQuota,
|
20280
20905
|
"ModifyBandwidthPackageAttribute": doModifyBandwidthPackageAttribute,
|
@@ -20324,6 +20949,7 @@ ACTION_MAP = {
|
|
20324
20949
|
"DeleteCcnRouteTables": doDeleteCcnRouteTables,
|
20325
20950
|
"ModifyPrivateNatGatewayTranslationNatRule": doModifyPrivateNatGatewayTranslationNatRule,
|
20326
20951
|
"ModifyVpnGatewayRoutes": doModifyVpnGatewayRoutes,
|
20952
|
+
"CheckTrafficMirror": doCheckTrafficMirror,
|
20327
20953
|
"ModifyIPv6AddressesBandwidth": doModifyIPv6AddressesBandwidth,
|
20328
20954
|
"RefreshDirectConnectGatewayRouteToNatGateway": doRefreshDirectConnectGatewayRouteToNatGateway,
|
20329
20955
|
"ModifySnapshotPolicies": doModifySnapshotPolicies,
|
@@ -20363,7 +20989,9 @@ ACTION_MAP = {
|
|
20363
20989
|
"DeletePrivateNatGatewayTranslationAclRule": doDeletePrivateNatGatewayTranslationAclRule,
|
20364
20990
|
"DescribePrivateNatGatewayTranslationAclRules": doDescribePrivateNatGatewayTranslationAclRules,
|
20365
20991
|
"DisableFlowLogs": doDisableFlowLogs,
|
20992
|
+
"ResetTrafficMirrorFilter": doResetTrafficMirrorFilter,
|
20366
20993
|
"CreateCustomerGateway": doCreateCustomerGateway,
|
20994
|
+
"CreateTrafficMirror": doCreateTrafficMirror,
|
20367
20995
|
"AuditCrossBorderCompliance": doAuditCrossBorderCompliance,
|
20368
20996
|
"DescribeVpcInstances": doDescribeVpcInstances,
|
20369
20997
|
"DescribeVpnGatewaySslServers": doDescribeVpnGatewaySslServers,
|
@@ -20384,8 +21012,8 @@ ACTION_MAP = {
|
|
20384
21012
|
"DeleteSecurityGroup": doDeleteSecurityGroup,
|
20385
21013
|
"DescribeNatGatewaySourceIpTranslationNatRules": doDescribeNatGatewaySourceIpTranslationNatRules,
|
20386
21014
|
"ModifyNetDetect": doModifyNetDetect,
|
20387
|
-
"
|
20388
|
-
"
|
21015
|
+
"DescribeBandwidthPackageQuota": doDescribeBandwidthPackageQuota,
|
21016
|
+
"CreateSnapshotPolicies": doCreateSnapshotPolicies,
|
20389
21017
|
"ResetAttachCcnInstances": doResetAttachCcnInstances,
|
20390
21018
|
"ModifyVpcEndPointServiceAttribute": doModifyVpcEndPointServiceAttribute,
|
20391
21019
|
"DescribeBandwidthPackages": doDescribeBandwidthPackages,
|
@@ -20403,6 +21031,7 @@ ACTION_MAP = {
|
|
20403
21031
|
"ReplaceSecurityGroupPolicy": doReplaceSecurityGroupPolicy,
|
20404
21032
|
"AdjustPublicAddress": doAdjustPublicAddress,
|
20405
21033
|
"CreateNetworkAcl": doCreateNetworkAcl,
|
21034
|
+
"UpdateTrafficMirrorAllFilter": doUpdateTrafficMirrorAllFilter,
|
20406
21035
|
"CreateBandwidthPackage": doCreateBandwidthPackage,
|
20407
21036
|
"DeleteFlowLog": doDeleteFlowLog,
|
20408
21037
|
"ReplaceRouteTableAssociation": doReplaceRouteTableAssociation,
|
@@ -20418,6 +21047,7 @@ ACTION_MAP = {
|
|
20418
21047
|
"ModifyPrivateNatGatewayDestinationIpPortTranslationNatRule": doModifyPrivateNatGatewayDestinationIpPortTranslationNatRule,
|
20419
21048
|
"DescribeVpnGatewayRoutes": doDescribeVpnGatewayRoutes,
|
20420
21049
|
"ReplaceSecurityGroupPolicies": doReplaceSecurityGroupPolicies,
|
21050
|
+
"DescribeTrafficMirrors": doDescribeTrafficMirrors,
|
20421
21051
|
"DeleteRouteTable": doDeleteRouteTable,
|
20422
21052
|
"AssignPrivateIpAddresses": doAssignPrivateIpAddresses,
|
20423
21053
|
"DescribeCrossBorderFlowMonitor": doDescribeCrossBorderFlowMonitor,
|
@@ -20510,6 +21140,7 @@ ACTION_MAP = {
|
|
20510
21140
|
"CreateAndAttachNetworkInterface": doCreateAndAttachNetworkInterface,
|
20511
21141
|
"ModifyVpcEndPointServiceWhiteList": doModifyVpcEndPointServiceWhiteList,
|
20512
21142
|
"DescribeNatGateways": doDescribeNatGateways,
|
21143
|
+
"ModifyTrafficMirrorAttribute": doModifyTrafficMirrorAttribute,
|
20513
21144
|
"ResetHighPriorityRoutes": doResetHighPriorityRoutes,
|
20514
21145
|
"DescribeVpcs": doDescribeVpcs,
|
20515
21146
|
"InquiryPriceModifyAddressesBandwidth": doInquiryPriceModifyAddressesBandwidth,
|
@@ -20535,12 +21166,14 @@ ACTION_MAP = {
|
|
20535
21166
|
"DeleteVpnGatewayRoutes": doDeleteVpnGatewayRoutes,
|
20536
21167
|
"ReplaceHighPriorityRoutes": doReplaceHighPriorityRoutes,
|
20537
21168
|
"ModifyCcnAttachedInstancesAttribute": doModifyCcnAttachedInstancesAttribute,
|
21169
|
+
"ResetTrafficMirrorTarget": doResetTrafficMirrorTarget,
|
21170
|
+
"DescribeSecurityGroupReferences": doDescribeSecurityGroupReferences,
|
20538
21171
|
"DeleteNatGateway": doDeleteNatGateway,
|
20539
21172
|
"DescribeRouteList": doDescribeRouteList,
|
20540
21173
|
"ModifyIpv6AddressesAttribute": doModifyIpv6AddressesAttribute,
|
20541
|
-
"
|
21174
|
+
"CreateNetDetect": doCreateNetDetect,
|
20542
21175
|
"ModifyHighPriorityRouteTableAttribute": doModifyHighPriorityRouteTableAttribute,
|
20543
|
-
"
|
21176
|
+
"ReleaseIPv6Addresses": doReleaseIPv6Addresses,
|
20544
21177
|
"DeleteReserveIpAddresses": doDeleteReserveIpAddresses,
|
20545
21178
|
"ModifyCdcLDCXAttribute": doModifyCdcLDCXAttribute,
|
20546
21179
|
"DeleteVpcEndPointService": doDeleteVpcEndPointService,
|
@@ -20553,7 +21186,7 @@ ACTION_MAP = {
|
|
20553
21186
|
"CreatePrivateNatGatewayTranslationAclRule": doCreatePrivateNatGatewayTranslationAclRule,
|
20554
21187
|
"DescribeSecurityGroupLimits": doDescribeSecurityGroupLimits,
|
20555
21188
|
"DescribeCdcUsedIdcVlan": doDescribeCdcUsedIdcVlan,
|
20556
|
-
"
|
21189
|
+
"StopTrafficMirror": doStopTrafficMirror,
|
20557
21190
|
"DisableVpnGatewaySslClientCert": doDisableVpnGatewaySslClientCert,
|
20558
21191
|
"DescribeDirectConnectGateways": doDescribeDirectConnectGateways,
|
20559
21192
|
"RenewVpnGateway": doRenewVpnGateway,
|
@@ -20567,6 +21200,8 @@ ACTION_MAP = {
|
|
20567
21200
|
"CheckDefaultSubnet": doCheckDefaultSubnet,
|
20568
21201
|
"AssociateNetworkInterfaceSecurityGroups": doAssociateNetworkInterfaceSecurityGroups,
|
20569
21202
|
"DescribeAddressQuota": doDescribeAddressQuota,
|
21203
|
+
"UpdateTrafficMirrorDirection": doUpdateTrafficMirrorDirection,
|
21204
|
+
"StartTrafficMirror": doStartTrafficMirror,
|
20570
21205
|
"CreateCcn": doCreateCcn,
|
20571
21206
|
"DescribeSecurityGroups": doDescribeSecurityGroups,
|
20572
21207
|
"CreateVpnGateway": doCreateVpnGateway,
|
@@ -20581,15 +21216,16 @@ ACTION_MAP = {
|
|
20581
21216
|
"CreateTrafficPackages": doCreateTrafficPackages,
|
20582
21217
|
"DescribeSnapshotFiles": doDescribeSnapshotFiles,
|
20583
21218
|
"CreateDhcpIp": doCreateDhcpIp,
|
20584
|
-
"
|
21219
|
+
"DescribeCdcNetPlanes": doDescribeCdcNetPlanes,
|
20585
21220
|
"ResumeSnapshotInstance": doResumeSnapshotInstance,
|
20586
21221
|
"SetVpnGatewaysRenewFlag": doSetVpnGatewaysRenewFlag,
|
20587
21222
|
"DescribeSnapshotPolicies": doDescribeSnapshotPolicies,
|
20588
21223
|
"ModifyIp6AddressesBandwidth": doModifyIp6AddressesBandwidth,
|
20589
21224
|
"CreateVpcEndPoint": doCreateVpcEndPoint,
|
20590
21225
|
"CreateSecurityGroupWithPolicies": doCreateSecurityGroupWithPolicies,
|
21226
|
+
"ResetTrafficMirrorSrcs": doResetTrafficMirrorSrcs,
|
20591
21227
|
"ReturnNormalAddresses": doReturnNormalAddresses,
|
20592
|
-
"
|
21228
|
+
"ModifyVpcAttribute": doModifyVpcAttribute,
|
20593
21229
|
"DeletePrivateNatGateway": doDeletePrivateNatGateway,
|
20594
21230
|
"CreateVpnGatewayRoutes": doCreateVpnGatewayRoutes,
|
20595
21231
|
|