tccli 3.0.1145.1__py2.py3-none-any.whl → 3.0.1147.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/aiart/v20221229/api.json +2 -2
- tccli/services/aiart/v20221229/examples.json +4 -4
- tccli/services/cdb/v20170320/api.json +16 -12
- tccli/services/cdn/v20180606/api.json +1 -1
- tccli/services/emr/v20190103/api.json +5 -5
- tccli/services/es/v20180416/api.json +13 -0
- tccli/services/ess/v20201111/api.json +9 -0
- tccli/services/essbasic/v20210526/api.json +24 -15
- tccli/services/goosefs/v20220519/api.json +92 -12
- tccli/services/iotexplorer/v20190423/api.json +1 -1
- tccli/services/ivld/ivld_client.py +163 -4
- tccli/services/ivld/v20210903/api.json +443 -0
- tccli/services/ivld/v20210903/examples.json +24 -0
- tccli/services/live/v20180801/api.json +7 -5
- tccli/services/lke/v20231130/api.json +11 -1
- tccli/services/lke/v20231130/examples.json +2 -2
- tccli/services/mps/v20190612/api.json +20 -0
- tccli/services/ocr/v20181119/api.json +9 -0
- tccli/services/postgres/v20170312/api.json +7 -7
- tccli/services/rum/v20210622/api.json +9 -0
- tccli/services/smpn/smpn_client.py +0 -159
- tccli/services/smpn/v20190822/api.json +0 -312
- tccli/services/smpn/v20190822/examples.json +0 -24
- tccli/services/tdcpg/v20211118/api.json +4 -4
- tccli/services/tdcpg/v20211118/examples.json +2 -2
- tccli/services/tke/v20180525/api.json +3 -0
- tccli/services/trtc/trtc_client.py +163 -4
- tccli/services/trtc/v20190722/api.json +311 -0
- tccli/services/trtc/v20190722/examples.json +24 -0
- tccli/services/tse/v20201207/api.json +19 -0
- tccli/services/vpc/v20170312/api.json +143 -25
- tccli/services/vpc/v20170312/examples.json +10 -2
- tccli/services/vpc/vpc_client.py +69 -16
- tccli/services/waf/v20180125/api.json +2 -2
- {tccli-3.0.1145.1.dist-info → tccli-3.0.1147.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1145.1.dist-info → tccli-3.0.1147.1.dist-info}/RECORD +40 -40
- {tccli-3.0.1145.1.dist-info → tccli-3.0.1147.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1145.1.dist-info → tccli-3.0.1147.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1145.1.dist-info → tccli-3.0.1147.1.dist-info}/license_files/LICENSE +0 -0
@@ -416,14 +416,14 @@
|
|
416
416
|
"DescribeLiveCert": {
|
417
417
|
"document": "获取证书信息",
|
418
418
|
"input": "DescribeLiveCertRequest",
|
419
|
-
"name": "获取证书信息",
|
419
|
+
"name": "获取证书信息(该接口已下线,请使用新接口 ssl.DescribeCertificateDetail)",
|
420
420
|
"output": "DescribeLiveCertResponse",
|
421
421
|
"status": "online"
|
422
422
|
},
|
423
423
|
"DescribeLiveCerts": {
|
424
424
|
"document": "获取证书信息列表",
|
425
425
|
"input": "DescribeLiveCertsRequest",
|
426
|
-
"name": "获取证书信息列表",
|
426
|
+
"name": "获取证书信息列表(该接口已下线,请使用新接口 DescribeLiveDomainCertBindings)",
|
427
427
|
"output": "DescribeLiveCertsResponse",
|
428
428
|
"status": "online"
|
429
429
|
},
|
@@ -6181,7 +6181,7 @@
|
|
6181
6181
|
{
|
6182
6182
|
"disabled": false,
|
6183
6183
|
"document": "DescribeLiveCerts接口获取到的证书Id。",
|
6184
|
-
"example": "",
|
6184
|
+
"example": "F4eO8WVE",
|
6185
6185
|
"member": "int64",
|
6186
6186
|
"name": "CertId",
|
6187
6187
|
"required": true,
|
@@ -6196,9 +6196,10 @@
|
|
6196
6196
|
{
|
6197
6197
|
"disabled": false,
|
6198
6198
|
"document": "证书信息。",
|
6199
|
-
"example": "",
|
6199
|
+
"example": "{}",
|
6200
6200
|
"member": "CertInfo",
|
6201
6201
|
"name": "CertInfo",
|
6202
|
+
"output_required": true,
|
6202
6203
|
"type": "object",
|
6203
6204
|
"value_allowed_null": false
|
6204
6205
|
},
|
@@ -6222,9 +6223,10 @@
|
|
6222
6223
|
{
|
6223
6224
|
"disabled": false,
|
6224
6225
|
"document": "证书信息列表。",
|
6225
|
-
"example": "",
|
6226
|
+
"example": "{}",
|
6226
6227
|
"member": "CertInfo",
|
6227
6228
|
"name": "CertInfoSet",
|
6229
|
+
"output_required": true,
|
6228
6230
|
"type": "list",
|
6229
6231
|
"value_allowed_null": false
|
6230
6232
|
},
|
@@ -477,7 +477,7 @@
|
|
477
477
|
"status": "online"
|
478
478
|
},
|
479
479
|
"ParseDoc": {
|
480
|
-
"document": "接口即将下线,请切换使用新接口:[文档解析](https://cloud.tencent.com/document/product/1759/107504)
|
480
|
+
"document": "接口即将下线,请切换使用新接口:[文档解析](https://cloud.tencent.com/document/product/1759/107504)",
|
481
481
|
"input": "ParseDocRequest",
|
482
482
|
"name": "文档解析旧版(请迁移新接口)",
|
483
483
|
"output": "ParseDocResponse",
|
@@ -6026,6 +6026,16 @@
|
|
6026
6026
|
"output_required": false,
|
6027
6027
|
"type": "string",
|
6028
6028
|
"value_allowed_null": true
|
6029
|
+
},
|
6030
|
+
{
|
6031
|
+
"disabled": false,
|
6032
|
+
"document": "是否允许重试,0:否,1:是\n注意:此字段可能返回 null,表示取不到有效值。",
|
6033
|
+
"example": "无",
|
6034
|
+
"member": "bool",
|
6035
|
+
"name": "IsAllowRetry",
|
6036
|
+
"output_required": false,
|
6037
|
+
"type": "bool",
|
6038
|
+
"value_allowed_null": true
|
6029
6039
|
}
|
6030
6040
|
],
|
6031
6041
|
"usage": "out"
|
@@ -68,7 +68,7 @@
|
|
68
68
|
{
|
69
69
|
"document": "",
|
70
70
|
"input": "POST / HTTP/1.1\nHost: lke.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateReconstructDocumentFlow\n<公共请求参数>\n\n{\n \"FileStartPageNumber\": 1,\n \"FileEndPageNumber\": 1,\n \"Config\": {\n \"TableResultType\": \"1\"\n },\n \"FileBase64\": \"data:application/pdf;base64,JVBERi0xLjcKXXX...\"\n}",
|
71
|
-
"output": "{\n \"Response\": {\n \"RequestId\": \"1d569fb4-4c9d-4141-bbd7-e1d8735bd1a9\",\n \"TaskId\": \"
|
71
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"1d569fb4-4c9d-4141-bbd7-e1d8735bd1a9\",\n \"TaskId\": \"123123123\"\n }\n}",
|
72
72
|
"title": "接口请求成功示例"
|
73
73
|
}
|
74
74
|
],
|
@@ -321,7 +321,7 @@
|
|
321
321
|
"GetReconstructDocumentResult": [
|
322
322
|
{
|
323
323
|
"document": "",
|
324
|
-
"input": "POST / HTTP/1.1\nHost: lke.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: GetReconstructDocumentResult\n<公共请求参数>\n\n{\n \"TaskId\": \"
|
324
|
+
"input": "POST / HTTP/1.1\nHost: lke.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: GetReconstructDocumentResult\n<公共请求参数>\n\n{\n \"TaskId\": \"123123123\"\n}",
|
325
325
|
"output": "{\n \"Response\": {\n \"DocumentRecognizeResultUrl\": \"https://document-restruction-1258344699.cos.ap-guangzhou.myqcloud.com/doc_parse/output_files/a9c6a9482c72412fa84445a44ss125531.zip?q-sign-algorithm=sha1&q-ak=AKIDlWFaadfHLNbidLwPqOrAKGzXrx40scL7l&q-sign-time=1715503711%3B1718804311&q-key-time=1718855711%3B1718804311&q-header-list=host&q-url-param-list=&q-signature=71b568b8632d7e45gertdc3d235ef68d41fdfe7f8\",\n \"FailedPages\": [],\n \"RequestId\": \"a37b0d0b-c3af-44bd-iuiu-632442644a80\",\n \"Status\": \"Success\"\n }\n}",
|
326
326
|
"title": "接口调用成功示例"
|
327
327
|
}
|
@@ -1976,6 +1976,26 @@
|
|
1976
1976
|
"output_required": true,
|
1977
1977
|
"type": "object",
|
1978
1978
|
"value_allowed_null": false
|
1979
|
+
},
|
1980
|
+
{
|
1981
|
+
"disabled": false,
|
1982
|
+
"document": "基于画面提取的字幕文件路径。\n注意:此字段可能返回 null,表示取不到有效值。",
|
1983
|
+
"example": "无",
|
1984
|
+
"member": "string",
|
1985
|
+
"name": "OriginSubtitlePath",
|
1986
|
+
"output_required": false,
|
1987
|
+
"type": "string",
|
1988
|
+
"value_allowed_null": true
|
1989
|
+
},
|
1990
|
+
{
|
1991
|
+
"disabled": false,
|
1992
|
+
"document": "基于画面提取的字幕翻译文件路径。\n注意:此字段可能返回 null,表示取不到有效值。",
|
1993
|
+
"example": "无",
|
1994
|
+
"member": "string",
|
1995
|
+
"name": "TranslateSubtitlePath",
|
1996
|
+
"output_required": false,
|
1997
|
+
"type": "string",
|
1998
|
+
"value_allowed_null": true
|
1979
1999
|
}
|
1980
2000
|
],
|
1981
2001
|
"usage": "out"
|
@@ -20851,6 +20851,15 @@
|
|
20851
20851
|
"name": "OfdFileBase64",
|
20852
20852
|
"required": false,
|
20853
20853
|
"type": "string"
|
20854
|
+
},
|
20855
|
+
{
|
20856
|
+
"disabled": false,
|
20857
|
+
"document": "需要识别的OFD发票页面的对应页码,默认值为1。 示例值:1",
|
20858
|
+
"example": "1",
|
20859
|
+
"member": "int64",
|
20860
|
+
"name": "OfdPageNumber",
|
20861
|
+
"required": false,
|
20862
|
+
"type": "int"
|
20854
20863
|
}
|
20855
20864
|
],
|
20856
20865
|
"type": "object"
|
@@ -651,7 +651,7 @@
|
|
651
651
|
{
|
652
652
|
"disabled": false,
|
653
653
|
"document": "实例ID,形如postgres-lnp6j617",
|
654
|
-
"example": "
|
654
|
+
"example": "postgres-lnp6j617",
|
655
655
|
"member": "string",
|
656
656
|
"name": "DBInstanceId",
|
657
657
|
"output_required": true,
|
@@ -661,7 +661,7 @@
|
|
661
661
|
{
|
662
662
|
"disabled": false,
|
663
663
|
"document": "账号",
|
664
|
-
"example": "
|
664
|
+
"example": "test_user",
|
665
665
|
"member": "string",
|
666
666
|
"name": "UserName",
|
667
667
|
"output_required": true,
|
@@ -671,7 +671,7 @@
|
|
671
671
|
{
|
672
672
|
"disabled": false,
|
673
673
|
"document": "账号备注",
|
674
|
-
"example": "
|
674
|
+
"example": "remark",
|
675
675
|
"member": "string",
|
676
676
|
"name": "Remark",
|
677
677
|
"output_required": true,
|
@@ -681,7 +681,7 @@
|
|
681
681
|
{
|
682
682
|
"disabled": false,
|
683
683
|
"document": "账号状态。 1-创建中,2-正常,3-修改中,4-密码重置中,5-锁定中,-1-删除中",
|
684
|
-
"example": "
|
684
|
+
"example": "2",
|
685
685
|
"member": "int64",
|
686
686
|
"name": "Status",
|
687
687
|
"output_required": true,
|
@@ -691,7 +691,7 @@
|
|
691
691
|
{
|
692
692
|
"disabled": false,
|
693
693
|
"document": "账号创建时间",
|
694
|
-
"example": "
|
694
|
+
"example": "2024-06-06 21:00:12",
|
695
695
|
"member": "datetime",
|
696
696
|
"name": "CreateTime",
|
697
697
|
"output_required": true,
|
@@ -701,7 +701,7 @@
|
|
701
701
|
{
|
702
702
|
"disabled": false,
|
703
703
|
"document": "账号最后一次更新时间",
|
704
|
-
"example": "
|
704
|
+
"example": "2024-06-06 22:00:12",
|
705
705
|
"member": "datetime",
|
706
706
|
"name": "UpdateTime",
|
707
707
|
"output_required": true,
|
@@ -711,7 +711,7 @@
|
|
711
711
|
{
|
712
712
|
"disabled": false,
|
713
713
|
"document": "账号类型",
|
714
|
-
"example": "
|
714
|
+
"example": "normal",
|
715
715
|
"member": "string",
|
716
716
|
"name": "UserType",
|
717
717
|
"output_required": false,
|
@@ -5171,6 +5171,15 @@
|
|
5171
5171
|
"name": "FileType",
|
5172
5172
|
"required": false,
|
5173
5173
|
"type": "int"
|
5174
|
+
},
|
5175
|
+
{
|
5176
|
+
"disabled": false,
|
5177
|
+
"document": "获取临时签名的bucket是国内站还是国际站(1表示国际站,其它表示国内站)",
|
5178
|
+
"example": "0",
|
5179
|
+
"member": "int64",
|
5180
|
+
"name": "Site",
|
5181
|
+
"required": false,
|
5182
|
+
"type": "int"
|
5174
5183
|
}
|
5175
5184
|
],
|
5176
5185
|
"type": "object"
|
@@ -17,58 +17,6 @@ from tencentcloud.smpn.v20190822 import models as models_v20190822
|
|
17
17
|
from jmespath import search
|
18
18
|
import time
|
19
19
|
|
20
|
-
def doDescribeSmpnMhm(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.SmpnClient(cred, g_param[OptionsDefine.Region], profile)
|
47
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
48
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
-
model = models.DescribeSmpnMhmRequest()
|
50
|
-
model.from_json_string(json.dumps(args))
|
51
|
-
start_time = time.time()
|
52
|
-
while True:
|
53
|
-
rsp = client.DescribeSmpnMhm(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
20
|
def doDescribeSmpnFnr(args, parsed_globals):
|
73
21
|
g_param = parse_global_arg(parsed_globals)
|
74
22
|
|
@@ -121,58 +69,6 @@ def doDescribeSmpnFnr(args, parsed_globals):
|
|
121
69
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
70
|
|
123
71
|
|
124
|
-
def doCreateSmpnEpa(args, parsed_globals):
|
125
|
-
g_param = parse_global_arg(parsed_globals)
|
126
|
-
|
127
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
128
|
-
cred = credential.CVMRoleCredential()
|
129
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
130
|
-
cred = credential.STSAssumeRoleCredential(
|
131
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
132
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
133
|
-
)
|
134
|
-
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):
|
135
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
136
|
-
else:
|
137
|
-
cred = credential.Credential(
|
138
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
139
|
-
)
|
140
|
-
http_profile = HttpProfile(
|
141
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
142
|
-
reqMethod="POST",
|
143
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
144
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
145
|
-
)
|
146
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
147
|
-
if g_param[OptionsDefine.Language]:
|
148
|
-
profile.language = g_param[OptionsDefine.Language]
|
149
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
150
|
-
client = mod.SmpnClient(cred, g_param[OptionsDefine.Region], profile)
|
151
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
152
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
-
model = models.CreateSmpnEpaRequest()
|
154
|
-
model.from_json_string(json.dumps(args))
|
155
|
-
start_time = time.time()
|
156
|
-
while True:
|
157
|
-
rsp = client.CreateSmpnEpa(model)
|
158
|
-
result = rsp.to_json_string()
|
159
|
-
try:
|
160
|
-
json_obj = json.loads(result)
|
161
|
-
except TypeError as e:
|
162
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
163
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
164
|
-
break
|
165
|
-
cur_time = time.time()
|
166
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
167
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
168
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
169
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
170
|
-
else:
|
171
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
172
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
173
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
174
|
-
|
175
|
-
|
176
72
|
def doDescribeSmpnChp(args, parsed_globals):
|
177
73
|
g_param = parse_global_arg(parsed_globals)
|
178
74
|
|
@@ -225,58 +121,6 @@ def doDescribeSmpnChp(args, parsed_globals):
|
|
225
121
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
122
|
|
227
123
|
|
228
|
-
def doDescribeSmpnMrl(args, parsed_globals):
|
229
|
-
g_param = parse_global_arg(parsed_globals)
|
230
|
-
|
231
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
232
|
-
cred = credential.CVMRoleCredential()
|
233
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
234
|
-
cred = credential.STSAssumeRoleCredential(
|
235
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
236
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
237
|
-
)
|
238
|
-
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):
|
239
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
240
|
-
else:
|
241
|
-
cred = credential.Credential(
|
242
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
243
|
-
)
|
244
|
-
http_profile = HttpProfile(
|
245
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
246
|
-
reqMethod="POST",
|
247
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
248
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
249
|
-
)
|
250
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
251
|
-
if g_param[OptionsDefine.Language]:
|
252
|
-
profile.language = g_param[OptionsDefine.Language]
|
253
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
254
|
-
client = mod.SmpnClient(cred, g_param[OptionsDefine.Region], profile)
|
255
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
256
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
257
|
-
model = models.DescribeSmpnMrlRequest()
|
258
|
-
model.from_json_string(json.dumps(args))
|
259
|
-
start_time = time.time()
|
260
|
-
while True:
|
261
|
-
rsp = client.DescribeSmpnMrl(model)
|
262
|
-
result = rsp.to_json_string()
|
263
|
-
try:
|
264
|
-
json_obj = json.loads(result)
|
265
|
-
except TypeError as e:
|
266
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
267
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
268
|
-
break
|
269
|
-
cur_time = time.time()
|
270
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
271
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
272
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
273
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
274
|
-
else:
|
275
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
276
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
277
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
278
|
-
|
279
|
-
|
280
124
|
CLIENT_MAP = {
|
281
125
|
"v20190822": smpn_client_v20190822,
|
282
126
|
|
@@ -288,11 +132,8 @@ MODELS_MAP = {
|
|
288
132
|
}
|
289
133
|
|
290
134
|
ACTION_MAP = {
|
291
|
-
"DescribeSmpnMhm": doDescribeSmpnMhm,
|
292
135
|
"DescribeSmpnFnr": doDescribeSmpnFnr,
|
293
|
-
"CreateSmpnEpa": doCreateSmpnEpa,
|
294
136
|
"DescribeSmpnChp": doDescribeSmpnChp,
|
295
|
-
"DescribeSmpnMrl": doDescribeSmpnMrl,
|
296
137
|
|
297
138
|
}
|
298
139
|
|