tccli-intl-en 3.0.1260.1__py2.py3-none-any.whl → 3.0.1262.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.
@@ -485,7 +485,7 @@ def doImportImage(args, parsed_globals):
485
485
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
486
486
 
487
487
 
488
- def doInquiryPriceRunInstances(args, parsed_globals):
488
+ def doModifyKeyPairAttribute(args, parsed_globals):
489
489
  g_param = parse_global_arg(parsed_globals)
490
490
 
491
491
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -514,11 +514,11 @@ def doInquiryPriceRunInstances(args, parsed_globals):
514
514
  client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
515
515
  client._sdkVersion += ("_CLI_" + __version__)
516
516
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
517
- model = models.InquiryPriceRunInstancesRequest()
517
+ model = models.ModifyKeyPairAttributeRequest()
518
518
  model.from_json_string(json.dumps(args))
519
519
  start_time = time.time()
520
520
  while True:
521
- rsp = client.InquiryPriceRunInstances(model)
521
+ rsp = client.ModifyKeyPairAttribute(model)
522
522
  result = rsp.to_json_string()
523
523
  try:
524
524
  json_obj = json.loads(result)
@@ -641,7 +641,7 @@ def doConfigureChcAssistVpc(args, parsed_globals):
641
641
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
642
642
 
643
643
 
644
- def doModifyKeyPairAttribute(args, parsed_globals):
644
+ def doDeleteLaunchTemplate(args, parsed_globals):
645
645
  g_param = parse_global_arg(parsed_globals)
646
646
 
647
647
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -670,11 +670,11 @@ def doModifyKeyPairAttribute(args, parsed_globals):
670
670
  client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
671
671
  client._sdkVersion += ("_CLI_" + __version__)
672
672
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
673
- model = models.ModifyKeyPairAttributeRequest()
673
+ model = models.DeleteLaunchTemplateRequest()
674
674
  model.from_json_string(json.dumps(args))
675
675
  start_time = time.time()
676
676
  while True:
677
- rsp = client.ModifyKeyPairAttribute(model)
677
+ rsp = client.DeleteLaunchTemplate(model)
678
678
  result = rsp.to_json_string()
679
679
  try:
680
680
  json_obj = json.loads(result)
@@ -693,7 +693,7 @@ def doModifyKeyPairAttribute(args, parsed_globals):
693
693
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
694
694
 
695
695
 
696
- def doDeleteLaunchTemplate(args, parsed_globals):
696
+ def doModifyInstancesAttribute(args, parsed_globals):
697
697
  g_param = parse_global_arg(parsed_globals)
698
698
 
699
699
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -722,11 +722,11 @@ def doDeleteLaunchTemplate(args, parsed_globals):
722
722
  client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
723
723
  client._sdkVersion += ("_CLI_" + __version__)
724
724
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
725
- model = models.DeleteLaunchTemplateRequest()
725
+ model = models.ModifyInstancesAttributeRequest()
726
726
  model.from_json_string(json.dumps(args))
727
727
  start_time = time.time()
728
728
  while True:
729
- rsp = client.DeleteLaunchTemplate(model)
729
+ rsp = client.ModifyInstancesAttribute(model)
730
730
  result = rsp.to_json_string()
731
731
  try:
732
732
  json_obj = json.loads(result)
@@ -745,7 +745,7 @@ def doDeleteLaunchTemplate(args, parsed_globals):
745
745
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
746
746
 
747
747
 
748
- def doModifyInstancesAttribute(args, parsed_globals):
748
+ def doModifyInstancesDisasterRecoverGroup(args, parsed_globals):
749
749
  g_param = parse_global_arg(parsed_globals)
750
750
 
751
751
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -774,11 +774,11 @@ def doModifyInstancesAttribute(args, parsed_globals):
774
774
  client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
775
775
  client._sdkVersion += ("_CLI_" + __version__)
776
776
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
777
- model = models.ModifyInstancesAttributeRequest()
777
+ model = models.ModifyInstancesDisasterRecoverGroupRequest()
778
778
  model.from_json_string(json.dumps(args))
779
779
  start_time = time.time()
780
780
  while True:
