tccli 3.0.1279.1__py2.py3-none-any.whl → 3.0.1281.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/acp/v20220105/api.json +68 -65
- tccli/services/aiart/v20221229/api.json +1 -1
- tccli/services/antiddos/v20200309/api.json +5 -1
- tccli/services/apm/v20210622/api.json +32 -32
- tccli/services/apm/v20210622/examples.json +1 -1
- tccli/services/autoscaling/v20180419/api.json +1 -1
- tccli/services/billing/v20180709/api.json +550 -529
- tccli/services/billing/v20180709/examples.json +4 -4
- tccli/services/cat/v20180409/api.json +1 -1
- tccli/services/cdwdoris/v20211228/api.json +15 -1
- tccli/services/cfg/v20210820/api.json +36 -23
- tccli/services/cfg/v20210820/examples.json +11 -11
- tccli/services/cfs/v20190719/examples.json +3 -3
- tccli/services/ciam/v20220331/api.json +111 -111
- tccli/services/ciam/v20220331/examples.json +8 -8
- tccli/services/cls/v20201016/api.json +1 -1
- tccli/services/controlcenter/controlcenter_client.py +212 -0
- tccli/services/controlcenter/v20230110/api.json +521 -3
- tccli/services/controlcenter/v20230110/examples.json +32 -0
- tccli/services/csip/v20221121/api.json +66 -6
- tccli/services/cvm/cvm_client.py +212 -0
- tccli/services/cvm/v20170312/api.json +1076 -272
- tccli/services/cvm/v20170312/examples.json +34 -2
- tccli/services/cynosdb/v20190107/api.json +13 -3
- tccli/services/dbbrain/v20191016/api.json +12 -8
- tccli/services/dbbrain/v20210527/api.json +20 -20
- tccli/services/dlc/v20210125/api.json +19 -0
- tccli/services/dlc/v20210125/examples.json +1 -1
- tccli/services/domain/v20180808/api.json +3 -3
- tccli/services/emr/v20190103/api.json +11 -0
- tccli/services/es/v20180416/api.json +13 -0
- tccli/services/goosefs/v20220519/api.json +16 -15
- tccli/services/goosefs/v20220519/examples.json +2 -2
- tccli/services/gwlb/v20240906/api.json +22 -3
- tccli/services/gwlb/v20240906/examples.json +1 -1
- tccli/services/ims/v20201229/api.json +1 -1
- tccli/services/iotcloud/v20210408/api.json +243 -245
- tccli/services/iotcloud/v20210408/examples.json +64 -64
- tccli/services/keewidb/v20220308/api.json +94 -94
- tccli/services/lcic/v20220817/api.json +110 -63
- tccli/services/lcic/v20220817/examples.json +6 -6
- tccli/services/live/v20180801/api.json +302 -288
- tccli/services/lke/lke_client.py +84 -84
- tccli/services/lke/v20231130/api.json +220 -164
- tccli/services/lke/v20231130/examples.json +16 -16
- tccli/services/lowcode/v20210108/api.json +120 -11
- tccli/services/lowcode/v20210108/examples.json +9 -9
- tccli/services/mariadb/v20170312/api.json +7 -7
- tccli/services/mariadb/v20170312/examples.json +1 -1
- tccli/services/mongodb/v20190725/api.json +7 -6
- tccli/services/mongodb/v20190725/examples.json +2 -2
- tccli/services/monitor/v20180724/examples.json +2 -2
- tccli/services/mqtt/mqtt_client.py +110 -4
- tccli/services/mqtt/v20240516/api.json +132 -0
- tccli/services/mqtt/v20240516/examples.json +22 -0
- tccli/services/ocr/v20181119/api.json +7 -7
- tccli/services/partners/partners_client.py +61 -8
- tccli/services/partners/v20180321/api.json +110 -0
- tccli/services/partners/v20180321/examples.json +8 -0
- tccli/services/pts/v20210728/api.json +44 -6
- tccli/services/redis/v20180412/api.json +66 -66
- tccli/services/rum/v20210622/api.json +90 -0
- tccli/services/sms/v20190711/examples.json +1 -1
- tccli/services/sms/v20210111/examples.json +1 -1
- tccli/services/tag/v20180813/api.json +3 -3
- tccli/services/tag/v20180813/examples.json +1 -1
- tccli/services/tat/v20201028/api.json +141 -128
- tccli/services/tat/v20201028/examples.json +12 -12
- tccli/services/tdmq/tdmq_client.py +53 -0
- tccli/services/tdmq/v20200217/api.json +93 -0
- tccli/services/tdmq/v20200217/examples.json +8 -0
- tccli/services/teo/v20220901/api.json +4 -4
- tccli/services/tke/v20180525/api.json +313 -313
- tccli/services/tke/v20220501/api.json +2 -2
- tccli/services/tms/v20201229/api.json +9 -0
- tccli/services/tsf/v20180326/api.json +884 -884
- tccli/services/vdb/v20230616/api.json +12 -12
- tccli/services/waf/v20180125/api.json +7 -7
- tccli/services/waf/v20180125/examples.json +1 -1
- tccli/services/wedata/v20210820/api.json +107 -0
- {tccli-3.0.1279.1.dist-info → tccli-3.0.1281.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1279.1.dist-info → tccli-3.0.1281.1.dist-info}/RECORD +86 -86
- {tccli-3.0.1279.1.dist-info → tccli-3.0.1281.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1279.1.dist-info → tccli-3.0.1281.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1279.1.dist-info → tccli-3.0.1281.1.dist-info}/license_files/LICENSE +0 -0
@@ -2961,7 +2961,7 @@
|
|
2961
2961
|
},
|
2962
2962
|
{
|
2963
2963
|
"disabled": false,
|
2964
|
-
"document": "状态,0未处理、1已处置、2
|
2964
|
+
"document": "状态,0未处理、1已处置、2已忽略、3云防已防护",
|
2965
2965
|
"example": "0",
|
2966
2966
|
"member": "uint64",
|
2967
2967
|
"name": "Status",
|
@@ -3048,6 +3048,26 @@
|
|
3048
3048
|
"output_required": true,
|
3049
3049
|
"type": "string",
|
3050
3050
|
"value_allowed_null": false
|
3051
|
+
},
|
3052
|
+
{
|
3053
|
+
"disabled": false,
|
3054
|
+
"document": "服务判定,high_risk_service 高危服务 web_service web服务 other_service 其他服务",
|
3055
|
+
"example": "high",
|
3056
|
+
"member": "string",
|
3057
|
+
"name": "ServiceJudge",
|
3058
|
+
"output_required": false,
|
3059
|
+
"type": "string",
|
3060
|
+
"value_allowed_null": false
|
3061
|
+
},
|
3062
|
+
{
|
3063
|
+
"disabled": false,
|
3064
|
+
"document": "状态,0未处理、1已处置、2已忽略、3云防已防护、4无需处理",
|
3065
|
+
"example": "0",
|
3066
|
+
"member": "uint64",
|
3067
|
+
"name": "XspmStatus",
|
3068
|
+
"output_required": false,
|
3069
|
+
"type": "int",
|
3070
|
+
"value_allowed_null": false
|
3051
3071
|
}
|
3052
3072
|
],
|
3053
3073
|
"usage": "out"
|
@@ -3790,6 +3810,16 @@
|
|
3790
3810
|
"output_required": false,
|
3791
3811
|
"type": "int",
|
3792
3812
|
"value_allowed_null": false
|
3813
|
+
},
|
3814
|
+
{
|
3815
|
+
"disabled": false,
|
3816
|
+
"document": "是否POC扫描,0-非POC,1-POC",
|
3817
|
+
"example": "0",
|
3818
|
+
"member": "uint64",
|
3819
|
+
"name": "IsPOC",
|
3820
|
+
"output_required": false,
|
3821
|
+
"type": "int",
|
3822
|
+
"value_allowed_null": false
|
3793
3823
|
}
|
3794
3824
|
],
|
3795
3825
|
"usage": "out"
|
@@ -4006,6 +4036,16 @@
|
|
4006
4036
|
"output_required": true,
|
4007
4037
|
"type": "string",
|
4008
4038
|
"value_allowed_null": false
|
4039
|
+
},
|
4040
|
+
{
|
4041
|
+
"disabled": false,
|
4042
|
+
"document": "端口",
|
4043
|
+
"example": "22",
|
4044
|
+
"member": "int64",
|
4045
|
+
"name": "Port",
|
4046
|
+
"output_required": false,
|
4047
|
+
"type": "int",
|
4048
|
+
"value_allowed_null": false
|
4009
4049
|
}
|
4010
4050
|
],
|
4011
4051
|
"usage": "out"
|
@@ -13054,7 +13094,7 @@
|
|
13054
13094
|
{
|
13055
13095
|
"disabled": false,
|
13056
13096
|
"document": "风险详情",
|
13057
|
-
"example": "未授权访问:如果未受管理员授权,可能会被未经授权的人登录和访问
|
13097
|
+
"example": "未授权访问:如果未受管理员授权,可能会被未经授权的人登录和访问",
|
13058
13098
|
"member": "string",
|
13059
13099
|
"name": "RiskDetails",
|
13060
13100
|
"output_required": true,
|
@@ -13064,7 +13104,7 @@
|
|
13064
13104
|
{
|
13065
13105
|
"disabled": false,
|
13066
13106
|
"document": "处置建议",
|
13067
|
-
"example": "禁用未授权访问:应禁止 WebLogic
|
13107
|
+
"example": "禁用未授权访问:应禁止 WebLogic 未授权的访问",
|
13068
13108
|
"member": "string",
|
13069
13109
|
"name": "Suggestion",
|
13070
13110
|
"output_required": true,
|
@@ -13073,7 +13113,7 @@
|
|
13073
13113
|
},
|
13074
13114
|
{
|
13075
13115
|
"disabled": false,
|
13076
|
-
"document": "状态,0未处理、1已处置、2
|
13116
|
+
"document": "状态,0未处理、1已处置、2已忽略、3云防已防护",
|
13077
13117
|
"example": "0",
|
13078
13118
|
"member": "uint64",
|
13079
13119
|
"name": "Status",
|
@@ -13154,7 +13194,7 @@
|
|
13154
13194
|
{
|
13155
13195
|
"disabled": false,
|
13156
13196
|
"document": "风险列表",
|
13157
|
-
"example": "[
|
13197
|
+
"example": "[{\"Title\": \"禁用未授权访问\",\"Body\": \"应禁止未授权的访问\"}]",
|
13158
13198
|
"member": "ServerRiskSuggestion",
|
13159
13199
|
"name": "RiskList",
|
13160
13200
|
"output_required": true,
|
@@ -13164,7 +13204,7 @@
|
|
13164
13204
|
{
|
13165
13205
|
"disabled": false,
|
13166
13206
|
"document": "建议列表",
|
13167
|
-
"example": "[{\"Title\": \"禁用未授权访问\"
|
13207
|
+
"example": "[{\"Title\": \"禁用未授权访问\",\"Body\": \"应禁止未授权的访问\"}]",
|
13168
13208
|
"member": "ServerRiskSuggestion",
|
13169
13209
|
"name": "SuggestionList",
|
13170
13210
|
"output_required": true,
|
@@ -13180,6 +13220,26 @@
|
|
13180
13220
|
"output_required": false,
|
13181
13221
|
"type": "string",
|
13182
13222
|
"value_allowed_null": false
|
13223
|
+
},
|
13224
|
+
{
|
13225
|
+
"disabled": false,
|
13226
|
+
"document": "新风险等级,high_risk 高危 suspect 疑似 Normal 暂无风险",
|
13227
|
+
"example": "high",
|
13228
|
+
"member": "string",
|
13229
|
+
"name": "NewLevel",
|
13230
|
+
"output_required": false,
|
13231
|
+
"type": "string",
|
13232
|
+
"value_allowed_null": false
|
13233
|
+
},
|
13234
|
+
{
|
13235
|
+
"disabled": false,
|
13236
|
+
"document": "状态,0未处理、1已处置、2已忽略、3云防已防护、4无需处理",
|
13237
|
+
"example": "o",
|
13238
|
+
"member": "uint64",
|
13239
|
+
"name": "XspmStatus",
|
13240
|
+
"output_required": false,
|
13241
|
+
"type": "int",
|
13242
|
+
"value_allowed_null": false
|
13183
13243
|
}
|
13184
13244
|
],
|
13185
13245
|
"usage": "out"
|
tccli/services/cvm/cvm_client.py
CHANGED
@@ -693,6 +693,58 @@ def doResetInstancesType(args, parsed_globals):
|
|
693
693
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
694
694
|
|
695
695
|
|
696
|
+
def doDescribeReservedInstancesConfigInfos(args, parsed_globals):
|
697
|
+
g_param = parse_global_arg(parsed_globals)
|
698
|
+
|
699
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
700
|
+
cred = credential.CVMRoleCredential()
|
701
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
702
|
+
cred = credential.STSAssumeRoleCredential(
|
703
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
704
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
705
|
+
)
|
706
|
+
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):
|
707
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
708
|
+
else:
|
709
|
+
cred = credential.Credential(
|
710
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
711
|
+
)
|
712
|
+
http_profile = HttpProfile(
|
713
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
714
|
+
reqMethod="POST",
|
715
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
716
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
717
|
+
)
|
718
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
719
|
+
if g_param[OptionsDefine.Language]:
|
720
|
+
profile.language = g_param[OptionsDefine.Language]
|
721
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
722
|
+
client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
|
723
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
724
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
725
|
+
model = models.DescribeReservedInstancesConfigInfosRequest()
|
726
|
+
model.from_json_string(json.dumps(args))
|
727
|
+
start_time = time.time()
|
728
|
+
while True:
|
729
|
+
rsp = client.DescribeReservedInstancesConfigInfos(model)
|
730
|
+
result = rsp.to_json_string()
|
731
|
+
try:
|
732
|
+
json_obj = json.loads(result)
|
733
|
+
except TypeError as e:
|
734
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
735
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
736
|
+
break
|
737
|
+
cur_time = time.time()
|
738
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
739
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
740
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
741
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
742
|
+
else:
|
743
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
744
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
745
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
746
|
+
|
747
|
+
|
696
748
|
def doDescribeInstanceVncUrl(args, parsed_globals):
|
697
749
|
g_param = parse_global_arg(parsed_globals)
|
698
750
|
|
@@ -745,6 +797,58 @@ def doDescribeInstanceVncUrl(args, parsed_globals):
|
|
745
797
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
746
798
|
|
747
799
|
|
800
|
+
def doInquirePricePurchaseReservedInstancesOffering(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('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
809
|
+
)
|
810
|
+
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):
|
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.CvmClient(cred, g_param[OptionsDefine.Region], profile)
|
827
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
828
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
829
|
+
model = models.InquirePricePurchaseReservedInstancesOfferingRequest()
|
830
|
+
model.from_json_string(json.dumps(args))
|
831
|
+
start_time = time.time()
|
832
|
+
while True:
|
833
|
+
rsp = client.InquirePricePurchaseReservedInstancesOffering(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
|
+
|
748
852
|
def doSyncImages(args, parsed_globals):
|
749
853
|
g_param = parse_global_arg(parsed_globals)
|
750
854
|
|
@@ -2721,6 +2825,58 @@ def doInquiryPriceResetInstance(args, parsed_globals):
|
|
2721
2825
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2722
2826
|
|
2723
2827
|
|
2828
|
+
def doPurchaseReservedInstancesOffering(args, parsed_globals):
|
2829
|
+
g_param = parse_global_arg(parsed_globals)
|
2830
|
+
|
2831
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2832
|
+
cred = credential.CVMRoleCredential()
|
2833
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2834
|
+
cred = credential.STSAssumeRoleCredential(
|
2835
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2836
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2837
|
+
)
|
2838
|
+
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):
|
2839
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2840
|
+
else:
|
2841
|
+
cred = credential.Credential(
|
2842
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2843
|
+
)
|
2844
|
+
http_profile = HttpProfile(
|
2845
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2846
|
+
reqMethod="POST",
|
2847
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2848
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2849
|
+
)
|
2850
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2851
|
+
if g_param[OptionsDefine.Language]:
|
2852
|
+
profile.language = g_param[OptionsDefine.Language]
|
2853
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2854
|
+
client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
|
2855
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2856
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2857
|
+
model = models.PurchaseReservedInstancesOfferingRequest()
|
2858
|
+
model.from_json_string(json.dumps(args))
|
2859
|
+
start_time = time.time()
|
2860
|
+
while True:
|
2861
|
+
rsp = client.PurchaseReservedInstancesOffering(model)
|
2862
|
+
result = rsp.to_json_string()
|
2863
|
+
try:
|
2864
|
+
json_obj = json.loads(result)
|
2865
|
+
except TypeError as e:
|
2866
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2867
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2868
|
+
break
|
2869
|
+
cur_time = time.time()
|
2870
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2871
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2872
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2873
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2874
|
+
else:
|
2875
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2876
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2877
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2878
|
+
|
2879
|
+
|
2724
2880
|
def doModifyInstancesRenewFlag(args, parsed_globals):
|
2725
2881
|
g_param = parse_global_arg(parsed_globals)
|
2726
2882
|
|
@@ -3397,6 +3553,58 @@ def doDescribeKeyPairs(args, parsed_globals):
|
|
3397
3553
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3398
3554
|
|
3399
3555
|
|
3556
|
+
def doDescribeReservedInstancesOfferings(args, parsed_globals):
|
3557
|
+
g_param = parse_global_arg(parsed_globals)
|
3558
|
+
|
3559
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3560
|
+
cred = credential.CVMRoleCredential()
|
3561
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3562
|
+
cred = credential.STSAssumeRoleCredential(
|
3563
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3564
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3565
|
+
)
|
3566
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
3567
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3568
|
+
else:
|
3569
|
+
cred = credential.Credential(
|
3570
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3571
|
+
)
|
3572
|
+
http_profile = HttpProfile(
|
3573
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3574
|
+
reqMethod="POST",
|
3575
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3576
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3577
|
+
)
|
3578
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3579
|
+
if g_param[OptionsDefine.Language]:
|
3580
|
+
profile.language = g_param[OptionsDefine.Language]
|
3581
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3582
|
+
client = mod.CvmClient(cred, g_param[OptionsDefine.Region], profile)
|
3583
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3584
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3585
|
+
model = models.DescribeReservedInstancesOfferingsRequest()
|
3586
|
+
model.from_json_string(json.dumps(args))
|
3587
|
+
start_time = time.time()
|
3588
|
+
while True:
|
3589
|
+
rsp = client.DescribeReservedInstancesOfferings(model)
|
3590
|
+
result = rsp.to_json_string()
|
3591
|
+
try:
|
3592
|
+
json_obj = json.loads(result)
|
3593
|
+
except TypeError as e:
|
3594
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3595
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3596
|
+
break
|
3597
|
+
cur_time = time.time()
|
3598
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3599
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3600
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3601
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3602
|
+
else:
|
3603
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3604
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3605
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3606
|
+
|
3607
|
+
|
3400
3608
|
def doInquiryPriceModifyInstancesChargeType(args, parsed_globals):
|
3401
3609
|
g_param = parse_global_arg(parsed_globals)
|
3402
3610
|
|
@@ -5085,7 +5293,9 @@ ACTION_MAP = {
|
|
5085
5293
|
"CreateImage": doCreateImage,
|
5086
5294
|
"ConfigureChcAssistVpc": doConfigureChcAssistVpc,
|
5087
5295
|
"ResetInstancesType": doResetInstancesType,
|
5296
|
+
"DescribeReservedInstancesConfigInfos": doDescribeReservedInstancesConfigInfos,
|
5088
5297
|
"DescribeInstanceVncUrl": doDescribeInstanceVncUrl,
|
5298
|
+
"InquirePricePurchaseReservedInstancesOffering": doInquirePricePurchaseReservedInstancesOffering,
|
5089
5299
|
"SyncImages": doSyncImages,
|
5090
5300
|
"ImportImage": doImportImage,
|
5091
5301
|
"DescribeZoneInstanceConfigInfos": doDescribeZoneInstanceConfigInfos,
|
@@ -5124,6 +5334,7 @@ ACTION_MAP = {
|
|
5124
5334
|
"DescribeInstancesActionTimer": doDescribeInstancesActionTimer,
|
5125
5335
|
"InquiryPriceResizeInstanceDisks": doInquiryPriceResizeInstanceDisks,
|
5126
5336
|
"InquiryPriceResetInstance": doInquiryPriceResetInstance,
|
5337
|
+
"PurchaseReservedInstancesOffering": doPurchaseReservedInstancesOffering,
|
5127
5338
|
"ModifyInstancesRenewFlag": doModifyInstancesRenewFlag,
|
5128
5339
|
"ResetInstance": doResetInstance,
|
5129
5340
|
"StartInstances": doStartInstances,
|
@@ -5137,6 +5348,7 @@ ACTION_MAP = {
|
|
5137
5348
|
"DescribeInstanceFamilyConfigs": doDescribeInstanceFamilyConfigs,
|
5138
5349
|
"ModifyInstancesProject": doModifyInstancesProject,
|
5139
5350
|
"DescribeKeyPairs": doDescribeKeyPairs,
|
5351
|
+
"DescribeReservedInstancesOfferings": doDescribeReservedInstancesOfferings,
|
5140
5352
|
"InquiryPriceModifyInstancesChargeType": doInquiryPriceModifyInstancesChargeType,
|
5141
5353
|
"DescribeInternetChargeTypeConfigs": doDescribeInternetChargeTypeConfigs,
|
5142
5354
|
"RebootInstances": doRebootInstances,
|