tccli 3.0.1125.1__py2.py3-none-any.whl → 3.0.1126.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -2671,6 +2671,58 @@ def doDeleteL4ProxyRules(args, parsed_globals):
2671
2671
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2672
2672
 
2673
2673
 
2674
+ def doCreateCustomizeErrorPage(args, parsed_globals):
2675
+ g_param = parse_global_arg(parsed_globals)
2676
+
2677
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2678
+ cred = credential.CVMRoleCredential()
2679
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2680
+ cred = credential.STSAssumeRoleCredential(
2681
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2682
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2683
+ )
2684
+ 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):
2685
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2686
+ else:
2687
+ cred = credential.Credential(
2688
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2689
+ )
2690
+ http_profile = HttpProfile(
2691
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2692
+ reqMethod="POST",
2693
+ endpoint=g_param[OptionsDefine.Endpoint],
2694
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2695
+ )
2696
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2697
+ if g_param[OptionsDefine.Language]:
2698
+ profile.language = g_param[OptionsDefine.Language]
2699
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2700
+ client = mod.TeoClient(cred, g_param[OptionsDefine.Region], profile)
2701
+ client._sdkVersion += ("_CLI_" + __version__)
2702
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
2703
+ model = models.CreateCustomizeErrorPageRequest()
2704
+ model.from_json_string(json.dumps(args))
2705
+ start_time = time.time()
2706
+ while True:
2707
+ rsp = client.CreateCustomizeErrorPage(model)
2708
+ result = rsp.to_json_string()
2709
+ try:
2710
+ json_obj = json.loads(result)
2711
+ except TypeError as e:
2712
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
2713
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2714
+ break
2715
+ cur_time = time.time()
2716
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2717
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2718
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2719
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2720
+ else:
2721
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2722
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2723
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2724
+
2725
+
2674
2726
  def doModifyAccelerationDomain(args, parsed_globals):
2675
2727
  g_param = parse_global_arg(parsed_globals)
2676
2728
 
@@ -3295,6 +3347,58 @@ def doDescribeAvailablePlans(args, parsed_globals):
3295
3347
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3296
3348
 
3297
3349
 
3350
+ def doDescribeCustomErrorPages(args, parsed_globals):
3351
+ g_param = parse_global_arg(parsed_globals)
3352
+
3353
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3354
+ cred = credential.CVMRoleCredential()
3355
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3356
+ cred = credential.STSAssumeRoleCredential(
3357
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3358
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3359
+ )
3360
+ 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):
3361
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3362
+ else:
3363
+ cred = credential.Credential(
3364
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3365
+ )
3366
+ http_profile = HttpProfile(
3367
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3368
+ reqMethod="POST",
3369
+ endpoint=g_param[OptionsDefine.Endpoint],
3370
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3371
+ )
3372
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3373
+ if g_param[OptionsDefine.Language]:
3374
+ profile.language = g_param[OptionsDefine.Language]
3375
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3376
+ client = mod.TeoClient(cred, g_param[OptionsDefine.Region], profile)
3377
+ client._sdkVersion += ("_CLI_" + __version__)
3378
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
3379
+ model = models.DescribeCustomErrorPagesRequest()
3380
+ model.from_json_string(json.dumps(args))
3381
+ start_time = time.time()
3382
+ while True:
3383
+ rsp = client.DescribeCustomErrorPages(model)
3384
+ result = rsp.to_json_string()
3385
+ try:
3386
+ json_obj = json.loads(result)
3387
+ except TypeError as e:
3388
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
3389
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3390
+ break
3391
+ cur_time = time.time()
3392
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3393
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3394
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3395
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3396
+ else:
3397
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3398
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3399
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3400
+
3401
+
3298
3402
  def doDescribeRulesSetting(args, parsed_globals):
3299
3403
  g_param = parse_global_arg(parsed_globals)
3300
3404
 
@@ -3763,7 +3867,7 @@ def doDescribeL4ProxyRules(args, parsed_globals):
3763
3867
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3764
3868
 