781
- rsp = client.ModifyInstancesAttribute(model)
781
+ rsp = client.ModifyInstancesDisasterRecoverGroup(model)
782
782
  result = rsp.to_json_string()
783
783
  try:
784
784
  json_obj = json.loads(result)
@@ -797,7 +797,7 @@ def doModifyInstancesAttribute(args, parsed_globals):
797
797
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
798
798
 
799
799
 
800
- def doModifyInstancesDisasterRecoverGroup(args, parsed_globals):
800
+ def doInquiryPriceResetInstancesInternetMaxBandwidth(args, parsed_globals):
801
801
  g_param = parse_global_arg(parsed_globals)
802
802
 
803
803
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -826,11 +826,11 @@ def doModifyInstancesDisasterRecoverGroup(args, parsed_globals):
826
826
  client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
827
827
  client._sdkVersion += ("_CLI_" + __version__)
828
828
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
829
- model = models.ModifyInstancesDisasterRecoverGroupRequest()
829
+ model = models.InquiryPriceResetInstancesInternetMaxBandwidthRequest()
830
830
  model.from_json_string(json.dumps(args))
831
831
  start_time = time.time()
832
832
  while True:
833
- rsp = client.ModifyInstancesDisasterRecoverGroup(model)
833
+ rsp = client.InquiryPriceResetInstancesInternetMaxBandwidth(model)
834
834
  result = rsp.to_json_string()
835
835
  try:
836
836
  json_obj = json.loads(result)
@@ -849,7 +849,7 @@ def doModifyInstancesDisasterRecoverGroup(args, parsed_globals):
849
849
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
850
850
 
851
851
 
852
- def doInquiryPriceResetInstancesInternetMaxBandwidth(args, parsed_globals):
852
+ def doDeleteImages(args, parsed_globals):
853
853
  g_param = parse_global_arg(parsed_globals)
854
854
 
855
855
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -878,11 +878,11 @@ def doInquiryPriceResetInstancesInternetMaxBandwidth(args, parsed_globals):
878
878
  client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
879
879
  client._sdkVersion += ("_CLI_" + __version__)
880
880
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
881
- model = models.InquiryPriceResetInstancesInternetMaxBandwidthRequest()
881
+ model = models.DeleteImagesRequest()
882
882
  model.from_json_string(json.dumps(args))
883
883
  start_time = time.time()
884
884
  while True:
885
- rsp = client.InquiryPriceResetInstancesInternetMaxBandwidth(model)
885
+ rsp = client.DeleteImages(model)
886
886
  result = rsp.to_json_string()
887
887
  try:
888
888
  json_obj = json.loads(result)
@@ -901,7 +901,7 @@ def doInquiryPriceResetInstancesInternetMaxBandwidth(args, parsed_globals):
901
901
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
902
902
 
903
903
 
904
- def doDeleteImages(args, parsed_globals):
904
+ def doCreateKeyPair(args, parsed_globals):
905
905
  g_param = parse_global_arg(parsed_globals)
906
906
 
907
907
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -930,11 +930,11 @@ def doDeleteImages(args, parsed_globals):
930
930
  client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
931
931
  client._sdkVersion += ("_CLI_" + __version__)
932
932
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
933
- model = models.DeleteImagesRequest()
933
+ model = models.CreateKeyPairRequest()
934
934
  model.from_json_string(json.dumps(args))
935
935
  start_time = time.time()
936
936
  while True:
937
- rsp = client.DeleteImages(model)
937
+ rsp = client.CreateKeyPair(model)
938
938
  result = rsp.to_json_string()
939
939
  try:
940
940
  json_obj = json.loads(result)
@@ -953,7 +953,7 @@ def doDeleteImages(args, parsed_globals):
953
953
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
954
954
 
955
955
 
956
- def doCreateKeyPair(args, parsed_globals):
956
+ def doDescribeInstanceFamilyConfigs(args, parsed_globals):
957
957
  g_param = parse_global_arg(parsed_globals)
958
958
 
959
959
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -982,11 +982,11 @@ def doCreateKeyPair(args, parsed_globals):
982
982
  client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
983
983
  client._sdkVersion += ("_CLI_" + __version__)
