tccli 3.0.1048.1__py2.py3-none-any.whl → 3.0.1049.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/examples/antiddos/v20200309/DescribeBGPIPL7Rules.md +87 -0
- tccli/examples/ckafka/v20190819/DescribeGroup.md +6 -5
- tccli/examples/csip/v20221121/ModifyOrganizationAccountStatus.md +21 -0
- tccli/examples/cynosdb/v20190107/AddInstances.md +2 -2
- tccli/examples/cynosdb/v20190107/DescribeClusterInstanceGrps.md +235 -79
- tccli/examples/cynosdb/v20190107/DescribeClusterParams.md +3 -1
- tccli/examples/cynosdb/v20190107/DescribeClusterPasswordComplexity.md +18 -6
- tccli/examples/cynosdb/v20190107/DescribeInstances.md +63 -55
- tccli/examples/cynosdb/v20190107/DescribeParamTemplateDetail.md +3 -1
- tccli/examples/cynosdb/v20190107/ModifyVipVport.md +3 -3
- tccli/examples/essbasic/v20210526/ChannelCreatePrepareFlow.md +2 -2
- tccli/examples/oceanus/v20190422/CopyJobs.md +11 -20
- tccli/examples/teo/v20220901/DescribeDefaultCertificates.md +2 -1
- tccli/examples/trocket/v20230308/CreateMQTTInstance.md +31 -0
- tccli/examples/trocket/v20230308/DescribeMQTTInstanceList.md +176 -0
- tccli/examples/trocket/v20230308/DescribeMQTTProductSKUList.md +94 -0
- tccli/services/antiddos/antiddos_client.py +53 -0
- tccli/services/antiddos/v20200309/api.json +439 -0
- tccli/services/antiddos/v20200309/examples.json +8 -0
- tccli/services/cfg/v20210820/api.json +21 -10
- tccli/services/ckafka/v20190819/api.json +6 -5
- tccli/services/ckafka/v20190819/examples.json +1 -1
- tccli/services/cls/v20201016/api.json +48 -19
- tccli/services/csip/csip_client.py +53 -0
- tccli/services/csip/v20221121/api.json +43 -0
- tccli/services/csip/v20221121/examples.json +8 -0
- tccli/services/cynosdb/v20190107/api.json +415 -87
- tccli/services/cynosdb/v20190107/examples.json +12 -12
- tccli/services/essbasic/v20210526/examples.json +2 -2
- tccli/services/live/v20180801/api.json +1 -1
- tccli/services/oceanus/v20190422/api.json +32 -3
- tccli/services/oceanus/v20190422/examples.json +1 -1
- tccli/services/privatedns/v20201028/api.json +29 -19
- tccli/services/ssl/ssl_client.py +0 -53
- tccli/services/ssl/v20191205/api.json +0 -99
- tccli/services/ssl/v20191205/examples.json +0 -8
- tccli/services/teo/v20220901/api.json +14 -3
- tccli/services/teo/v20220901/examples.json +1 -1
- tccli/services/trocket/trocket_client.py +171 -12
- tccli/services/trocket/v20230308/api.json +492 -0
- tccli/services/trocket/v20230308/examples.json +30 -0
- {tccli-3.0.1048.1.dist-info → tccli-3.0.1049.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1048.1.dist-info → tccli-3.0.1049.1.dist-info}/RECORD +47 -42
- {tccli-3.0.1048.1.dist-info → tccli-3.0.1049.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1048.1.dist-info → tccli-3.0.1049.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1048.1.dist-info → tccli-3.0.1049.1.dist-info}/license_files/LICENSE +0 -0
@@ -287,13 +287,6 @@
|
|
287
287
|
"output": "DownloadCertificateResponse",
|
288
288
|
"status": "online"
|
289
289
|
},
|
290
|
-
"HostCertificate": {
|
291
|
-
"document": "证书托管接口已重构, 旧接口预下线, 近30天无请求\n\n云资源托管",
|
292
|
-
"input": "HostCertificateRequest",
|
293
|
-
"name": "云资源托管",
|
294
|
-
"output": "HostCertificateResponse",
|
295
|
-
"status": "deprecated"
|
296
|
-
},
|
297
290
|
"ModifyCertificateAlias": {
|
298
291
|
"document": "用户传入证书id和备注来修改证书备注。",
|
299
292
|
"input": "ModifyCertificateAliasRequest",
|
@@ -850,52 +843,6 @@
|
|
850
843
|
],
|
851
844
|
"usage": "out"
|
852
845
|
},
|
853
|
-
"CertHostingInfo": {
|
854
|
-
"document": "云资源配置详情",
|
855
|
-
"members": [
|
856
|
-
{
|
857
|
-
"disabled": false,
|
858
|
-
"document": "证书ID",
|
859
|
-
"example": "无",
|
860
|
-
"member": "string",
|
861
|
-
"name": "CertId",
|
862
|
-
"required": true,
|
863
|
-
"type": "string",
|
864
|
-
"value_allowed_null": false
|
865
|
-
},
|
866
|
-
{
|
867
|
-
"disabled": false,
|
868
|
-
"document": "已替换的新证书ID\n注意:此字段可能返回 null,表示取不到有效值。",
|
869
|
-
"example": "无",
|
870
|
-
"member": "string",
|
871
|
-
"name": "RenewCertId",
|
872
|
-
"required": true,
|
873
|
-
"type": "string",
|
874
|
-
"value_allowed_null": true
|
875
|
-
},
|
876
|
-
{
|
877
|
-
"disabled": false,
|
878
|
-
"document": "云资源托管 ,CDN或CLB:部分开启,CDN,CLB:已开启,null:未开启托管\n注意:此字段可能返回 null,表示取不到有效值。",
|
879
|
-
"example": "无",
|
880
|
-
"member": "string",
|
881
|
-
"name": "ResourceType",
|
882
|
-
"required": true,
|
883
|
-
"type": "string",
|
884
|
-
"value_allowed_null": true
|
885
|
-
},
|
886
|
-
{
|
887
|
-
"disabled": false,
|
888
|
-
"document": "创建时间\n注意:此字段可能返回 null,表示取不到有效值。",
|
889
|
-
"example": "2021-05-16T09:06:24",
|
890
|
-
"member": "string",
|
891
|
-
"name": "CreateTime",
|
892
|
-
"required": true,
|
893
|
-
"type": "string",
|
894
|
-
"value_allowed_null": true
|
895
|
-
}
|
896
|
-
],
|
897
|
-
"usage": "out"
|
898
|
-
},
|
899
846
|
"CertTaskId": {
|
900
847
|
"document": "证书异步任务ID",
|
901
848
|
"members": [
|
@@ -6581,52 +6528,6 @@
|
|
6581
6528
|
],
|
6582
6529
|
"usage": "out"
|
6583
6530
|
},
|
6584
|
-
"HostCertificateRequest": {
|
6585
|
-
"document": "HostCertificate请求参数结构体",
|
6586
|
-
"members": [
|
6587
|
-
{
|
6588
|
-
"disabled": false,
|
6589
|
-
"document": "证书ID",
|
6590
|
-
"example": "无",
|
6591
|
-
"member": "string",
|
6592
|
-
"name": "CertificateId",
|
6593
|
-
"required": true,
|
6594
|
-
"type": "string"
|
6595
|
-
},
|
6596
|
-
{
|
6597
|
-
"disabled": false,
|
6598
|
-
"document": "资源类型:目前仅限于CLB,CDN",
|
6599
|
-
"example": "无",
|
6600
|
-
"member": "string",
|
6601
|
-
"name": "ResourceType",
|
6602
|
-
"required": false,
|
6603
|
-
"type": "list"
|
6604
|
-
}
|
6605
|
-
],
|
6606
|
-
"type": "object"
|
6607
|
-
},
|
6608
|
-
"HostCertificateResponse": {
|
6609
|
-
"document": "HostCertificate返回参数结构体",
|
6610
|
-
"members": [
|
6611
|
-
{
|
6612
|
-
"disabled": false,
|
6613
|
-
"document": "云资源配置详情",
|
6614
|
-
"example": "无",
|
6615
|
-
"member": "CertHostingInfo",
|
6616
|
-
"name": "CertHostingInfo",
|
6617
|
-
"output_required": true,
|
6618
|
-
"type": "object",
|
6619
|
-
"value_allowed_null": false
|
6620
|
-
},
|
6621
|
-
{
|
6622
|
-
"document": "唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。",
|
6623
|
-
"member": "string",
|
6624
|
-
"name": "RequestId",
|
6625
|
-
"type": "string"
|
6626
|
-
}
|
6627
|
-
],
|
6628
|
-
"type": "object"
|
6629
|
-
},
|
6630
6531
|
"LighthouseInstanceDetail": {
|
6631
6532
|
"document": "Lighthouse实例",
|
6632
6533
|
"members": [
|
@@ -334,14 +334,6 @@
|
|
334
334
|
"title": "下载证书"
|
335
335
|
}
|
336
336
|
],
|
337
|
-
"HostCertificate": [
|
338
|
-
{
|
339
|
-
"document": "",
|
340
|
-
"input": "POST / HTTP/1.1\nHost: ssl.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: HostCertificate\n<公共请求参数>\n\n{\n \"ResourceType\": [\n \"CDN\"\n ],\n \"CertificateId\": \"ahsgjahs\"\n}",
|
341
|
-
"output": "{\n \"Response\": {\n \"CertHostingInfo\": {\n \"CertId\": \"lw0LEZmv\",\n \"ResourceType\": \"CDN,CLB\",\n \"RenewCertId\": null,\n \"CreateTime\": \"2021-05-16T09:06:24.000000Z\"\n },\n \"RequestId\": \"5ca56-1eca6-5678-9754-2bda0\"\n }\n}",
|
342
|
-
"title": "返回"
|
343
|
-
}
|
344
|
-
],
|
345
337
|
"ModifyCertificateAlias": [
|
346
338
|
{
|
347
339
|
"document": "",
|
@@ -5434,13 +5434,22 @@
|
|
5434
5434
|
"DescribeDefaultCertificatesRequest": {
|
5435
5435
|
"document": "DescribeDefaultCertificates请求参数结构体",
|
5436
5436
|
"members": [
|
5437
|
+
{
|
5438
|
+
"disabled": false,
|
5439
|
+
"document": "站点 ID。",
|
5440
|
+
"example": "zone-xxx",
|
5441
|
+
"member": "string",
|
5442
|
+
"name": "ZoneId",
|
5443
|
+
"required": false,
|
5444
|
+
"type": "string"
|
5445
|
+
},
|
5437
5446
|
{
|
5438
5447
|
"disabled": false,
|
5439
5448
|
"document": "过滤条件,Filters.Values的上限为5。详细的过滤条件如下:\n<li>zone-id<br> 按照【<strong>站点ID</strong>】进行过滤。站点ID形如:zone-xxx。<br> 类型:String<br> 必选:是 </li>",
|
5440
5449
|
"example": "无",
|
5441
5450
|
"member": "Filter",
|
5442
5451
|
"name": "Filters",
|
5443
|
-
"required":
|
5452
|
+
"required": false,
|
5444
5453
|
"type": "list"
|
5445
5454
|
},
|
5446
5455
|
{
|
@@ -5473,7 +5482,7 @@
|
|
5473
5482
|
"example": "1",
|
5474
5483
|
"member": "int64",
|
5475
5484
|
"name": "TotalCount",
|
5476
|
-
"
|
5485
|
+
"output_required": true,
|
5477
5486
|
"type": "int",
|
5478
5487
|
"value_allowed_null": false
|
5479
5488
|
},
|
@@ -5483,7 +5492,7 @@
|
|
5483
5492
|
"example": "无",
|
5484
5493
|
"member": "DefaultServerCertInfo",
|
5485
5494
|
"name": "DefaultServerCertInfo",
|
5486
|
-
"
|
5495
|
+
"output_required": true,
|
5487
5496
|
"type": "list",
|
5488
5497
|
"value_allowed_null": false
|
5489
5498
|
},
|
@@ -8484,6 +8493,7 @@
|
|
8484
8493
|
"example": "无",
|
8485
8494
|
"member": "AscriptionInfo",
|
8486
8495
|
"name": "Ascription",
|
8496
|
+
"output_required": true,
|
8487
8497
|
"type": "object",
|
8488
8498
|
"value_allowed_null": false
|
8489
8499
|
},
|
@@ -8493,6 +8503,7 @@
|
|
8493
8503
|
"example": "无",
|
8494
8504
|
"member": "FileAscriptionInfo",
|
8495
8505
|
"name": "FileAscription",
|
8506
|
+
"output_required": true,
|
8496
8507
|
"type": "object",
|
8497
8508
|
"value_allowed_null": false
|
8498
8509
|
},
|
@@ -390,7 +390,7 @@
|
|
390
390
|
{
|
391
391
|
"document": "",
|
392
392
|
"input": "POST / HTTP/1.1\nHost: teo.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeDefaultCertificates\n<公共请求参数>\n\n{\n \"Filters\": [\n {\n \"Name\": \"zone-id\",\n \"Values\": [\n \"zone-fafcasdf\"\n ]\n }\n ]\n}",
|
393
|
-
"output": "{\n \"Response\": {\n \"TotalCount\": 1,\n \"RequestId\": \"084d5612-67a7-4aca-aac9-827aa3662b2d\",\n \"DefaultServerCertInfo\": [\n {\n \"Status\": \"deployed\",\n \"CertId\": \"teo-285inl1otbtd\",\n \"SubjectAltName\": [\n \"*.test.com\",\n \"test.com\"\n ],\n \"EffectiveTime\": \"2020-09-22T00:00:00+00:00\",\n \"CommonName\": \"test.com\",\n \"ExpireTime\": \"2020-09-22T00:00:00+00:00\",\n \"Alias\": \"EdgeOne default\",\n \"Message\": \"\",\n \"Type\": \"default\"\n }\n ]\n }\n}",
|
393
|
+
"output": "{\n \"Response\": {\n \"TotalCount\": 1,\n \"RequestId\": \"084d5612-67a7-4aca-aac9-827aa3662b2d\",\n \"DefaultServerCertInfo\": [\n {\n \"Status\": \"deployed\",\n \"CertId\": \"teo-285inl1otbtd\",\n \"SubjectAltName\": [\n \"*.test.com\",\n \"test.com\"\n ],\n \"EffectiveTime\": \"2020-09-22T00:00:00+00:00\",\n \"CommonName\": \"test.com\",\n \"ExpireTime\": \"2020-09-22T00:00:00+00:00\",\n \"Alias\": \"EdgeOne default\",\n \"Message\": \"\",\n \"Type\": \"default\",\n \"SignAlgo\": \"RSA 2048\"\n }\n ]\n }\n}",
|
394
394
|
"title": "获取默认证书"
|
395
395
|
}
|
396
396
|
],
|
@@ -277,7 +277,7 @@ def doCreateConsumerGroup(args, parsed_globals):
|
|
277
277
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
278
278
|
|
279
279
|
|
280
|
-
def
|
280
|
+
def doDescribeMQTTProductSKUList(args, parsed_globals):
|
281
281
|
g_param = parse_global_arg(parsed_globals)
|
282
282
|
|
283
283
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -306,11 +306,11 @@ def doDescribeRoleList(args, parsed_globals):
|
|
306
306
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
307
307
|
client._sdkVersion += ("_CLI_" + __version__)
|
308
308
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
309
|
-
model = models.
|
309
|
+
model = models.DescribeMQTTProductSKUListRequest()
|
310
310
|
model.from_json_string(json.dumps(args))
|
311
311
|
start_time = time.time()
|
312
312
|
while True:
|
313
|
-
rsp = client.
|
313
|
+
rsp = client.DescribeMQTTProductSKUList(model)
|
314
314
|
result = rsp.to_json_string()
|
315
315
|
try:
|
316
316
|
json_obj = json.loads(result)
|
@@ -381,6 +381,58 @@ def doDescribeTopicStatsOp(args, parsed_globals):
|
|
381
381
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
382
382
|
|
383
383
|
|
384
|
+
def doDescribeRoleList(args, parsed_globals):
|
385
|
+
g_param = parse_global_arg(parsed_globals)
|
386
|
+
|
387
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
388
|
+
cred = credential.CVMRoleCredential()
|
389
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
390
|
+
cred = credential.STSAssumeRoleCredential(
|
391
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
392
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
393
|
+
)
|
394
|
+
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):
|
395
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
396
|
+
else:
|
397
|
+
cred = credential.Credential(
|
398
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
399
|
+
)
|
400
|
+
http_profile = HttpProfile(
|
401
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
402
|
+
reqMethod="POST",
|
403
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
404
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
405
|
+
)
|
406
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
407
|
+
if g_param[OptionsDefine.Language]:
|
408
|
+
profile.language = g_param[OptionsDefine.Language]
|
409
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
410
|
+
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
411
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
412
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
413
|
+
model = models.DescribeRoleListRequest()
|
414
|
+
model.from_json_string(json.dumps(args))
|
415
|
+
start_time = time.time()
|
416
|
+
while True:
|
417
|
+
rsp = client.DescribeRoleList(model)
|
418
|
+
result = rsp.to_json_string()
|
419
|
+
try:
|
420
|
+
json_obj = json.loads(result)
|
421
|
+
except TypeError as e:
|
422
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
423
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
424
|
+
break
|
425
|
+
cur_time = time.time()
|
426
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
427
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
428
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
429
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
430
|
+
else:
|
431
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
432
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
433
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
434
|
+
|
435
|
+
|
384
436
|
def doDeleteConsumerGroup(args, parsed_globals):
|
385
437
|
g_param = parse_global_arg(parsed_globals)
|
386
438
|
|
@@ -745,7 +797,7 @@ def doDescribeInstance(args, parsed_globals):
|
|
745
797
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
746
798
|
|
747
799
|
|
748
|
-
def
|
800
|
+
def doDescribeTopicList(args, parsed_globals):
|
749
801
|
g_param = parse_global_arg(parsed_globals)
|
750
802
|
|
751
803
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -774,11 +826,63 @@ def doDeleteTopic(args, parsed_globals):
|
|
774
826
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
775
827
|
client._sdkVersion += ("_CLI_" + __version__)
|
776
828
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
777
|
-
model = models.
|
829
|
+
model = models.DescribeTopicListRequest()
|
778
830
|
model.from_json_string(json.dumps(args))
|
779
831
|
start_time = time.time()
|
780
832
|
while True:
|
781
|
-
rsp = client.
|
833
|
+
rsp = client.DescribeTopicList(model)
|
834
|
+
result = rsp.to_json_string()
|
835
|
+
try:
|
836
|
+
json_obj = json.loads(result)
|
837
|
+
except TypeError as e:
|
838
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
839
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
840
|
+
break
|
841
|
+
cur_time = time.time()
|
842
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
843
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
844
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
845
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
846
|
+
else:
|
847
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
848
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
849
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
|
+
|
851
|
+
|
852
|
+
def doDescribeMQTTInstanceList(args, parsed_globals):
|
853
|
+
g_param = parse_global_arg(parsed_globals)
|
854
|
+
|
855
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
856
|
+
cred = credential.CVMRoleCredential()
|
857
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
858
|
+
cred = credential.STSAssumeRoleCredential(
|
859
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
860
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
861
|
+
)
|
862
|
+
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):
|
863
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
864
|
+
else:
|
865
|
+
cred = credential.Credential(
|
866
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
867
|
+
)
|
868
|
+
http_profile = HttpProfile(
|
869
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
870
|
+
reqMethod="POST",
|
871
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
872
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
873
|
+
)
|
874
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
875
|
+
if g_param[OptionsDefine.Language]:
|
876
|
+
profile.language = g_param[OptionsDefine.Language]
|
877
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
878
|
+
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
879
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
880
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
881
|
+
model = models.DescribeMQTTInstanceListRequest()
|
882
|
+
model.from_json_string(json.dumps(args))
|
883
|
+
start_time = time.time()
|
884
|
+
while True:
|
885
|
+
rsp = client.DescribeMQTTInstanceList(model)
|
782
886
|
result = rsp.to_json_string()
|
783
887
|
try:
|
784
888
|
json_obj = json.loads(result)
|
@@ -849,6 +953,58 @@ def doImportSourceClusterTopics(args, parsed_globals):
|
|
849
953
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
954
|
|
851
955
|
|
956
|
+
def doCreateMQTTInstance(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.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
983
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
984
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
985
|
+
model = models.CreateMQTTInstanceRequest()
|
986
|
+
model.from_json_string(json.dumps(args))
|
987
|
+
start_time = time.time()
|
988
|
+
while True:
|
989
|
+
rsp = client.CreateMQTTInstance(model)
|
990
|
+
result = rsp.to_json_string()
|
991
|
+
try:
|
992
|
+
json_obj = json.loads(result)
|
993
|
+
except TypeError as e:
|
994
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
995
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
996
|
+
break
|
997
|
+
cur_time = time.time()
|
998
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
999
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1000
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1001
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1002
|
+
else:
|
1003
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1004
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1005
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1006
|
+
|
1007
|
+
|
852
1008
|
def doDescribeInstanceList(args, parsed_globals):
|
853
1009
|
g_param = parse_global_arg(parsed_globals)
|
854
1010
|
|
@@ -1057,7 +1213,7 @@ def doDescribeTopic(args, parsed_globals):
|
|
1057
1213
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1058
1214
|
|
1059
1215
|
|
1060
|
-
def
|
1216
|
+
def doDeleteTopic(args, parsed_globals):
|
1061
1217
|
g_param = parse_global_arg(parsed_globals)
|
1062
1218
|
|
1063
1219
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1086,11 +1242,11 @@ def doDescribeTopicList(args, parsed_globals):
|
|
1086
1242
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
1087
1243
|
client._sdkVersion += ("_CLI_" + __version__)
|
1088
1244
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1089
|
-
model = models.
|
1245
|
+
model = models.DeleteTopicRequest()
|
1090
1246
|
model.from_json_string(json.dumps(args))
|
1091
1247
|
start_time = time.time()
|
1092
1248
|
while True:
|
1093
|
-
rsp = client.
|
1249
|
+
rsp = client.DeleteTopic(model)
|
1094
1250
|
result = rsp.to_json_string()
|
1095
1251
|
try:
|
1096
1252
|
json_obj = json.loads(result)
|
@@ -1177,8 +1333,9 @@ ACTION_MAP = {
|
|
1177
1333
|
"ImportSourceClusterConsumerGroups": doImportSourceClusterConsumerGroups,
|
1178
1334
|
"DeleteInstance": doDeleteInstance,
|
1179
1335
|
"CreateConsumerGroup": doCreateConsumerGroup,
|
1180
|
-
"
|
1336
|
+
"DescribeMQTTProductSKUList": doDescribeMQTTProductSKUList,
|
1181
1337
|
"DescribeTopicStatsOp": doDescribeTopicStatsOp,
|
1338
|
+
"DescribeRoleList": doDescribeRoleList,
|
1182
1339
|
"DeleteConsumerGroup": doDeleteConsumerGroup,
|
1183
1340
|
"ModifyConsumerGroup": doModifyConsumerGroup,
|
1184
1341
|
"DeleteRole": doDeleteRole,
|
@@ -1186,13 +1343,15 @@ ACTION_MAP = {
|
|
1186
1343
|
"CreateTopic": doCreateTopic,
|
1187
1344
|
"CreateInstance": doCreateInstance,
|
1188
1345
|
"DescribeInstance": doDescribeInstance,
|
1189
|
-
"
|
1346
|
+
"DescribeTopicList": doDescribeTopicList,
|
1347
|
+
"DescribeMQTTInstanceList": doDescribeMQTTInstanceList,
|
1190
1348
|
"ImportSourceClusterTopics": doImportSourceClusterTopics,
|
1349
|
+
"CreateMQTTInstance": doCreateMQTTInstance,
|
1191
1350
|
"DescribeInstanceList": doDescribeInstanceList,
|
1192
1351
|
"DescribeConsumerGroupList": doDescribeConsumerGroupList,
|
1193
1352
|
"ModifyRole": doModifyRole,
|
1194
1353
|
"DescribeTopic": doDescribeTopic,
|
1195
|
-
"
|
1354
|
+
"DeleteTopic": doDeleteTopic,
|
1196
1355
|
"ModifyInstance": doModifyInstance,
|
1197
1356
|
|
1198
1357
|
}
|