3765
3869
 
3766
- def doDescribeL4Proxy(args, parsed_globals):
3870
+ def doDeleteCustomErrorPage(args, parsed_globals):
3767
3871
  g_param = parse_global_arg(parsed_globals)
3768
3872
 
3769
3873
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -3792,11 +3896,11 @@ def doDescribeL4Proxy(args, parsed_globals):
3792
3896
  client = mod.TeoClient(cred, g_param[OptionsDefine.Region], profile)
3793
3897
  client._sdkVersion += ("_CLI_" + __version__)
3794
3898
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
3795
- model = models.DescribeL4ProxyRequest()
3899
+ model = models.DeleteCustomErrorPageRequest()
3796
3900
  model.from_json_string(json.dumps(args))
3797
3901
  start_time = time.time()
3798
3902
  while True:
3799
- rsp = client.DescribeL4Proxy(model)
3903
+ rsp = client.DeleteCustomErrorPage(model)
3800
3904
  result = rsp.to_json_string()
3801
3905
  try:
3802
3906
  json_obj = json.loads(result)
@@ -5115,6 +5219,58 @@ def doDescribeSecurityIPGroup(args, parsed_globals):
5115
5219
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
5116
5220
 
5117
5221
 
5222
+ def doModifyCustomErrorPage(args, parsed_globals):
5223
+ g_param = parse_global_arg(parsed_globals)
5224
+
5225
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
5226
+ cred = credential.CVMRoleCredential()
5227
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
5228
+ cred = credential.STSAssumeRoleCredential(
5229
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
5230
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
5231
+ )
5232
+ 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):
5233
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
5234
+ else:
5235
+ cred = credential.Credential(
5236
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
5237
+ )
5238
+ http_profile = HttpProfile(
5239
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
5240
+ reqMethod="POST",
5241
+ endpoint=g_param[OptionsDefine.Endpoint],
5242
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
5243
+ )
5244
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
5245
+ if g_param[OptionsDefine.Language]:
5246
+ profile.language = g_param[OptionsDefine.Language]
5247
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
5248
+ client = mod.TeoClient(cred, g_param[OptionsDefine.Region], profile)
5249
+ client._sdkVersion += ("_CLI_" + __version__)
5250
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
5251
+ model = models.ModifyCustomErrorPageRequest()
5252
+ model.from_json_string(json.dumps(args))
5253
+ start_time = time.time()
5254
+ while True:
5255
+ rsp = client.ModifyCustomErrorPage(model)
5256
+ result = rsp.to_json_string()
5257
+ try:
5258
+ json_obj = json.loads(result)
5259
+ except TypeError as e:
5260
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
5261
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
5262
+ break
5263
+ cur_time = time.time()
5264
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
5265
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
5266
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
5267
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
5268
+ else:
5269
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
5270
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
5271
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
5272
+
5273
+
5118
5274
  def doDescribeDDoSAttackData(args, parsed_globals):
5119
5275
  g_param = parse_global_arg(parsed_globals)
5120
5276
 
@@ -5271,6 +5427,58 @@ def doDescribeAliasDomains(args, parsed_globals):
5271
5427
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
5272
5428
 
5273
5429
 