984
984
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
985
- model = models.CreateKeyPairRequest()
985
+ model = models.DescribeInstanceFamilyConfigsRequest()
986
986
  model.from_json_string(json.dumps(args))
987
987
  start_time = time.time()
988
988
  while True:
989
- rsp = client.CreateKeyPair(model)
989
+ rsp = client.DescribeInstanceFamilyConfigs(model)
990
990
  result = rsp.to_json_string()
991
991
  try:
992
992
  json_obj = json.loads(result)
@@ -1005,7 +1005,7 @@ def doCreateKeyPair(args, parsed_globals):
1005
1005
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1006
1006
 
1007
1007
 
1008
- def doDescribeInstanceFamilyConfigs(args, parsed_globals):
1008
+ def doDeleteKeyPairs(args, parsed_globals):
1009
1009
  g_param = parse_global_arg(parsed_globals)
1010
1010
 
1011
1011
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1034,11 +1034,11 @@ def doDescribeInstanceFamilyConfigs(args, parsed_globals):
1034
1034
  client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
1035
1035
  client._sdkVersion += ("_CLI_" + __version__)
1036
1036
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1037
- model = models.DescribeInstanceFamilyConfigsRequest()
1037
+ model = models.DeleteKeyPairsRequest()
1038
1038
  model.from_json_string(json.dumps(args))
1039
1039
  start_time = time.time()
1040
1040
  while True:
1041
- rsp = client.DescribeInstanceFamilyConfigs(model)
1041
+ rsp = client.DeleteKeyPairs(model)
1042
1042
  result = rsp.to_json_string()
1043
1043
  try:
1044
1044
  json_obj = json.loads(result)
@@ -1057,7 +1057,7 @@ def doDescribeInstanceFamilyConfigs(args, parsed_globals):
1057
1057
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1058
1058
 
1059
1059
 
1060
- def doDeleteKeyPairs(args, parsed_globals):
1060
+ def doDescribeInternetChargeTypeConfigs(args, parsed_globals):
1061
1061
  g_param = parse_global_arg(parsed_globals)
1062
1062
 
1063
1063
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1086,11 +1086,11 @@ def doDeleteKeyPairs(args, parsed_globals):
1086
1086
  client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
1087
1087
  client._sdkVersion += ("_CLI_" + __version__)
1088
1088
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1089
- model = models.DeleteKeyPairsRequest()
1089
+ model = models.DescribeInternetChargeTypeConfigsRequest()
1090
1090
  model.from_json_string(json.dumps(args))
1091
1091
  start_time = time.time()
1092
1092
  while True:
1093
- rsp = client.DeleteKeyPairs(model)
1093
+ rsp = client.DescribeInternetChargeTypeConfigs(model)
1094
1094
  result = rsp.to_json_string()
1095
1095
  try:
1096
1096
  json_obj = json.loads(result)
@@ -1109,7 +1109,7 @@ def doDeleteKeyPairs(args, parsed_globals):
1109
1109
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1110
1110
 
1111
1111
 
1112
- def doDescribeInternetChargeTypeConfigs(args, parsed_globals):
1112
+ def doCreateDisasterRecoverGroup(args, parsed_globals):
1113
1113
  g_param = parse_global_arg(parsed_globals)
1114
1114
 
1115
1115
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1138,11 +1138,11 @@ def doDescribeInternetChargeTypeConfigs(args, parsed_globals):
1138
1138
  client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
1139
1139
  client._sdkVersion += ("_CLI_" + __version__)
1140
1140
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1141
- model = models.DescribeInternetChargeTypeConfigsRequest()
1141
+ model = models.CreateDisasterRecoverGroupRequest()
1142
1142
  model.from_json_string(json.dumps(args))
1143
1143
  start_time = time.time()
1144
1144
  while True:
1145
- rsp = client.DescribeInternetChargeTypeConfigs(model)
1145
+ rsp = client.CreateDisasterRecoverGroup(model)
1146
1146
  result = rsp.to_json_string()
1147
1147
  try:
1148
1148
  json_obj = json.loads(result)
