tccli 3.0.859.1__py2.py3-none-any.whl → 3.0.861.1__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- tccli/__init__.py +1 -1
- tccli/services/cdn/v20180606/api.json +1 -1
- tccli/services/cfs/cfs_client.py +273 -8
- tccli/services/cfs/v20190719/api.json +647 -0
- tccli/services/cfs/v20190719/examples.json +40 -0
- tccli/services/cwp/v20180228/api.json +2 -2
- tccli/services/ess/ess_client.py +106 -0
- tccli/services/ess/v20201111/api.json +124 -2
- tccli/services/ess/v20201111/examples.json +28 -0
- tccli/services/faceid/v20180301/api.json +22 -10
- tccli/services/ims/v20200713/examples.json +1 -1
- tccli/services/ims/v20201229/examples.json +1 -1
- tccli/services/ms/v20180408/api.json +2 -2
- tccli/services/rum/rum_client.py +261 -49
- tccli/services/rum/v20210622/api.json +478 -0
- tccli/services/rum/v20210622/examples.json +32 -0
- tccli/services/trp/trp_client.py +229 -17
- tccli/services/trp/v20210515/api.json +259 -0
- tccli/services/trp/v20210515/examples.json +32 -0
- tccli/services/waf/v20180125/api.json +288 -0
- tccli/services/waf/v20180125/examples.json +16 -0
- tccli/services/waf/waf_client.py +114 -8
- {tccli-3.0.859.1.dist-info → tccli-3.0.861.1.dist-info}/METADATA +2 -2
- {tccli-3.0.859.1.dist-info → tccli-3.0.861.1.dist-info}/RECORD +28 -28
- {tccli-3.0.859.1.dist-info → tccli-3.0.861.1.dist-info}/LICENSE +0 -0
- {tccli-3.0.859.1.dist-info → tccli-3.0.861.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.859.1.dist-info → tccli-3.0.861.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.859.1.dist-info → tccli-3.0.861.1.dist-info}/top_level.txt +0 -0
tccli/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '3.0.
|
1
|
+
__version__ = '3.0.861.1'
|
@@ -11818,7 +11818,7 @@
|
|
11818
11818
|
"usage": "both"
|
11819
11819
|
},
|
11820
11820
|
"Origin": {
|
11821
|
-
"document": "源站配置复杂类型,支持以下配置:\n+ 源站指定为单个域名\n+ 源站指定为多个 IP,可配置端口(1
|
11821
|
+
"document": "源站配置复杂类型,支持以下配置:\n+ 源站指定为单个域名\n+ 源站指定为多个 IP,可配置端口(1\\~65535),可配置权重(1\\~100),格式为 IP:端口:权重\n+ 回源域名配置\n+ 对象存储(COS)作为源站\n+ 热备源站指定为单个域名\n+ 热备源站指定为多个 IP,可配置端口(1\\~65535),暂不支持权重配置\n+ 热备源站回源域名配置",
|
11822
11822
|
"members": [
|
11823
11823
|
{
|
11824
11824
|
"document": "主源站列表\n修改源站时,需要同时填充对应的 OriginType\n注意:此字段可能返回 null,表示取不到有效值。",
|
tccli/services/cfs/cfs_client.py
CHANGED
@@ -225,7 +225,7 @@ def doDeleteCfsSnapshot(args, parsed_globals):
|
|
225
225
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
226
|
|
227
227
|
|
228
|
-
def
|
228
|
+
def doDescribeCfsPGroups(args, parsed_globals):
|
229
229
|
g_param = parse_global_arg(parsed_globals)
|
230
230
|
|
231
231
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -254,11 +254,11 @@ def doUpdateCfsSnapshotAttribute(args, parsed_globals):
|
|
254
254
|
client = mod.CfsClient(cred, g_param[OptionsDefine.Region], profile)
|
255
255
|
client._sdkVersion += ("_CLI_" + __version__)
|
256
256
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
257
|
-
model = models.
|
257
|
+
model = models.DescribeCfsPGroupsRequest()
|
258
258
|
model.from_json_string(json.dumps(args))
|
259
259
|
start_time = time.time()
|
260
260
|
while True:
|
261
|
-
rsp = client.
|
261
|
+
rsp = client.DescribeCfsPGroups(model)
|
262
262
|
result = rsp.to_json_string()
|
263
263
|
try:
|
264
264
|
json_obj = json.loads(result)
|
@@ -589,6 +589,110 @@ def doDescribeCfsServiceStatus(args, parsed_globals):
|
|
589
589
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
590
590
|
|
591
591
|
|
592
|
+
def doStopMigrationTask(args, parsed_globals):
|
593
|
+
g_param = parse_global_arg(parsed_globals)
|
594
|
+
|
595
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
596
|
+
cred = credential.CVMRoleCredential()
|
597
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
598
|
+
cred = credential.STSAssumeRoleCredential(
|
599
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
600
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
|
601
|
+
)
|
602
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
603
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
604
|
+
else:
|
605
|
+
cred = credential.Credential(
|
606
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
607
|
+
)
|
608
|
+
http_profile = HttpProfile(
|
609
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
610
|
+
reqMethod="POST",
|
611
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
612
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
613
|
+
)
|
614
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
615
|
+
if g_param[OptionsDefine.Language]:
|
616
|
+
profile.language = g_param[OptionsDefine.Language]
|
617
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
618
|
+
client = mod.CfsClient(cred, g_param[OptionsDefine.Region], profile)
|
619
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
620
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
621
|
+
model = models.StopMigrationTaskRequest()
|
622
|
+
model.from_json_string(json.dumps(args))
|
623
|
+
start_time = time.time()
|
624
|
+
while True:
|
625
|
+
rsp = client.StopMigrationTask(model)
|
626
|
+
result = rsp.to_json_string()
|
627
|
+
try:
|
628
|
+
json_obj = json.loads(result)
|
629
|
+
except TypeError as e:
|
630
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
631
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
632
|
+
break
|
633
|
+
cur_time = time.time()
|
634
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
635
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
636
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
637
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
638
|
+
else:
|
639
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
640
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
641
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
642
|
+
|
643
|
+
|
644
|
+
def doDescribeMigrationTasks(args, parsed_globals):
|
645
|
+
g_param = parse_global_arg(parsed_globals)
|
646
|
+
|
647
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
648
|
+
cred = credential.CVMRoleCredential()
|
649
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
650
|
+
cred = credential.STSAssumeRoleCredential(
|
651
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
652
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
|
653
|
+
)
|
654
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
655
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
656
|
+
else:
|
657
|
+
cred = credential.Credential(
|
658
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
659
|
+
)
|
660
|
+
http_profile = HttpProfile(
|
661
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
662
|
+
reqMethod="POST",
|
663
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
664
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
665
|
+
)
|
666
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
667
|
+
if g_param[OptionsDefine.Language]:
|
668
|
+
profile.language = g_param[OptionsDefine.Language]
|
669
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
670
|
+
client = mod.CfsClient(cred, g_param[OptionsDefine.Region], profile)
|
671
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
672
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
673
|
+
model = models.DescribeMigrationTasksRequest()
|
674
|
+
model.from_json_string(json.dumps(args))
|
675
|
+
start_time = time.time()
|
676
|
+
while True:
|
677
|
+
rsp = client.DescribeMigrationTasks(model)
|
678
|
+
result = rsp.to_json_string()
|
679
|
+
try:
|
680
|
+
json_obj = json.loads(result)
|
681
|
+
except TypeError as e:
|
682
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
683
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
684
|
+
break
|
685
|
+
cur_time = time.time()
|
686
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
687
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
688
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
689
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
690
|
+
else:
|
691
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
692
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
693
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
694
|
+
|
695
|
+
|
592
696
|
def doDescribeAvailableZoneInfo(args, parsed_globals):
|
593
697
|
g_param = parse_global_arg(parsed_globals)
|
594
698
|
|
@@ -693,6 +797,58 @@ def doUpdateCfsFileSystemName(args, parsed_globals):
|
|
693
797
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
694
798
|
|
695
799
|
|
800
|
+
def doDeleteMigrationTask(args, parsed_globals):
|
801
|
+
g_param = parse_global_arg(parsed_globals)
|
802
|
+
|
803
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
804
|
+
cred = credential.CVMRoleCredential()
|
805
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
806
|
+
cred = credential.STSAssumeRoleCredential(
|
807
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
808
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
|
809
|
+
)
|
810
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
811
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
812
|
+
else:
|
813
|
+
cred = credential.Credential(
|
814
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
815
|
+
)
|
816
|
+
http_profile = HttpProfile(
|
817
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
818
|
+
reqMethod="POST",
|
819
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
820
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
821
|
+
)
|
822
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
823
|
+
if g_param[OptionsDefine.Language]:
|
824
|
+
profile.language = g_param[OptionsDefine.Language]
|
825
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
826
|
+
client = mod.CfsClient(cred, g_param[OptionsDefine.Region], profile)
|
827
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
828
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
829
|
+
model = models.DeleteMigrationTaskRequest()
|
830
|
+
model.from_json_string(json.dumps(args))
|
831
|
+
start_time = time.time()
|
832
|
+
while True:
|
833
|
+
rsp = client.DeleteMigrationTask(model)
|
834
|
+
result = rsp.to_json_string()
|
835
|
+
try:
|
836
|
+
json_obj = json.loads(result)
|
837
|
+
except TypeError as e:
|
838
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
839
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
840
|
+
break
|
841
|
+
cur_time = time.time()
|
842
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
843
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
844
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
845
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
846
|
+
else:
|
847
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
848
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
849
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
|
+
|
851
|
+
|
696
852
|
def doUpdateCfsFileSystemSizeLimit(args, parsed_globals):
|
697
853
|
g_param = parse_global_arg(parsed_globals)
|
698
854
|
|
@@ -901,7 +1057,7 @@ def doCreateCfsFileSystem(args, parsed_globals):
|
|
901
1057
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
902
1058
|
|
903
1059
|
|
904
|
-
def
|
1060
|
+
def doUpdateCfsSnapshotAttribute(args, parsed_globals):
|
905
1061
|
g_param = parse_global_arg(parsed_globals)
|
906
1062
|
|
907
1063
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -930,11 +1086,11 @@ def doDescribeCfsPGroups(args, parsed_globals):
|
|
930
1086
|
client = mod.CfsClient(cred, g_param[OptionsDefine.Region], profile)
|
931
1087
|
client._sdkVersion += ("_CLI_" + __version__)
|
932
1088
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
933
|
-
model = models.
|
1089
|
+
model = models.UpdateCfsSnapshotAttributeRequest()
|
934
1090
|
model.from_json_string(json.dumps(args))
|
935
1091
|
start_time = time.time()
|
936
1092
|
while True:
|
937
|
-
rsp = client.
|
1093
|
+
rsp = client.UpdateCfsSnapshotAttribute(model)
|
938
1094
|
result = rsp.to_json_string()
|
939
1095
|
try:
|
940
1096
|
json_obj = json.loads(result)
|
@@ -1317,6 +1473,110 @@ def doDescribeCfsFileSystemClients(args, parsed_globals):
|
|
1317
1473
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1318
1474
|
|
1319
1475
|
|
1476
|
+
def doDescribeBucketList(args, parsed_globals):
|
1477
|
+
g_param = parse_global_arg(parsed_globals)
|
1478
|
+
|
1479
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1480
|
+
cred = credential.CVMRoleCredential()
|
1481
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1482
|
+
cred = credential.STSAssumeRoleCredential(
|
1483
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1484
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
|
1485
|
+
)
|
1486
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
1487
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1488
|
+
else:
|
1489
|
+
cred = credential.Credential(
|
1490
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1491
|
+
)
|
1492
|
+
http_profile = HttpProfile(
|
1493
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1494
|
+
reqMethod="POST",
|
1495
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1496
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1497
|
+
)
|
1498
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1499
|
+
if g_param[OptionsDefine.Language]:
|
1500
|
+
profile.language = g_param[OptionsDefine.Language]
|
1501
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1502
|
+
client = mod.CfsClient(cred, g_param[OptionsDefine.Region], profile)
|
1503
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1504
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1505
|
+
model = models.DescribeBucketListRequest()
|
1506
|
+
model.from_json_string(json.dumps(args))
|
1507
|
+
start_time = time.time()
|
1508
|
+
while True:
|
1509
|
+
rsp = client.DescribeBucketList(model)
|
1510
|
+
result = rsp.to_json_string()
|
1511
|
+
try:
|
1512
|
+
json_obj = json.loads(result)
|
1513
|
+
except TypeError as e:
|
1514
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1515
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1516
|
+
break
|
1517
|
+
cur_time = time.time()
|
1518
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1519
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1520
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1521
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1522
|
+
else:
|
1523
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1524
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1525
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1526
|
+
|
1527
|
+
|
1528
|
+
def doCreateMigrationTask(args, parsed_globals):
|
1529
|
+
g_param = parse_global_arg(parsed_globals)
|
1530
|
+
|
1531
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1532
|
+
cred = credential.CVMRoleCredential()
|
1533
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1534
|
+
cred = credential.STSAssumeRoleCredential(
|
1535
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1536
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
|
1537
|
+
)
|
1538
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
1539
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1540
|
+
else:
|
1541
|
+
cred = credential.Credential(
|
1542
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1543
|
+
)
|
1544
|
+
http_profile = HttpProfile(
|
1545
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1546
|
+
reqMethod="POST",
|
1547
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1548
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1549
|
+
)
|
1550
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1551
|
+
if g_param[OptionsDefine.Language]:
|
1552
|
+
profile.language = g_param[OptionsDefine.Language]
|
1553
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1554
|
+
client = mod.CfsClient(cred, g_param[OptionsDefine.Region], profile)
|
1555
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1556
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1557
|
+
model = models.CreateMigrationTaskRequest()
|
1558
|
+
model.from_json_string(json.dumps(args))
|
1559
|
+
start_time = time.time()
|
1560
|
+
while True:
|
1561
|
+
rsp = client.CreateMigrationTask(model)
|
1562
|
+
result = rsp.to_json_string()
|
1563
|
+
try:
|
1564
|
+
json_obj = json.loads(result)
|
1565
|
+
except TypeError as e:
|
1566
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1567
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1568
|
+
break
|
1569
|
+
cur_time = time.time()
|
1570
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1571
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1572
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1573
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1574
|
+
else:
|
1575
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1576
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1577
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1578
|
+
|
1579
|
+
|
1320
1580
|
def doDeleteMountTarget(args, parsed_globals):
|
1321
1581
|
g_param = parse_global_arg(parsed_globals)
|
1322
1582
|
|
@@ -1852,20 +2112,23 @@ ACTION_MAP = {
|
|
1852
2112
|
"UpdateCfsFileSystemPGroup": doUpdateCfsFileSystemPGroup,
|
1853
2113
|
"SignUpCfsService": doSignUpCfsService,
|
1854
2114
|
"DeleteCfsSnapshot": doDeleteCfsSnapshot,
|
1855
|
-
"
|
2115
|
+
"DescribeCfsPGroups": doDescribeCfsPGroups,
|
1856
2116
|
"SetUserQuota": doSetUserQuota,
|
1857
2117
|
"DescribeAutoSnapshotPolicies": doDescribeAutoSnapshotPolicies,
|
1858
2118
|
"BindAutoSnapshotPolicy": doBindAutoSnapshotPolicy,
|
1859
2119
|
"DeleteCfsPGroup": doDeleteCfsPGroup,
|
1860
2120
|
"DeleteCfsRule": doDeleteCfsRule,
|
1861
2121
|
"DescribeCfsServiceStatus": doDescribeCfsServiceStatus,
|
2122
|
+
"StopMigrationTask": doStopMigrationTask,
|
2123
|
+
"DescribeMigrationTasks": doDescribeMigrationTasks,
|
1862
2124
|
"DescribeAvailableZoneInfo": doDescribeAvailableZoneInfo,
|
1863
2125
|
"UpdateCfsFileSystemName": doUpdateCfsFileSystemName,
|
2126
|
+
"DeleteMigrationTask": doDeleteMigrationTask,
|
1864
2127
|
"UpdateCfsFileSystemSizeLimit": doUpdateCfsFileSystemSizeLimit,
|
1865
2128
|
"DeleteUserQuota": doDeleteUserQuota,
|
1866
2129
|
"DeleteCfsFileSystem": doDeleteCfsFileSystem,
|
1867
2130
|
"CreateCfsFileSystem": doCreateCfsFileSystem,
|
1868
|
-
"
|
2131
|
+
"UpdateCfsSnapshotAttribute": doUpdateCfsSnapshotAttribute,
|
1869
2132
|
"DescribeCfsSnapshotOverview": doDescribeCfsSnapshotOverview,
|
1870
2133
|
"DescribeUserQuota": doDescribeUserQuota,
|
1871
2134
|
"UpdateAutoSnapshotPolicy": doUpdateAutoSnapshotPolicy,
|
@@ -1873,6 +2136,8 @@ ACTION_MAP = {
|
|
1873
2136
|
"DescribeCfsSnapshots": doDescribeCfsSnapshots,
|
1874
2137
|
"DescribeMountTargets": doDescribeMountTargets,
|
1875
2138
|
"DescribeCfsFileSystemClients": doDescribeCfsFileSystemClients,
|
2139
|
+
"DescribeBucketList": doDescribeBucketList,
|
2140
|
+
"CreateMigrationTask": doCreateMigrationTask,
|
1876
2141
|
"DeleteMountTarget": doDeleteMountTarget,
|
1877
2142
|
"CreateAutoSnapshotPolicy": doCreateAutoSnapshotPolicy,
|
1878
2143
|
"CreateCfsPGroup": doCreateCfsPGroup,
|