5430
+ def doDescribeL4Proxy(args, parsed_globals):
5431
+ g_param = parse_global_arg(parsed_globals)
5432
+
5433
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
5434
+ cred = credential.CVMRoleCredential()
5435
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
5436
+ cred = credential.STSAssumeRoleCredential(
5437
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
5438
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
5439
+ )
5440
+ 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):
5441
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
5442
+ else:
5443
+ cred = credential.Credential(
5444
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
5445
+ )
5446
+ http_profile = HttpProfile(
5447
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
5448
+ reqMethod="POST",
5449
+ endpoint=g_param[OptionsDefine.Endpoint],
5450
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
5451
+ )
5452
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
5453
+ if g_param[OptionsDefine.Language]:
5454
+ profile.language = g_param[OptionsDefine.Language]
5455
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
5456
+ client = mod.TeoClient(cred, g_param[OptionsDefine.Region], profile)
5457
+ client._sdkVersion += ("_CLI_" + __version__)
5458
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
5459
+ model = models.DescribeL4ProxyRequest()
5460
+ model.from_json_string(json.dumps(args))
5461
+ start_time = time.time()
5462
+ while True:
5463
+ rsp = client.DescribeL4Proxy(model)
5464
+ result = rsp.to_json_string()
5465
+ try:
5466
+ json_obj = json.loads(result)
5467
+ except TypeError as e:
5468
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
5469
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
5470
+ break
5471
+ cur_time = time.time()
5472
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
5473
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
5474
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
5475
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
5476
+ else:
5477
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
5478
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
5479
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
5480
+
5481
+
5274
5482
  def doDescribeBillingData(args, parsed_globals):
5275
5483
  g_param = parse_global_arg(parsed_globals)
5276
5484
 
@@ -5387,6 +5595,7 @@ ACTION_MAP = {
5387
5595
  "BindZoneToPlan": doBindZoneToPlan,
5388
5596
  "DescribeDDoSAttackEvent": doDescribeDDoSAttackEvent,
5389
5597
  "DeleteL4ProxyRules": doDeleteL4ProxyRules,
5598
+ "CreateCustomizeErrorPage": doCreateCustomizeErrorPage,
5390
5599
  "ModifyAccelerationDomain": doModifyAccelerationDomain,
5391
5600
  "CreateL4Proxy": doCreateL4Proxy,
5392
5601
  "ModifyApplicationProxyStatus": doModifyApplicationProxyStatus,
@@ -5399,6 +5608,7 @@ ACTION_MAP = {
5399
5608
  "ModifyApplicationProxy": doModifyApplicationProxy,
5400
5609
  "CreateZone": doCreateZone,
5401
5610
  "DescribeAvailablePlans": doDescribeAvailablePlans,
5611
+ "DescribeCustomErrorPages": doDescribeCustomErrorPages,
5402
5612
  "DescribeRulesSetting": doDescribeRulesSetting,
5403
5613
  "ModifyAccelerationDomainStatuses": doModifyAccelerationDomainStatuses,
5404
5614
  "ModifySecurityIPGroup": doModifySecurityIPGroup,
@@ -5408,7 +5618,7 @@ ACTION_MAP = {
5408
5618
  "DescribePurgeTasks": doDescribePurgeTasks,
5409
5619
  "DeleteRules": doDeleteRules,
5410
5620
  "DescribeL4ProxyRules": doDescribeL4ProxyRules,
5411
- "DescribeL4Proxy": doDescribeL4Proxy,
5621
+ "DeleteCustomErrorPage": doDeleteCustomErrorPage,
5412
5622
  "DescribeRules": doDescribeRules,
5413
5623
  "CreateCLSIndex": doCreateCLSIndex,
5414
5624
  "CreateApplicationProxy": doCreateApplicationProxy,
@@ -5434,9 +5644,11 @@ ACTION_MAP = {
5434
5644
  "DeleteZone": doDeleteZone,
5435
5645
  "DescribeSecurityIPGroupInfo": doDescribeSecurityIPGroupInfo,
5436
5646
  "DescribeSecurityIPGroup": doDescribeSecurityIPGroup,
5647
+ "ModifyCustomErrorPage": doModifyCustomErrorPage,
5437
5648
  "DescribeDDoSAttackData": doDescribeDDoSAttackData,
5438
5649
  "DeleteSharedCNAME": doDeleteSharedCNAME,
5439
5650
  "DescribeAliasDomains": doDescribeAliasDomains,
5651
+ "DescribeL4Proxy": doDescribeL4Proxy,
5440
5652
  "DescribeBillingData": doDescribeBillingData,
5441
5653
 
5442
5654
  }