@@ -1161,7 +1161,7 @@ def doDescribeInternetChargeTypeConfigs(args, parsed_globals):
1161
1161
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1162
1162
 
1163
1163
 
1164
- def doCreateDisasterRecoverGroup(args, parsed_globals):
1164
+ def doInquiryPriceRunInstances(args, parsed_globals):
1165
1165
  g_param = parse_global_arg(parsed_globals)
1166
1166
 
1167
1167
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1190,11 +1190,11 @@ def doCreateDisasterRecoverGroup(args, parsed_globals):
1190
1190
  client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
1191
1191
  client._sdkVersion += ("_CLI_" + __version__)
1192
1192
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1193
- model = models.CreateDisasterRecoverGroupRequest()
1193
+ model = models.InquiryPriceRunInstancesRequest()
1194
1194
  model.from_json_string(json.dumps(args))
1195
1195
  start_time = time.time()
1196
1196
  while True:
1197
- rsp = client.CreateDisasterRecoverGroup(model)
1197
+ rsp = client.InquiryPriceRunInstances(model)
1198
1198
  result = rsp.to_json_string()
1199
1199
  try:
1200
1200
  json_obj = json.loads(result)
@@ -3449,7 +3449,7 @@ def doDescribeZoneInstanceConfigInfos(args, parsed_globals):
3449
3449
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3450
3450
 
3451
3451
 
3452
- def doModifyInstancesProject(args, parsed_globals):
3452
+ def doModifyInstancesChargeType(args, parsed_globals):
3453
3453
  g_param = parse_global_arg(parsed_globals)
3454
3454
 
3455
3455
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -3478,11 +3478,11 @@ def doModifyInstancesProject(args, parsed_globals):
3478
3478
  client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
3479
3479
  client._sdkVersion += ("_CLI_" + __version__)
3480
3480
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
3481
- model = models.ModifyInstancesProjectRequest()
3481
+ model = models.ModifyInstancesChargeTypeRequest()
3482
3482
  model.from_json_string(json.dumps(args))
3483
3483
  start_time = time.time()
3484
3484
  while True:
3485
- rsp = client.ModifyInstancesProject(model)
3485
+ rsp = client.ModifyInstancesChargeType(model)
3486
3486
  result = rsp.to_json_string()
3487
3487
  try:
3488
3488
  json_obj = json.loads(result)
@@ -3761,7 +3761,7 @@ def doDescribeReservedInstancesOfferings(args, parsed_globals):
3761
3761
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3762
3762
 
3763
3763
 
3764
- def doDescribeHosts(args, parsed_globals):
3764
+ def doInquiryPriceModifyInstancesChargeType(args, parsed_globals):
3765
3765
  g_param = parse_global_arg(parsed_globals)
3766
3766
 
3767
3767
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -3790,11 +3790,11 @@ def doDescribeHosts(args, parsed_globals):
3790
3790
  client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
3791
3791
  client._sdkVersion += ("_CLI_" + __version__)
3792
3792
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
3793
- model = models.DescribeHostsRequest()
3793
+ model = models.InquiryPriceModifyInstancesChargeTypeRequest()
3794
3794
  model.from_json_string(json.dumps(args))
3795
3795
  start_time = time.time()
3796
3796
  while True:
3797
- rsp = client.DescribeHosts(model)
3797
+ rsp = client.InquiryPriceModifyInstancesChargeType(model)
3798
3798
  result = rsp.to_json_string()
3799
3799
  try:
3800
3800
  json_obj = json.loads(result)
@@ -4021,6 +4021,58 @@ def doDescribeImages(args, parsed_globals):
4021
4021
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4022
4022
 
4023
4023
 
