tccli 3.0.1113.1__py2.py3-none-any.whl → 3.0.1115.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/asr/v20190614/api.json +1 -1
- tccli/services/cat/v20180409/api.json +2 -2
- tccli/services/cat/v20180409/examples.json +2 -2
- tccli/services/cdwdoris/v20211228/api.json +9 -0
- tccli/services/cynosdb/v20190107/api.json +151 -50
- tccli/services/dasb/dasb_client.py +347 -29
- tccli/services/dasb/v20191018/api.json +966 -13
- tccli/services/dasb/v20191018/examples.json +48 -0
- tccli/services/dbbrain/dbbrain_client.py +110 -4
- tccli/services/dbbrain/v20210527/api.json +235 -5
- tccli/services/dbbrain/v20210527/examples.json +23 -1
- tccli/services/dlc/dlc_client.py +190 -31
- tccli/services/dlc/v20210125/api.json +176 -0
- tccli/services/dlc/v20210125/examples.json +24 -0
- tccli/services/dsgc/v20190723/api.json +30 -17
- tccli/services/dsgc/v20190723/examples.json +1 -1
- tccli/services/ess/ess_client.py +110 -4
- tccli/services/ess/v20201111/api.json +146 -1
- tccli/services/ess/v20201111/examples.json +17 -1
- tccli/services/essbasic/v20210526/api.json +12 -2
- tccli/services/essbasic/v20210526/examples.json +4 -4
- tccli/services/hunyuan/v20230901/api.json +6 -6
- tccli/services/hunyuan/v20230901/examples.json +6 -6
- tccli/services/iotexplorer/iotexplorer_client.py +326 -8
- tccli/services/iotexplorer/v20190423/api.json +583 -0
- tccli/services/iotexplorer/v20190423/examples.json +48 -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/v20211111/api.json +11 -0
- {tccli-3.0.1113.1.dist-info → tccli-3.0.1115.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1113.1.dist-info → tccli-3.0.1115.1.dist-info}/RECORD +39 -39
- {tccli-3.0.1113.1.dist-info → tccli-3.0.1115.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1113.1.dist-info → tccli-3.0.1115.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1113.1.dist-info → tccli-3.0.1115.1.dist-info}/license_files/LICENSE +0 -0
@@ -1,5 +1,21 @@
|
|
1
1
|
{
|
2
2
|
"actions": {
|
3
|
+
"ActivateTWeCallLicense": [
|
4
|
+
{
|
5
|
+
"document": "",
|
6
|
+
"input": "POST / HTTP/1.1\nHost: iotexplorer.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ActivateTWeCallLicense\n<公共请求参数>\n\n{\n \"PkgType\": 1,\n \"MiniProgramAppId\": \"abc\",\n \"DeviceList\": [\n {\n \"ModelId\": \"1qaz\",\n \"Sn\": \"p/d\"\n }\n ]\n}",
|
7
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"abc\"\n }\n}",
|
8
|
+
"title": "成功激活示例"
|
9
|
+
}
|
10
|
+
],
|
11
|
+
"AssignTWeCallLicense": [
|
12
|
+
{
|
13
|
+
"document": "",
|
14
|
+
"input": "POST / HTTP/1.1\nHost: iotexplorer.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: AssignTWeCallLicense\n<公共请求参数>\n\n{\n \"PkgType\": 1,\n \"MiniProgramAppId\": \"abc\",\n \"DeductNum\": 1\n}",
|
15
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"abc\"\n }\n}",
|
16
|
+
"title": "分配成功"
|
17
|
+
}
|
18
|
+
],
|
3
19
|
"BindCloudStorageUser": [
|
4
20
|
{
|
5
21
|
"document": "",
|
@@ -52,6 +68,14 @@
|
|
52
68
|
"title": "同步调用设备行为,设备不在线。"
|
53
69
|
}
|
54
70
|
],
|
71
|
+
"CancelAssignTWeCallLicense": [
|
72
|
+
{
|
73
|
+
"document": "",
|
74
|
+
"input": "POST / HTTP/1.1\nHost: iotexplorer.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CancelAssignTWeCallLicense\n<公共请求参数>\n\n{\n \"PkgId\": \"abc\"\n}",
|
75
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"abc\"\n }\n}",
|
76
|
+
"title": "成功取消分配"
|
77
|
+
}
|
78
|
+
],
|
55
79
|
"ControlDeviceData": [
|
56
80
|
{
|
57
81
|
"document": "设置设备数据",
|
@@ -706,6 +730,14 @@
|
|
706
730
|
"title": "获取视频防盗链播放URL"
|
707
731
|
}
|
708
732
|
],
|
733
|
+
"GetAuthMiniProgramAppList": [
|
734
|
+
{
|
735
|
+
"document": "",
|
736
|
+
"input": "POST / HTTP/1.1\nHost: iotexplorer.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: GetAuthMiniProgramAppList\n<公共请求参数>\n\n{\n \"MiniProgramAppId\": \"123wdc\"\n}",
|
737
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"abc\",\n \"Total\": 1,\n \"MiniProgramList\": [\n {\n \"MiniProgramAppId\": \"1qaz\",\n \"MiniProgramName\": \"appBane\",\n \"LicenseNum\": 100,\n \"CreateTime\": 45674345567\n }\n ]\n }\n}",
|
738
|
+
"title": "成功查询小程序列表"
|
739
|
+
}
|
740
|
+
],
|
709
741
|
"GetBatchProductionsList": [
|
710
742
|
{
|
711
743
|
"document": "",
|
@@ -800,6 +832,22 @@
|
|
800
832
|
"title": "获取产品列表"
|
801
833
|
}
|
802
834
|
],
|
835
|
+
"GetTWeCallActiveStatus": [
|
836
|
+
{
|
837
|
+
"document": "",
|
838
|
+
"input": "POST / HTTP/1.1\nHost: iotexplorer.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: GetTWeCallActiveStatus\n<公共请求参数>\n\n{\n \"MiniProgramAppId\": \"abc\",\n \"DeviceList\": [\n {\n \"ModelId\": \"1qaz\",\n \"Sn\": \"p/d\"\n }\n ]\n}",
|
839
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"abc\",\n \"TWeCallActiveInfos\": [\n {\n \"ModelId\": \"1qaz\",\n \"Sn\": \"p/d\",\n \"ExpireTime\": 45674345567\n }\n ]\n }\n}",
|
840
|
+
"title": "成功获取激活状态"
|
841
|
+
}
|
842
|
+
],
|
843
|
+
"GetTWeCallPkgList": [
|
844
|
+
{
|
845
|
+
"document": "",
|
846
|
+
"input": "POST / HTTP/1.1\nHost: iotexplorer.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: GetTWeCallPkgList\n<公共请求参数>\n\n{\n \"MiniProgramAppId\": \"abc\"\n}",
|
847
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"abc\",\n \"Total\": 1,\n \"TWeCallPkgList\": [\n {\n \"PkgId\": \"1qaz\",\n \"PkgType\": 1,\n \"CreateTime\": 45674345567,\n \"ExpireTime\": 45674345567,\n \"LicenseTotalNum\": 1,\n \"LicenseUsedNum\": 1\n }\n ]\n }\n}",
|
848
|
+
"title": "成功查询示例"
|
849
|
+
}
|
850
|
+
],
|
803
851
|
"GetTopicRuleList": [
|
804
852
|
{
|
805
853
|
"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
|
|