tccli 3.0.1281.1__py2.py3-none-any.whl → 3.0.1283.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 +12 -12
- tccli/services/acp/v20220105/examples.json +1 -1
- tccli/services/aiart/aiart_client.py +53 -0
- tccli/services/aiart/v20221229/api.json +62 -0
- tccli/services/aiart/v20221229/examples.json +8 -0
- tccli/services/antiddos/v20200309/api.json +1 -1
- tccli/services/ccc/v20200210/api.json +9 -0
- tccli/services/cdwch/v20200915/api.json +3 -3
- tccli/services/cdwch/v20200915/examples.json +1 -1
- tccli/services/chdfs/v20201112/api.json +12 -12
- tccli/services/cvm/v20170312/api.json +8 -8
- tccli/services/dlc/v20210125/api.json +11 -0
- tccli/services/ess/v20201111/api.json +2 -2
- tccli/services/essbasic/v20210526/api.json +2 -2
- tccli/services/iotexplorer/v20190423/api.json +128 -0
- tccli/services/iotexplorer/v20190423/examples.json +3 -3
- tccli/services/mongodb/v20190725/api.json +2 -2
- tccli/services/mongodb/v20190725/examples.json +2 -2
- tccli/services/mqtt/mqtt_client.py +269 -4
- tccli/services/mqtt/v20240516/api.json +979 -210
- tccli/services/mqtt/v20240516/examples.json +45 -5
- tccli/services/oceanus/v20190422/api.json +43 -4
- tccli/services/organization/organization_client.py +114 -8
- tccli/services/organization/v20210331/api.json +86 -0
- tccli/services/organization/v20210331/examples.json +16 -0
- {tccli-3.0.1281.1.dist-info → tccli-3.0.1283.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1281.1.dist-info → tccli-3.0.1283.1.dist-info}/RECORD +31 -31
- {tccli-3.0.1281.1.dist-info → tccli-3.0.1283.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1281.1.dist-info → tccli-3.0.1283.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1281.1.dist-info → tccli-3.0.1283.1.dist-info}/license_files/LICENSE +0 -0
@@ -2153,6 +2153,16 @@
|
|
2153
2153
|
"type": "list",
|
2154
2154
|
"value_allowed_null": false
|
2155
2155
|
},
|
2156
|
+
{
|
2157
|
+
"disabled": false,
|
2158
|
+
"document": "任务输出文件信息列表",
|
2159
|
+
"example": "无",
|
2160
|
+
"member": "CloudStorageAIServiceTaskFileInfo",
|
2161
|
+
"name": "FilesInfo",
|
2162
|
+
"output_required": false,
|
2163
|
+
"type": "list",
|
2164
|
+
"value_allowed_null": false
|
2165
|
+
},
|
2156
2166
|
{
|
2157
2167
|
"disabled": false,
|
2158
2168
|
"document": "创建时间",
|
@@ -2186,6 +2196,88 @@
|
|
2186
2196
|
],
|
2187
2197
|
"usage": "out"
|
2188
2198
|
},
|
2199
|
+
"CloudStorageAIServiceTaskFileInfo": {
|
2200
|
+
"document": "云存 AI 任务输出文件信息",
|
2201
|
+
"members": [
|
2202
|
+
{
|
2203
|
+
"disabled": false,
|
2204
|
+
"document": "文件名称(含扩展名)",
|
2205
|
+
"example": "video.mp4",
|
2206
|
+
"member": "string",
|
2207
|
+
"name": "FileName",
|
2208
|
+
"output_required": true,
|
2209
|
+
"type": "string",
|
2210
|
+
"value_allowed_null": false
|
2211
|
+
},
|
2212
|
+
{
|
2213
|
+
"disabled": false,
|
2214
|
+
"document": "文件大小(单位:bytes)",
|
2215
|
+
"example": "1228800",
|
2216
|
+
"member": "int64",
|
2217
|
+
"name": "FileSize",
|
2218
|
+
"output_required": false,
|
2219
|
+
"type": "int",
|
2220
|
+
"value_allowed_null": false
|
2221
|
+
},
|
2222
|
+
{
|
2223
|
+
"disabled": false,
|
2224
|
+
"document": "文件下载 URL",
|
2225
|
+
"example": "https://example.com/video.mp4",
|
2226
|
+
"member": "string",
|
2227
|
+
"name": "DownloadURL",
|
2228
|
+
"output_required": false,
|
2229
|
+
"type": "string",
|
2230
|
+
"value_allowed_null": false
|
2231
|
+
},
|
2232
|
+
{
|
2233
|
+
"disabled": false,
|
2234
|
+
"document": "文件的 MIME Type",
|
2235
|
+
"example": "video/mp4",
|
2236
|
+
"member": "string",
|
2237
|
+
"name": "MimeType",
|
2238
|
+
"output_required": false,
|
2239
|
+
"type": "string",
|
2240
|
+
"value_allowed_null": false
|
2241
|
+
},
|
2242
|
+
{
|
2243
|
+
"disabled": false,
|
2244
|
+
"document": "视频文件元数据(仅当文件为视频类型时包含该字段)",
|
2245
|
+
"example": "无",
|
2246
|
+
"member": "CloudStorageAIServiceTaskVideoMetaInfo",
|
2247
|
+
"name": "VideoMetaInfo",
|
2248
|
+
"output_required": false,
|
2249
|
+
"type": "object",
|
2250
|
+
"value_allowed_null": false
|
2251
|
+
}
|
2252
|
+
],
|
2253
|
+
"usage": "out"
|
2254
|
+
},
|
2255
|
+
"CloudStorageAIServiceTaskVideoMetaInfo": {
|
2256
|
+
"document": "云存 AI 任务输出视频文件元数据",
|
2257
|
+
"members": [
|
2258
|
+
{
|
2259
|
+
"disabled": false,
|
2260
|
+
"document": "视频对应的缩略图的文件名称(含扩展名)",
|
2261
|
+
"example": "thumbnail.jpg",
|
2262
|
+
"member": "string",
|
2263
|
+
"name": "ThumbnailFileName",
|
2264
|
+
"output_required": false,
|
2265
|
+
"type": "string",
|
2266
|
+
"value_allowed_null": false
|
2267
|
+
},
|
2268
|
+
{
|
2269
|
+
"disabled": false,
|
2270
|
+
"document": "视频时长(单位:毫秒)",
|
2271
|
+
"example": "30000",
|
2272
|
+
"member": "int64",
|
2273
|
+
"name": "DurationMilliSeconds",
|
2274
|
+
"output_required": false,
|
2275
|
+
"type": "int",
|
2276
|
+
"value_allowed_null": false
|
2277
|
+
}
|
2278
|
+
],
|
2279
|
+
"usage": "out"
|
2280
|
+
},
|
2189
2281
|
"CloudStorageEvent": {
|
2190
2282
|
"document": "云存事件",
|
2191
2283
|
"members": [
|
@@ -4994,6 +5086,42 @@
|
|
4994
5086
|
"name": "ChannelId",
|
4995
5087
|
"required": false,
|
4996
5088
|
"type": "int"
|
5089
|
+
},
|
5090
|
+
{
|
5091
|
+
"disabled": false,
|
5092
|
+
"document": "设备名称列表。\n\n当需要同时查询多台设备的任务列表时传入,优先级高于参数 `DeviceName`",
|
5093
|
+
"example": "[\"dev001\", \"dev002\"]",
|
5094
|
+
"member": "string",
|
5095
|
+
"name": "DeviceNames",
|
5096
|
+
"required": false,
|
5097
|
+
"type": "list"
|
5098
|
+
},
|
5099
|
+
{
|
5100
|
+
"disabled": false,
|
5101
|
+
"document": "查询任务时间范围的起始时间(秒级 UNIX 时间戳)",
|
5102
|
+
"example": "1740585600",
|
5103
|
+
"member": "int64",
|
5104
|
+
"name": "StartTime",
|
5105
|
+
"required": false,
|
5106
|
+
"type": "int"
|
5107
|
+
},
|
5108
|
+
{
|
5109
|
+
"disabled": false,
|
5110
|
+
"document": "查询任务时间范围的结束时间(秒级 UNIX 时间戳)",
|
5111
|
+
"example": "1740671999",
|
5112
|
+
"member": "int64",
|
5113
|
+
"name": "EndTime",
|
5114
|
+
"required": false,
|
5115
|
+
"type": "int"
|
5116
|
+
},
|
5117
|
+
{
|
5118
|
+
"disabled": false,
|
5119
|
+
"document": "下载 URL 的过期时间。\n\n若传入该参数,则响应中将包含所有文件的下载 URL",
|
5120
|
+
"example": "1743436800",
|
5121
|
+
"member": "int64",
|
5122
|
+
"name": "FileURLExpireTime",
|
5123
|
+
"required": false,
|
5124
|
+
"type": "int"
|
4997
5125
|
}
|
4998
5126
|
],
|
4999
5127
|
"type": "object"
|
@@ -457,8 +457,8 @@
|
|
457
457
|
"DescribeCloudStorageAIServiceTask": [
|
458
458
|
{
|
459
459
|
"document": "",
|
460
|
-
"input": "POST / HTTP/1.1\nHost: iotexplorer.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeCloudStorageAIServiceTask\n<公共请求参数>\n\n{\n \"TaskId\": \"
|
461
|
-
"output": "{\n \"Response\": {\n \"RequestId\": \"8b490930-d119-4ee2-963c-c58973a1ebe6\",\n \"TaskInfo\": {\n \"
|
460
|
+
"input": "POST / HTTP/1.1\nHost: iotexplorer.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeCloudStorageAIServiceTask\n<公共请求参数>\n\n{\n \"TaskId\": \"fb066d7a-baac-4706-acda-058f56f82759\"\n}",
|
461
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"8b490930-d119-4ee2-963c-c58973a1ebe6\",\n \"TaskInfo\": {\n \"TaskId\": \"fb066d7a-baac-4706-acda-058f56f82759\",\n \"ProductId\": \"TQBDY6RPI9\",\n \"DeviceName\": \"cs_112114601_2\",\n \"ChannelId\": 0,\n \"ServiceType\": \"Highlight\",\n \"StartTime\": 1710487888,\n \"EndTime\": 1710487898,\n \"Status\": 3,\n \"Result\": \"\",\n \"Files\": [\n \"highlight.mp4\",\n \"thumbnail.jpg\"\n ],\n \"FilesInfo\": [\n {\n \"FileName\": \"highlight.mp4\"\n },\n {\n \"FileName\": \"thumbnail.mp4\"\n }\n ],\n \"CreateTime\": 1710490000,\n \"UpdateTime\": 1710490000\n }\n }\n}",
|
462
462
|
"title": "查询指定的云存 AI 分析任务"
|
463
463
|
}
|
464
464
|
],
|
@@ -466,7 +466,7 @@
|
|
466
466
|
{
|
467
467
|
"document": "",
|
468
468
|
"input": "POST / HTTP/1.1\nHost: iotexplorer.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeCloudStorageAIServiceTasks\n<公共请求参数>\n\n{\n \"ProductId\": \"KH6Q8C4N0D\",\n \"DeviceName\": \"aaa_31400554_1\",\n \"ServiceType\": \"Highlight\",\n \"Offset\": 0,\n \"Limit\": 20\n}",
|
469
|
-
"output": "{\n \"Response\": {\n \"Tasks\": [\n {\n \"TaskId\": \"fb066d7a-baac-4706-acda-058f56f82759\",\n \"ProductId\": \"TQBDY6RPI9\",\n \"DeviceName\": \"cs_112114601_2\",\n \"ChannelId\": 0,\n \"ServiceType\": \"
|
469
|
+
"output": "{\n \"Response\": {\n \"Tasks\": [\n {\n \"TaskId\": \"fb066d7a-baac-4706-acda-058f56f82759\",\n \"ProductId\": \"TQBDY6RPI9\",\n \"DeviceName\": \"cs_112114601_2\",\n \"ChannelId\": 0,\n \"ServiceType\": \"Highlight\",\n \"StartTime\": 1710487888,\n \"EndTime\": 1710487898,\n \"Status\": 3,\n \"Result\": \"\",\n \"Files\": [\n \"highlight.mp4\",\n \"thumbnail.jpg\"\n ],\n \"FilesInfo\": [\n {\n \"FileName\": \"highlight.mp4\"\n },\n {\n \"FileName\": \"thumbnail.mp4\"\n }\n ],\n \"CreateTime\": 1710490000,\n \"UpdateTime\": 1710490000\n }\n ],\n \"Total\": 1,\n \"RequestId\": \"3c140219-cfe9-470e-b241-907877d6fb03\"\n }\n}",
|
470
470
|
"title": "查询视频浓缩结果列表"
|
471
471
|
},
|
472
472
|
{
|
@@ -197,7 +197,7 @@
|
|
197
197
|
"status": "online"
|
198
198
|
},
|
199
199
|
"EnableTransparentDataEncryption": {
|
200
|
-
"document": "
|
200
|
+
"document": "本接口(EnableTransparentDataEncryption)用于开启云数据库 MongoDB 的透明加密能力。",
|
201
201
|
"input": "EnableTransparentDataEncryptionRequest",
|
202
202
|
"name": "开启实例数据透明加密",
|
203
203
|
"output": "EnableTransparentDataEncryptionResponse",
|
@@ -3416,7 +3416,7 @@
|
|
3416
3416
|
{
|
3417
3417
|
"disabled": false,
|
3418
3418
|
"document": "密钥 ID。若不设置该参数,不指定具体的密钥 ID,由腾讯云自动生成密钥。",
|
3419
|
-
"example": "
|
3419
|
+
"example": "AKID********************************",
|
3420
3420
|
"member": "string",
|
3421
3421
|
"name": "KeyId",
|
3422
3422
|
"required": false,
|
@@ -227,8 +227,8 @@
|
|
227
227
|
"EnableTransparentDataEncryption": [
|
228
228
|
{
|
229
229
|
"document": "",
|
230
|
-
"input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: EnableTransparentDataEncryption\n<公共请求参数>\n\n{\n \"InstanceId\": \"cmgo-
|
231
|
-
"output": "{\n \"Response\": {\n \"FlowId\":
|
230
|
+
"input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: EnableTransparentDataEncryption\n<公共请求参数>\n\n{\n \"InstanceId\": \"cmgo-igjy****\",\n \"KmsRegion\": \"ap-guangzhou\",\n \"KeyId\": \"AKID********************************\"\n}",
|
231
|
+
"output": "{\n \"Response\": {\n \"FlowId\": 17316505316,\n \"RequestId\": \"a8dce7a4-d488-49c9-8d24-33cf623f5992\"\n }\n}",
|
232
232
|
"title": "开启实例数据透明加密"
|
233
233
|
}
|
234
234
|
],
|
@@ -901,7 +901,7 @@ def doDescribeInsVPCEndpoints(args, parsed_globals):
|
|
901
901
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
902
902
|
|
903
903
|
|
904
|
-
def
|
904
|
+
def doDescribeMessageList(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,63 @@ def doApplyRegistrationCode(args, parsed_globals):
|
|
930
930
|
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
931
931
|
client._sdkVersion += ("_CLI_" + __version__)
|
932
932
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
933
|
-
model = models.
|
933
|
+
model = models.DescribeMessageListRequest()
|
934
934
|
model.from_json_string(json.dumps(args))
|
935
935
|
start_time = time.time()
|
936
936
|
while True:
|
937
|
-
rsp = client.
|
937
|
+
rsp = client.DescribeMessageList(model)
|
938
|
+
result = rsp.to_json_string()
|
939
|
+
try:
|
940
|
+
json_obj = json.loads(result)
|
941
|
+
except TypeError as e:
|
942
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
943
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
944
|
+
break
|
945
|
+
cur_time = time.time()
|
946
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
947
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
948
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
949
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
950
|
+
else:
|
951
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
952
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
953
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
954
|
+
|
955
|
+
|
956
|
+
def doDescribeClientList(args, parsed_globals):
|
957
|
+
g_param = parse_global_arg(parsed_globals)
|
958
|
+
|
959
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
960
|
+
cred = credential.CVMRoleCredential()
|
961
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
962
|
+
cred = credential.STSAssumeRoleCredential(
|
963
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
964
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
965
|
+
)
|
966
|
+
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):
|
967
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
968
|
+
else:
|
969
|
+
cred = credential.Credential(
|
970
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
971
|
+
)
|
972
|
+
http_profile = HttpProfile(
|
973
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
974
|
+
reqMethod="POST",
|
975
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
976
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
977
|
+
)
|
978
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
979
|
+
if g_param[OptionsDefine.Language]:
|
980
|
+
profile.language = g_param[OptionsDefine.Language]
|
981
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
982
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
983
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
984
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
985
|
+
model = models.DescribeClientListRequest()
|
986
|
+
model.from_json_string(json.dumps(args))
|
987
|
+
start_time = time.time()
|
988
|
+
while True:
|
989
|
+
rsp = client.DescribeClientList(model)
|
938
990
|
result = rsp.to_json_string()
|
939
991
|
try:
|
940
992
|
json_obj = json.loads(result)
|
@@ -1213,6 +1265,58 @@ def doDeleteDeviceCertificate(args, parsed_globals):
|
|
1213
1265
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1214
1266
|
|
1215
1267
|
|
1268
|
+
def doApplyRegistrationCode(args, parsed_globals):
|
1269
|
+
g_param = parse_global_arg(parsed_globals)
|
1270
|
+
|
1271
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1272
|
+
cred = credential.CVMRoleCredential()
|
1273
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1274
|
+
cred = credential.STSAssumeRoleCredential(
|
1275
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1276
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1277
|
+
)
|
1278
|
+
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):
|
1279
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1280
|
+
else:
|
1281
|
+
cred = credential.Credential(
|
1282
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1283
|
+
)
|
1284
|
+
http_profile = HttpProfile(
|
1285
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1286
|
+
reqMethod="POST",
|
1287
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1288
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1289
|
+
)
|
1290
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1291
|
+
if g_param[OptionsDefine.Language]:
|
1292
|
+
profile.language = g_param[OptionsDefine.Language]
|
1293
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1294
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
1295
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1296
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1297
|
+
model = models.ApplyRegistrationCodeRequest()
|
1298
|
+
model.from_json_string(json.dumps(args))
|
1299
|
+
start_time = time.time()
|
1300
|
+
while True:
|
1301
|
+
rsp = client.ApplyRegistrationCode(model)
|
1302
|
+
result = rsp.to_json_string()
|
1303
|
+
try:
|
1304
|
+
json_obj = json.loads(result)
|
1305
|
+
except TypeError as e:
|
1306
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1307
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1308
|
+
break
|
1309
|
+
cur_time = time.time()
|
1310
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1311
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1312
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1313
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1314
|
+
else:
|
1315
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1316
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1317
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1318
|
+
|
1319
|
+
|
1216
1320
|
def doModifyJWKSAuthenticator(args, parsed_globals):
|
1217
1321
|
g_param = parse_global_arg(parsed_globals)
|
1218
1322
|
|
@@ -1473,6 +1577,58 @@ def doRevokedDeviceCertificate(args, parsed_globals):
|
|
1473
1577
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1474
1578
|
|
1475
1579
|
|
1580
|
+
def doDescribeSharedSubscriptionLag(args, parsed_globals):
|
1581
|
+
g_param = parse_global_arg(parsed_globals)
|
1582
|
+
|
1583
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1584
|
+
cred = credential.CVMRoleCredential()
|
1585
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1586
|
+
cred = credential.STSAssumeRoleCredential(
|
1587
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1588
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1589
|
+
)
|
1590
|
+
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):
|
1591
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1592
|
+
else:
|
1593
|
+
cred = credential.Credential(
|
1594
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1595
|
+
)
|
1596
|
+
http_profile = HttpProfile(
|
1597
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1598
|
+
reqMethod="POST",
|
1599
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1600
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1601
|
+
)
|
1602
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1603
|
+
if g_param[OptionsDefine.Language]:
|
1604
|
+
profile.language = g_param[OptionsDefine.Language]
|
1605
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1606
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
1607
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1608
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1609
|
+
model = models.DescribeSharedSubscriptionLagRequest()
|
1610
|
+
model.from_json_string(json.dumps(args))
|
1611
|
+
start_time = time.time()
|
1612
|
+
while True:
|
1613
|
+
rsp = client.DescribeSharedSubscriptionLag(model)
|
1614
|
+
result = rsp.to_json_string()
|
1615
|
+
try:
|
1616
|
+
json_obj = json.loads(result)
|
1617
|
+
except TypeError as e:
|
1618
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1619
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1620
|
+
break
|
1621
|
+
cur_time = time.time()
|
1622
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1623
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1624
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1625
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1626
|
+
else:
|
1627
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1628
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1629
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1630
|
+
|
1631
|
+
|
1476
1632
|
def doDescribeInstance(args, parsed_globals):
|
1477
1633
|
g_param = parse_global_arg(parsed_globals)
|
1478
1634
|
|
@@ -1941,6 +2097,58 @@ def doDeleteAuthorizationPolicy(args, parsed_globals):
|
|
1941
2097
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1942
2098
|
|
1943
2099
|
|
2100
|
+
def doModifyHttpAuthenticator(args, parsed_globals):
|
2101
|
+
g_param = parse_global_arg(parsed_globals)
|
2102
|
+
|
2103
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2104
|
+
cred = credential.CVMRoleCredential()
|
2105
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2106
|
+
cred = credential.STSAssumeRoleCredential(
|
2107
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2108
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2109
|
+
)
|
2110
|
+
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):
|
2111
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2112
|
+
else:
|
2113
|
+
cred = credential.Credential(
|
2114
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2115
|
+
)
|
2116
|
+
http_profile = HttpProfile(
|
2117
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2118
|
+
reqMethod="POST",
|
2119
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2120
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2121
|
+
)
|
2122
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2123
|
+
if g_param[OptionsDefine.Language]:
|
2124
|
+
profile.language = g_param[OptionsDefine.Language]
|
2125
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2126
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
2127
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2128
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2129
|
+
model = models.ModifyHttpAuthenticatorRequest()
|
2130
|
+
model.from_json_string(json.dumps(args))
|
2131
|
+
start_time = time.time()
|
2132
|
+
while True:
|
2133
|
+
rsp = client.ModifyHttpAuthenticator(model)
|
2134
|
+
result = rsp.to_json_string()
|
2135
|
+
try:
|
2136
|
+
json_obj = json.loads(result)
|
2137
|
+
except TypeError as e:
|
2138
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2139
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2140
|
+
break
|
2141
|
+
cur_time = time.time()
|
2142
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2143
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2144
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2145
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2146
|
+
else:
|
2147
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2148
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2149
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2150
|
+
|
2151
|
+
|
1944
2152
|
def doDescribeTopic(args, parsed_globals):
|
1945
2153
|
g_param = parse_global_arg(parsed_globals)
|
1946
2154
|
|
@@ -2461,6 +2669,58 @@ def doModifyInstance(args, parsed_globals):
|
|
2461
2669
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2462
2670
|
|
2463
2671
|
|
2672
|
+
def doCreateHttpAuthenticator(args, parsed_globals):
|
2673
|
+
g_param = parse_global_arg(parsed_globals)
|
2674
|
+
|
2675
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2676
|
+
cred = credential.CVMRoleCredential()
|
2677
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2678
|
+
cred = credential.STSAssumeRoleCredential(
|
2679
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2680
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2681
|
+
)
|
2682
|
+
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):
|
2683
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2684
|
+
else:
|
2685
|
+
cred = credential.Credential(
|
2686
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2687
|
+
)
|
2688
|
+
http_profile = HttpProfile(
|
2689
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2690
|
+
reqMethod="POST",
|
2691
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2692
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2693
|
+
)
|
2694
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2695
|
+
if g_param[OptionsDefine.Language]:
|
2696
|
+
profile.language = g_param[OptionsDefine.Language]
|
2697
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2698
|
+
client = mod.MqttClient(cred, g_param[OptionsDefine.Region], profile)
|
2699
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2700
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2701
|
+
model = models.CreateHttpAuthenticatorRequest()
|
2702
|
+
model.from_json_string(json.dumps(args))
|
2703
|
+
start_time = time.time()
|
2704
|
+
while True:
|
2705
|
+
rsp = client.CreateHttpAuthenticator(model)
|
2706
|
+
result = rsp.to_json_string()
|
2707
|
+
try:
|
2708
|
+
json_obj = json.loads(result)
|
2709
|
+
except TypeError as e:
|
2710
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2711
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2712
|
+
break
|
2713
|
+
cur_time = time.time()
|
2714
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2715
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2716
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2717
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2718
|
+
else:
|
2719
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2720
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2721
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2722
|
+
|
2723
|
+
|
2464
2724
|
CLIENT_MAP = {
|
2465
2725
|
"v20240516": mqtt_client_v20240516,
|
2466
2726
|
|
@@ -2489,17 +2749,20 @@ ACTION_MAP = {
|
|
2489
2749
|
"RegisterDeviceCertificate": doRegisterDeviceCertificate,
|
2490
2750
|
"ModifyInstanceCertBinding": doModifyInstanceCertBinding,
|
2491
2751
|
"DescribeInsVPCEndpoints": doDescribeInsVPCEndpoints,
|
2492
|
-
"
|
2752
|
+
"DescribeMessageList": doDescribeMessageList,
|
2753
|
+
"DescribeClientList": doDescribeClientList,
|
2493
2754
|
"DescribeProductSKUList": doDescribeProductSKUList,
|
2494
2755
|
"DescribeCaCertificates": doDescribeCaCertificates,
|
2495
2756
|
"ActivateCaCertificate": doActivateCaCertificate,
|
2496
2757
|
"CreateTopic": doCreateTopic,
|
2497
2758
|
"DeleteDeviceCertificate": doDeleteDeviceCertificate,
|
2759
|
+
"ApplyRegistrationCode": doApplyRegistrationCode,
|
2498
2760
|
"ModifyJWKSAuthenticator": doModifyJWKSAuthenticator,
|
2499
2761
|
"PublishMessage": doPublishMessage,
|
2500
2762
|
"DescribeDeviceCertificate": doDescribeDeviceCertificate,
|
2501
2763
|
"DeleteInsPublicEndpoint": doDeleteInsPublicEndpoint,
|
2502
2764
|
"RevokedDeviceCertificate": doRevokedDeviceCertificate,
|
2765
|
+
"DescribeSharedSubscriptionLag": doDescribeSharedSubscriptionLag,
|
2503
2766
|
"DescribeInstance": doDescribeInstance,
|
2504
2767
|
"DeleteTopic": doDeleteTopic,
|
2505
2768
|
"DeleteUser": doDeleteUser,
|
@@ -2509,6 +2772,7 @@ ACTION_MAP = {
|
|
2509
2772
|
"DescribeInstanceList": doDescribeInstanceList,
|
2510
2773
|
"ModifyAuthorizationPolicy": doModifyAuthorizationPolicy,
|
2511
2774
|
"DeleteAuthorizationPolicy": doDeleteAuthorizationPolicy,
|
2775
|
+
"ModifyHttpAuthenticator": doModifyHttpAuthenticator,
|
2512
2776
|
"DescribeTopic": doDescribeTopic,
|
2513
2777
|
"RegisterCaCertificate": doRegisterCaCertificate,
|
2514
2778
|
"ModifyInsPublicEndpoint": doModifyInsPublicEndpoint,
|
@@ -2519,6 +2783,7 @@ ACTION_MAP = {
|
|
2519
2783
|
"DescribeTopicList": doDescribeTopicList,
|
2520
2784
|
"CreateAuthorizationPolicy": doCreateAuthorizationPolicy,
|
2521
2785
|
"ModifyInstance": doModifyInstance,
|
2786
|
+
"CreateHttpAuthenticator": doCreateHttpAuthenticator,
|
2522
2787
|
|
2523
2788
|
}
|
2524
2789
|
|