4024
+ def doDescribeChcHosts(args, parsed_globals):
4025
+ g_param = parse_global_arg(parsed_globals)
4026
+
4027
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4028
+ cred = credential.CVMRoleCredential()
4029
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4030
+ cred = credential.STSAssumeRoleCredential(
4031
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4032
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4033
+ )
4034
+ 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):
4035
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4036
+ else:
4037
+ cred = credential.Credential(
4038
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4039
+ )
4040
+ http_profile = HttpProfile(
4041
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4042
+ reqMethod="POST",
4043
+ endpoint=g_param[OptionsDefine.Endpoint],
4044
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4045
+ )
4046
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4047
+ if g_param[OptionsDefine.Language]:
4048
+ profile.language = g_param[OptionsDefine.Language]
4049
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4050
+ client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
4051
+ client._sdkVersion += ("_CLI_" + __version__)
4052
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
4053
+ model = models.DescribeChcHostsRequest()
4054
+ model.from_json_string(json.dumps(args))
4055
+ start_time = time.time()
4056
+ while True:
4057
+ rsp = client.DescribeChcHosts(model)
4058
+ result = rsp.to_json_string()
4059
+ try:
4060
+ json_obj = json.loads(result)
4061
+ except TypeError as e:
4062
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
4063
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4064
+ break
4065
+ cur_time = time.time()
4066
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4067
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4068
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4069
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4070
+ else:
4071
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4072
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4073
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4074
+
4075
+
4024
4076
  def doPurchaseReservedInstancesOffering(args, parsed_globals):
4025
4077
  g_param = parse_global_arg(parsed_globals)
4026
4078
 
@@ -4073,6 +4125,58 @@ def doPurchaseReservedInstancesOffering(args, parsed_globals):
4073
4125
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4074
4126
 
4075
4127
 
4128
+ def doModifyInstancesProject(args, parsed_globals):
4129
+ g_param = parse_global_arg(parsed_globals)
4130
+
4131
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4132
+ cred = credential.CVMRoleCredential()
4133
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4134
+ cred = credential.STSAssumeRoleCredential(
4135
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4136
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4137
+ )
4138
+ 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):
4139
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4140
+ else:
4141
+ cred = credential.Credential(
4142
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4143
+ )
4144
+ http_profile = HttpProfile(
4145
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4146
+ reqMethod="POST",
4147
+ endpoint=g_param[OptionsDefine.Endpoint],
4148
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4149
+ )
4150
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4151
+ if g_param[OptionsDefine.Language]:
4152
+ profile.language = g_param[OptionsDefine.Language]
4153
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4154
+ client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
4155
+ client._sdkVersion += ("_CLI_" + __version__)
4156
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
4157
+ model = models.ModifyInstancesProjectRequest()
4158
+ model.from_json_string(json.dumps(args))
4159
+ start_time = time.time()
4160
+ while True:
4161
+ rsp = client.ModifyInstancesProject(model)
4162
+ result = rsp.to_json_string()
4163
+ try:
4164
+ json_obj = json.loads(result)
4165
+ except TypeError as e:
4166
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
4167
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4168
+ break
4169
+ cur_time = time.time()
4170
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4171
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4172
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4173
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4174
+ else:
4175
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4176
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4177
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4178
+
4179
+
4076
4180
  def doDisassociateSecurityGroups(args, parsed_globals):
4077
4181
  g_param = parse_global_arg(parsed_globals)
4078
4182
 
@@ -4229,7 +4333,7 @@ def doDescribeImageFromFamily(args, parsed_globals):
4229
4333
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4230
4334
 
4231
4335
 
4232
- def doDescribeChcHosts(args, parsed_globals):
4336
+ def doDescribeHosts(args, parsed_globals):
4233
4337
  g_param = parse_global_arg(parsed_globals)
4234
4338
 
4235
4339
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -4258,11 +4362,11 @@ def doDescribeChcHosts(args, parsed_globals):
4258
4362
  client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
4259
4363
  client._sdkVersion += ("_CLI_" + __version__)
4260
4364
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
4261
- model = models.DescribeChcHostsRequest()
4365
+ model = models.DescribeHostsRequest()
4262
4366
  model.from_json_string(json.dumps(args))
4263
4367
  start_time = time.time()
4264
4368
  while True:
4265
- rsp = client.DescribeChcHosts(model)
4369
+ rsp = client.DescribeHosts(model)
4266
4370
  result = rsp.to_json_string()
4267
4371
  try:
4268
4372
  json_obj = json.loads(result)
