tccli 3.0.1112.1__py2.py3-none-any.whl → 3.0.1114.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/cat/v20180409/api.json +2 -2
- tccli/services/cat/v20180409/examples.json +2 -2
- tccli/services/ckafka/v20190819/api.json +13 -3
- tccli/services/dasb/v20191018/api.json +2 -2
- tccli/services/dbbrain/dbbrain_client.py +57 -4
- tccli/services/dbbrain/v20210527/api.json +173 -5
- tccli/services/dbbrain/v20210527/examples.json +15 -1
- tccli/services/dlc/dlc_client.py +129 -23
- tccli/services/dlc/v20210125/api.json +123 -0
- tccli/services/dlc/v20210125/examples.json +16 -0
- tccli/services/ess/ess_client.py +110 -4
- tccli/services/ess/v20201111/api.json +149 -4
- tccli/services/ess/v20201111/examples.json +18 -2
- tccli/services/essbasic/v20210526/api.json +12 -2
- tccli/services/essbasic/v20210526/examples.json +4 -4
- tccli/services/hunyuan/v20230901/api.json +7 -7
- tccli/services/hunyuan/v20230901/examples.json +6 -6
- tccli/services/iotexplorer/iotexplorer_client.py +53 -0
- tccli/services/iotexplorer/v20190423/api.json +61 -0
- tccli/services/iotexplorer/v20190423/examples.json +8 -0
- tccli/services/monitor/v20180724/api.json +27 -0
- tccli/services/mps/v20190612/api.json +67 -1
- tccli/services/svp/svp_client.py +159 -0
- tccli/services/svp/v20240125/api.json +723 -0
- tccli/services/svp/v20240125/examples.json +24 -0
- tccli/services/tdmq/v20200217/api.json +2 -2
- tccli/services/tione/tione_client.py +214 -2228
- tccli/services/tione/v20211111/api.json +5189 -10622
- tccli/services/tione/v20211111/examples.json +0 -304
- {tccli-3.0.1112.1.dist-info → tccli-3.0.1114.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1112.1.dist-info → tccli-3.0.1114.1.dist-info}/RECORD +35 -35
- {tccli-3.0.1112.1.dist-info → tccli-3.0.1114.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1112.1.dist-info → tccli-3.0.1114.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1112.1.dist-info → tccli-3.0.1114.1.dist-info}/license_files/LICENSE +0 -0
@@ -882,6 +882,13 @@
|
|
882
882
|
"output": "UnbindProductsResponse",
|
883
883
|
"status": "online"
|
884
884
|
},
|
885
|
+
"UpdateDeviceTWeCallAuthorizeStatus": {
|
886
|
+
"document": "更新用户对设备的TweCall授权状态",
|
887
|
+
"input": "UpdateDeviceTWeCallAuthorizeStatusRequest",
|
888
|
+
"name": "更新用户对设备的TweCall授权状态",
|
889
|
+
"output": "UpdateDeviceTWeCallAuthorizeStatusResponse",
|
890
|
+
"status": "online"
|
891
|
+
},
|
885
892
|
"UpdateDevicesEnableState": {
|
886
893
|
"document": "批量禁用启用设备",
|
887
894
|
"input": "UpdateDevicesEnableStateRequest",
|
@@ -12129,6 +12136,60 @@
|
|
12129
12136
|
],
|
12130
12137
|
"type": "object"
|
12131
12138
|
},
|
12139
|
+
"UpdateDeviceTWeCallAuthorizeStatusRequest": {
|
12140
|
+
"document": "UpdateDeviceTWeCallAuthorizeStatus请求参数结构体",
|
12141
|
+
"members": [
|
12142
|
+
{
|
12143
|
+
"disabled": false,
|
12144
|
+
"document": "TweCall授权状态:0未授权,1已授权",
|
12145
|
+
"example": "1",
|
12146
|
+
"member": "uint64",
|
12147
|
+
"name": "Status",
|
12148
|
+
"required": false,
|
12149
|
+
"type": "int"
|
12150
|
+
},
|
12151
|
+
{
|
12152
|
+
"disabled": false,
|
12153
|
+
"document": "产品ID",
|
12154
|
+
"example": "ProductId1",
|
12155
|
+
"member": "string",
|
12156
|
+
"name": "ProductId",
|
12157
|
+
"required": false,
|
12158
|
+
"type": "string"
|
12159
|
+
},
|
12160
|
+
{
|
12161
|
+
"disabled": false,
|
12162
|
+
"document": "设备名",
|
12163
|
+
"example": "DeviceName1",
|
12164
|
+
"member": "string",
|
12165
|
+
"name": "DeviceName",
|
12166
|
+
"required": false,
|
12167
|
+
"type": "string"
|
12168
|
+
},
|
12169
|
+
{
|
12170
|
+
"disabled": false,
|
12171
|
+
"document": "微信用户的openId",
|
12172
|
+
"example": "111",
|
12173
|
+
"member": "string",
|
12174
|
+
"name": "WechatOpenId",
|
12175
|
+
"required": false,
|
12176
|
+
"type": "string"
|
12177
|
+
}
|
12178
|
+
],
|
12179
|
+
"type": "object"
|
12180
|
+
},
|
12181
|
+
"UpdateDeviceTWeCallAuthorizeStatusResponse": {
|
12182
|
+
"document": "UpdateDeviceTWeCallAuthorizeStatus返回参数结构体",
|
12183
|
+
"members": [
|
12184
|
+
{
|
12185
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
12186
|
+
"member": "string",
|
12187
|
+
"name": "RequestId",
|
12188
|
+
"type": "string"
|
12189
|
+
}
|
12190
|
+
],
|
12191
|
+
"type": "object"
|
12192
|
+
},
|
12132
12193
|
"UpdateDevicesEnableStateRequest": {
|
12133
12194
|
"document": "UpdateDevicesEnableState请求参数结构体",
|
12134
12195
|
"members": [
|
@@ -1062,6 +1062,14 @@
|
|
1062
1062
|
"title": "批量解绑子产品"
|
1063
1063
|
}
|
1064
1064
|
],
|
1065
|
+
"UpdateDeviceTWeCallAuthorizeStatus": [
|
1066
|
+
{
|
1067
|
+
"document": "",
|
1068
|
+
"input": "POST / HTTP/1.1\nHost: iotexplorer.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: UpdateDeviceTWeCallAuthorizeStatus\n<公共请求参数>\n\n{\n \"Status\": 1,\n \"ProductId\": \"ProductId1\",\n \"DeviceName\": \"DeviceName1\",\n \"WechatOpenId\": \"111111\"\n}",
|
1069
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"abc\"\n }\n}",
|
1070
|
+
"title": "授权示例"
|
1071
|
+
}
|
1072
|
+
],
|
1065
1073
|
"UpdateDevicesEnableState": [
|
1066
1074
|
{
|
1067
1075
|
"document": "批量禁用启用设备",
|
@@ -11382,6 +11382,33 @@
|
|
11382
11382
|
"name": "Limit",
|
11383
11383
|
"required": false,
|
11384
11384
|
"type": "int"
|
11385
|
+
},
|
11386
|
+
{
|
11387
|
+
"disabled": false,
|
11388
|
+
"document": "用于通过集群id过滤被绑定集群",
|
11389
|
+
"example": "[\"cls-12345\"]",
|
11390
|
+
"member": "string",
|
11391
|
+
"name": "ClusterIds",
|
11392
|
+
"required": false,
|
11393
|
+
"type": "list"
|
11394
|
+
},
|
11395
|
+
{
|
11396
|
+
"disabled": false,
|
11397
|
+
"document": "用于通过集群类型过滤被绑定集群",
|
11398
|
+
"example": "[\"eks\"]",
|
11399
|
+
"member": "string",
|
11400
|
+
"name": "ClusterTypes",
|
11401
|
+
"required": false,
|
11402
|
+
"type": "list"
|
11403
|
+
},
|
11404
|
+
{
|
11405
|
+
"disabled": false,
|
11406
|
+
"document": "用于通过名称搜索被绑定集群",
|
11407
|
+
"example": "测试集群",
|
11408
|
+
"member": "string",
|
11409
|
+
"name": "ClusterName",
|
11410
|
+
"required": false,
|
11411
|
+
"type": "string"
|
11385
11412
|
}
|
11386
11413
|
],
|
11387
11414
|
"type": "object"
|
@@ -15936,7 +15936,7 @@
|
|
15936
15936
|
"members": [
|
15937
15937
|
{
|
15938
15938
|
"disabled": false,
|
15939
|
-
"document": "结果的类型,取值范围:\n<li>FaceRecognition:人脸识别,</li>\n<li>AsrWordsRecognition:语音关键词识别,</li>\n<li>OcrWordsRecognition:文本关键词识别,</li>\n<li>AsrFullTextRecognition:语音全文识别,</li>\n<li>OcrFullTextRecognition:文本全文识别。</li>\n<li>TransTextRecognition:语音翻译。</li>\n<li>TagRecognition:精彩打点。</li>",
|
15939
|
+
"document": "结果的类型,取值范围:\n<li>FaceRecognition:人脸识别,</li>\n<li>AsrWordsRecognition:语音关键词识别,</li>\n<li>OcrWordsRecognition:文本关键词识别,</li>\n<li>AsrFullTextRecognition:语音全文识别,</li>\n<li>OcrFullTextRecognition:文本全文识别。</li>\n<li>TransTextRecognition:语音翻译。</li>\n<li>ObjectRecognition:目标检测。</li>\n<li>TagRecognition:精彩打点。</li>",
|
15940
15940
|
"example": "FaceRecognition",
|
15941
15941
|
"member": "string",
|
15942
15942
|
"name": "Type",
|
@@ -16004,6 +16004,16 @@
|
|
16004
16004
|
"type": "list",
|
16005
16005
|
"value_allowed_null": false
|
16006
16006
|
},
|
16007
|
+
{
|
16008
|
+
"disabled": false,
|
16009
|
+
"document": "目标检测结果,当Type为 ObjectRecognition 时有效。",
|
16010
|
+
"example": "NULL",
|
16011
|
+
"member": "LiveStreamObjectRecognitionResult",
|
16012
|
+
"name": "ObjectRecognitionResultSet",
|
16013
|
+
"output_required": true,
|
16014
|
+
"type": "list",
|
16015
|
+
"value_allowed_null": false
|
16016
|
+
},
|
16007
16017
|
{
|
16008
16018
|
"disabled": false,
|
16009
16019
|
"document": "打点结果,当Type 为 TagRecognition 时有效。\n注意:此字段可能返回 null,表示取不到有效值。",
|
@@ -16591,6 +16601,62 @@
|
|
16591
16601
|
],
|
16592
16602
|
"usage": "out"
|
16593
16603
|
},
|
16604
|
+
"LiveStreamObjectRecognitionResult": {
|
16605
|
+
"document": "直播 AI 物体识别结果",
|
16606
|
+
"members": [
|
16607
|
+
{
|
16608
|
+
"disabled": false,
|
16609
|
+
"document": "识别的物体名称。",
|
16610
|
+
"example": "",
|
16611
|
+
"member": "string",
|
16612
|
+
"name": "Name",
|
16613
|
+
"required": true,
|
16614
|
+
"type": "string",
|
16615
|
+
"value_allowed_null": false
|
16616
|
+
},
|
16617
|
+
{
|
16618
|
+
"disabled": false,
|
16619
|
+
"document": "识别片段起始的 PTS 时间,单位:秒。",
|
16620
|
+
"example": "",
|
16621
|
+
"member": "float",
|
16622
|
+
"name": "StartPtsOffset",
|
16623
|
+
"required": true,
|
16624
|
+
"type": "float",
|
16625
|
+
"value_allowed_null": false
|
16626
|
+
},
|
16627
|
+
{
|
16628
|
+
"disabled": false,
|
16629
|
+
"document": "识别片段终止的 PTS 时间,单位:秒。",
|
16630
|
+
"example": "",
|
16631
|
+
"member": "float",
|
16632
|
+
"name": "EndPtsOffset",
|
16633
|
+
"required": true,
|
16634
|
+
"type": "float",
|
16635
|
+
"value_allowed_null": false
|
16636
|
+
},
|
16637
|
+
{
|
16638
|
+
"disabled": false,
|
16639
|
+
"document": "识别片段置信度。取值:0~100。",
|
16640
|
+
"example": "",
|
16641
|
+
"member": "float",
|
16642
|
+
"name": "Confidence",
|
16643
|
+
"required": true,
|
16644
|
+
"type": "float",
|
16645
|
+
"value_allowed_null": false
|
16646
|
+
},
|
16647
|
+
{
|
16648
|
+
"disabled": false,
|
16649
|
+
"document": "识别结果的区域坐标。数组包含 4 个元素 [x1,y1,x2,y2],依次表示区域左上点、右下点的横纵坐标。",
|
16650
|
+
"example": "",
|
16651
|
+
"member": "int64",
|
16652
|
+
"name": "AreaCoordSet",
|
16653
|
+
"required": true,
|
16654
|
+
"type": "list",
|
16655
|
+
"value_allowed_null": false
|
16656
|
+
}
|
16657
|
+
],
|
16658
|
+
"usage": "out"
|
16659
|
+
},
|
16594
16660
|
"LiveStreamOcrFullTextRecognitionResult": {
|
16595
16661
|
"document": "直播识别 Ocr 全文识别",
|
16596
16662
|
"members": [
|
tccli/services/svp/svp_client.py
CHANGED
@@ -17,6 +17,110 @@ from tencentcloud.svp.v20240125 import models as models_v20240125
|
|
17
17
|
from jmespath import search
|
18
18
|
import time
|
19
19
|
|
20
|
+
def doDescribeSavingPlanUsage(args, parsed_globals):
|
21
|
+
g_param = parse_global_arg(parsed_globals)
|
22
|
+
|
23
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
24
|
+
cred = credential.CVMRoleCredential()
|
25
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
26
|
+
cred = credential.STSAssumeRoleCredential(
|
27
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
28
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
29
|
+
)
|
30
|
+
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):
|
31
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
32
|
+
else:
|
33
|
+
cred = credential.Credential(
|
34
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
35
|
+
)
|
36
|
+
http_profile = HttpProfile(
|
37
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
38
|
+
reqMethod="POST",
|
39
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
40
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
41
|
+
)
|
42
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
43
|
+
if g_param[OptionsDefine.Language]:
|
44
|
+
profile.language = g_param[OptionsDefine.Language]
|
45
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
46
|
+
client = mod.SvpClient(cred, g_param[OptionsDefine.Region], profile)
|
47
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
48
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
+
model = models.DescribeSavingPlanUsageRequest()
|
50
|
+
model.from_json_string(json.dumps(args))
|
51
|
+
start_time = time.time()
|
52
|
+
while True:
|
53
|
+
rsp = client.DescribeSavingPlanUsage(model)
|
54
|
+
result = rsp.to_json_string()
|
55
|
+
try:
|
56
|
+
json_obj = json.loads(result)
|
57
|
+
except TypeError as e:
|
58
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
59
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
60
|
+
break
|
61
|
+
cur_time = time.time()
|
62
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
63
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
64
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
65
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
66
|
+
else:
|
67
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
68
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
69
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
70
|
+
|
71
|
+
|
72
|
+
def doDescribeSavingPlanOverview(args, parsed_globals):
|
73
|
+
g_param = parse_global_arg(parsed_globals)
|
74
|
+
|
75
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
76
|
+
cred = credential.CVMRoleCredential()
|
77
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
78
|
+
cred = credential.STSAssumeRoleCredential(
|
79
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
80
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
81
|
+
)
|
82
|
+
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):
|
83
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
84
|
+
else:
|
85
|
+
cred = credential.Credential(
|
86
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
87
|
+
)
|
88
|
+
http_profile = HttpProfile(
|
89
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
90
|
+
reqMethod="POST",
|
91
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
92
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
93
|
+
)
|
94
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
95
|
+
if g_param[OptionsDefine.Language]:
|
96
|
+
profile.language = g_param[OptionsDefine.Language]
|
97
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
98
|
+
client = mod.SvpClient(cred, g_param[OptionsDefine.Region], profile)
|
99
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
100
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
+
model = models.DescribeSavingPlanOverviewRequest()
|
102
|
+
model.from_json_string(json.dumps(args))
|
103
|
+
start_time = time.time()
|
104
|
+
while True:
|
105
|
+
rsp = client.DescribeSavingPlanOverview(model)
|
106
|
+
result = rsp.to_json_string()
|
107
|
+
try:
|
108
|
+
json_obj = json.loads(result)
|
109
|
+
except TypeError as e:
|
110
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
111
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
112
|
+
break
|
113
|
+
cur_time = time.time()
|
114
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
115
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
116
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
117
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
118
|
+
else:
|
119
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
120
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
121
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
|
+
|
123
|
+
|
20
124
|
def doCreateSavingPlanOrder(args, parsed_globals):
|
21
125
|
g_param = parse_global_arg(parsed_globals)
|
22
126
|
|
@@ -69,6 +173,58 @@ def doCreateSavingPlanOrder(args, parsed_globals):
|
|
69
173
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
70
174
|
|
71
175
|
|
176
|
+
def doDescribeSavingPlanDeduct(args, parsed_globals):
|
177
|
+
g_param = parse_global_arg(parsed_globals)
|
178
|
+
|
179
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
180
|
+
cred = credential.CVMRoleCredential()
|
181
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
182
|
+
cred = credential.STSAssumeRoleCredential(
|
183
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
184
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
185
|
+
)
|
186
|
+
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):
|
187
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
188
|
+
else:
|
189
|
+
cred = credential.Credential(
|
190
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
191
|
+
)
|
192
|
+
http_profile = HttpProfile(
|
193
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
194
|
+
reqMethod="POST",
|
195
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
196
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
197
|
+
)
|
198
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
199
|
+
if g_param[OptionsDefine.Language]:
|
200
|
+
profile.language = g_param[OptionsDefine.Language]
|
201
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
202
|
+
client = mod.SvpClient(cred, g_param[OptionsDefine.Region], profile)
|
203
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
204
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
205
|
+
model = models.DescribeSavingPlanDeductRequest()
|
206
|
+
model.from_json_string(json.dumps(args))
|
207
|
+
start_time = time.time()
|
208
|
+
while True:
|
209
|
+
rsp = client.DescribeSavingPlanDeduct(model)
|
210
|
+
result = rsp.to_json_string()
|
211
|
+
try:
|
212
|
+
json_obj = json.loads(result)
|
213
|
+
except TypeError as e:
|
214
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
215
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
216
|
+
break
|
217
|
+
cur_time = time.time()
|
218
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
219
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
220
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
221
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
222
|
+
else:
|
223
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
224
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
225
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
|
+
|
227
|
+
|
72
228
|
CLIENT_MAP = {
|
73
229
|
"v20240125": svp_client_v20240125,
|
74
230
|
|
@@ -80,7 +236,10 @@ MODELS_MAP = {
|
|
80
236
|
}
|
81
237
|
|
82
238
|
ACTION_MAP = {
|
239
|
+
"DescribeSavingPlanUsage": doDescribeSavingPlanUsage,
|
240
|
+
"DescribeSavingPlanOverview": doDescribeSavingPlanOverview,
|
83
241
|
"CreateSavingPlanOrder": doCreateSavingPlanOrder,
|
242
|
+
"DescribeSavingPlanDeduct": doDescribeSavingPlanDeduct,
|
84
243
|
|
85
244
|
}
|
86
245
|
|