@@ -4301,10 +4405,9 @@ ACTION_MAP = {
4301
4405
  "DescribeImageSharePermission": doDescribeImageSharePermission,
4302
4406
  "DescribeInstancesAttributes": doDescribeInstancesAttributes,
4303
4407
  "ImportImage": doImportImage,
4304
- "InquiryPriceRunInstances": doInquiryPriceRunInstances,
4408
+ "ModifyKeyPairAttribute": doModifyKeyPairAttribute,
4305
4409
  "InquiryPriceRenewInstances": doInquiryPriceRenewInstances,
4306
4410
  "ConfigureChcAssistVpc": doConfigureChcAssistVpc,
4307
- "ModifyKeyPairAttribute": doModifyKeyPairAttribute,
4308
4411
  "DeleteLaunchTemplate": doDeleteLaunchTemplate,
4309
4412
  "ModifyInstancesAttribute": doModifyInstancesAttribute,
4310
4413
  "ModifyInstancesDisasterRecoverGroup": doModifyInstancesDisasterRecoverGroup,
@@ -4315,6 +4418,7 @@ ACTION_MAP = {
4315
4418
  "DeleteKeyPairs": doDeleteKeyPairs,
4316
4419
  "DescribeInternetChargeTypeConfigs": doDescribeInternetChargeTypeConfigs,
4317
4420
  "CreateDisasterRecoverGroup": doCreateDisasterRecoverGroup,
4421
+ "InquiryPriceRunInstances": doInquiryPriceRunInstances,
4318
4422
  "DescribeInstances": doDescribeInstances,
4319
4423
  "DescribeLaunchTemplateVersions": doDescribeLaunchTemplateVersions,
4320
4424
  "StopInstances": doStopInstances,
@@ -4358,22 +4462,24 @@ ACTION_MAP = {
4358
4462
  "DescribeLaunchTemplates": doDescribeLaunchTemplates,
4359
4463
  "RemoveChcAssistVpc": doRemoveChcAssistVpc,
4360
4464
  "DescribeZoneInstanceConfigInfos": doDescribeZoneInstanceConfigInfos,
4361
- "ModifyInstancesProject": doModifyInstancesProject,
4465
+ "ModifyInstancesChargeType": doModifyInstancesChargeType,
4362
4466
  "RenewInstances": doRenewInstances,
4363
4467
  "DescribeDisasterRecoverGroups": doDescribeDisasterRecoverGroups,
4364
4468
  "StartInstances": doStartInstances,
4365
4469
  "DescribeKeyPairs": doDescribeKeyPairs,
4366
4470
  "DescribeReservedInstancesOfferings": doDescribeReservedInstancesOfferings,
4367
- "DescribeHosts": doDescribeHosts,
4471
+ "InquiryPriceModifyInstancesChargeType": doInquiryPriceModifyInstancesChargeType,
4368
4472
  "ModifyDisasterRecoverGroupAttribute": doModifyDisasterRecoverGroupAttribute,
4369
4473
  "ModifyChcAttribute": doModifyChcAttribute,
4370
4474
  "RebootInstances": doRebootInstances,
4371
4475
  "DescribeImages": doDescribeImages,
4476
+ "DescribeChcHosts": doDescribeChcHosts,
4372
4477
  "PurchaseReservedInstancesOffering": doPurchaseReservedInstancesOffering,
4478
+ "ModifyInstancesProject": doModifyInstancesProject,
4373
4479
  "DisassociateSecurityGroups": doDisassociateSecurityGroups,
4374
4480
  "AllocateHosts": doAllocateHosts,
4375
4481
  "DescribeImageFromFamily": doDescribeImageFromFamily,
4376
- "DescribeChcHosts": doDescribeChcHosts,
4482
+ "DescribeHosts": doDescribeHosts,
4377
4483
 
4378
4484
  }
4379
4485
 
@@ -343,6 +343,13 @@
343
343
  "output": "InquirePricePurchaseReservedInstancesOfferingResponse",
344
344
  "status": "online"
345
345
  },
346
+ "InquiryPriceModifyInstancesChargeType": {
347
+ "document": "This API is used to inquire about the price for switching billing modes of instance.\n\n\nThis API is used to indicate that instances with no charge when shut down, instances of the model families Batch Computing BC1 and Batch Computing BS1, instances of scheduled termination, and spot instances do not support this operation.",
348
+ "input": "InquiryPriceModifyInstancesChargeTypeRequest",
349
+ "name": "Modify the instance billing mode price inquiry",
350
+ "output": "InquiryPriceModifyInstancesChargeTypeResponse",
351
+ "status": "online"
352
+ },
346
353
  "InquiryPriceRenewInstances": {
347
354
  "document": "This API is used to inquire about the price for renewing a monthly subscription instance.\n\nThis API is used to query the renewal price of monthly subscription instances.",
348
355
  "input": "InquiryPriceRenewInstancesRequest",
@@ -427,6 +434,13 @@
427
434
  "output": "ModifyInstancesAttributeResponse",
428
435
  "status": "online"
429
436
  },
437
+ "ModifyInstancesChargeType": {
438
+ "document": "This API is used to switch the billing mode of an instance.\n\nThis API is used to perform operations that do not support instances with no charge when shut down, instances of the model families Batch Compute BC1 and Batch Compute BS1, or instances of scheduled termination.\n* You can query the result of the instance operation by calling the API [DescribeInstances](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5). If the latest operation status (LatestOperationState) of the instance is **SUCCESS**, the operation is successful.",
439
+ "input": "ModifyInstancesChargeTypeRequest",
440
+ "name": "Modify the instance billing mode",
441
+ "output": "ModifyInstancesChargeTypeResponse",
442
+ "status": "online"
443
+ },
430
444
  "ModifyInstancesDisasterRecoverGroup": {
431
445
  "document": "This API is used to adjust the placement group of an instance.\n* Currently only basic networks or Virtual Private Cloud (VPC) instances are supported.",
432
446
  "input": "ModifyInstancesDisasterRecoverGroupRequest",
@@ -5164,6 +5178,70 @@
5164
5178
  ],
5165
5179
  "type": "object"
5166
5180
  },
5181
+ "InquiryPriceModifyInstancesChargeTypeRequest": {
5182
+ "document": "InquiryPriceModifyInstancesChargeType request structure.",
5183
+ "members": [
5184
+ {
5185
+ "disabled": false,
5186
+ "document": "One or more instance IDs to be operated. You can obtain the instance ID through the `InstanceId` in the return value from the API [DescribeInstances](https://www.tencentcloud.com/document/api/213/15728?from_cn_redirect=1). The maximum number of instances per request is 100.",
5187
+ "example": "[\"ins-r8hr2upy\"]",
5188
+ "member": "string",
5189
+ "name": "InstanceIds",
5190
+ "required": true,
5191
+ "type": "list"
5192
+ },
5193
+ {
5194
+ "disabled": false,
5195
+ "document": "Modified instance [billing type](https://www.tencentcloud.com/document/product/213/2180?from_cn_redirect=1). <br><li>`PREPAID`: monthly subscription.</li>\n\n**Note:** Only supports converting pay-as-you-go instances to annual and monthly subscription instances.\n\ndefault value: `PREPAID`",
5196
+ "example": "PREPAID",
5197
+ "member": "string",
5198
+ "name": "InstanceChargeType",
5199
+ "required": true,
5200
+ "type": "string"
5201
+ },
5202
+ {
5203
+ "disabled": false,
5204
+ "document": "Prepaid mode, parameter settings related to monthly/annual subscription. through this parameter, specify the purchase duration of annual and monthly subscription instances, whether to enable auto-renewal, and other attributes. ",
5205
+ "example": "无",
5206
+ "member": "InstanceChargePrepaid",
5207
+ "name": "InstanceChargePrepaid",
5208
+ "required": false,
5209
+ "type": "object"
5210
+ },
5211
+ {
5212
+ "disabled": false,
5213
+ "document": "Whether to switch the billing mode of elastic data cloud disks simultaneously. valid values: <br><li>true: means switching the billing mode of elastic data cloud disks</li><li>false: means not switching the billing mode of elastic data cloud disks</li><br>default value: false.",
5214
+ "example": "false",
5215
+ "member": "bool",
5216
+ "name": "ModifyPortableDataDisk",
5217
+ "required": false,
5218
+ "type": "bool"
5219
+ }
5220
+ ],
5221
+ "type": "object"
5222
+ },
5223
+ "InquiryPriceModifyInstancesChargeTypeResponse": {
5224
+ "document": "InquiryPriceModifyInstancesChargeType response structure.",
5225
+ "members": [
5226
+ {
5227
+ "disabled": false,
5228
+ "document": "This parameter indicates the price for switching the billing mode of the corresponding configuration instance.",
5229
+ "example": "无",
5230
+ "member": "Price",
5231
+ "name": "Price",
5232
+ "output_required": true,
5233
+ "type": "object",
5234
+ "value_allowed_null": false
5235
+ },
5236
+ {
5237
+ "document": "The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.",
5238
+ "member": "string",
5239
+ "name": "RequestId",
5240
+ "type": "string"
5241
+ }
5242
+ ],
5243
+ "type": "object"
5244
+ },
5167
5245
  "InquiryPriceRenewInstancesRequest": {
5168
5246
  "document": "InquiryPriceRenewInstances request structure.",
5169
5247
  "members": [
@@ -7822,6 +7900,60 @@
7822
7900
  ],
7823
7901
  "type": "object"
7824
7902
  },
7903
+ "ModifyInstancesChargeTypeRequest": {
7904
+ "document": "ModifyInstancesChargeType request structure.",
7905
+ "members": [
7906
+ {
7907
+ "disabled": false,
7908
+ "document": "One or more instance ids to be operated. you can obtain the instance ID through the `InstanceId` in the return value from the api [DescribeInstances](https://www.tencentcloud.com/document/api/213/15728?from_cn_redirect=1). the maximum number of instances per request is 30.",
7909
+ "example": "[\"ins-r8hr2upy\"]",
7910
+ "member": "string",
7911
+ "name": "InstanceIds",
7912
+ "required": true,
7913
+ "type": "list"
7914
+ },
7915
+ {
7916
+ "disabled": false,
7917
+ "document": "Modified instance [billing type](https://www.tencentcloud.com/document/product/213/2180?from_cn_redirect=1). <li>`PREPAID`: monthly subscription.</li> \n**Note:** Only supports converting pay-as-you-go instances to annual and monthly subscription instances.\n\ndefault value: `PREPAID`",
7918
+ "example": "PREPAID",
7919
+ "member": "string",
7920
+ "name": "InstanceChargeType",
7921
+ "required": true,
7922
+ "type": "string"
7923
+ },
7924
+ {
7925
+ "disabled": false,
7926
+ "document": "Modified prepaid mode, parameter settings related to monthly/annual subscription. by specifying this parameter, you can specify the purchase duration of annual and monthly subscription instances, whether to enable auto-renewal, and other attributes. ",
7927
+ "example": "无",
7928
+ "member": "InstanceChargePrepaid",
7929
+ "name": "InstanceChargePrepaid",
7930
+ "required": false,
7931
+ "type": "object"
7932
+ },
7933
+ {
7934
+ "disabled": false,
7935
+ "document": "Whether to switch the billing mode of elastic data cloud disks simultaneously. valid values: <li> true: means switching the billing mode of elastic data cloud disks</li><li> false: means not switching the billing mode of elastic data cloud disks</li>default value: false.",
7936
+ "example": "false",
7937
+ "member": "bool",
7938
+ "name": "ModifyPortableDataDisk",
7939
+ "required": false,
7940
+ "type": "bool"
7941
+ }
7942
+ ],
7943
+ "type": "object"
7944
+ },
7945
+ "ModifyInstancesChargeTypeResponse": {
7946
+ "document": "ModifyInstancesChargeType response structure.",
7947
+ "members": [
7948
+ {
7949
+ "document": "The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.",
7950
+ "member": "string",
7951
+ "name": "RequestId",
7952
+ "type": "string"
7953
+ }
7954
+ ],
7955
+ "type": "object"
7956
+ },
7825
7957
  "ModifyInstancesDisasterRecoverGroupRequest": {
7826
7958
  "document": "ModifyInstancesDisasterRecoverGroup request structure.",
7827
7959
  "members": [