tccli 3.0.1004.1__py2.py3-none-any.whl → 3.0.1005.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/cvm/v20170312/CreateLaunchTemplate.md +1 -1
- tccli/examples/cvm/v20170312/RenewInstances.md +2 -2
- tccli/examples/cvm/v20170312/ResetInstancesPassword.md +1 -1
- tccli/examples/cvm/v20170312/StopInstances.md +1 -1
- tccli/examples/cwp/v20180228/DescribeMachineInfo.md +20 -20
- tccli/examples/cynosdb/v20190107/CreateClusterDatabase.md +9 -9
- tccli/examples/cynosdb/v20190107/DescribeClusterParams.md +18 -28
- tccli/examples/cynosdb/v20190107/DescribeClusters.md +70 -77
- tccli/examples/cynosdb/v20190107/DescribeZones.md +27 -29
- tccli/examples/cynosdb/v20190107/ModifyAccountHost.md +5 -5
- tccli/examples/cynosdb/v20190107/ModifyProxyDesc.md +4 -4
- tccli/examples/cynosdb/v20190107/ReloadBalanceProxyNode.md +5 -5
- tccli/examples/essbasic/v20210526/OperateChannelTemplate.md +22 -22
- tccli/examples/hai/v20230812/DescribeApplications.md +2 -1
- tccli/examples/sqlserver/v20180328/BalanceReadOnlyGroup.md +21 -0
- tccli/examples/sqlserver/v20180328/DeleteRestoreTask.md +21 -0
- tccli/examples/sqlserver/v20180328/DescribeAccountPrivilegeByDB.md +31 -0
- tccli/examples/sqlserver/v20180328/DescribeCollationTimeZone.md +24 -0
- tccli/examples/sqlserver/v20180328/DescribeCrossRegions.md +27 -0
- tccli/examples/sqlserver/v20180328/DescribeDBPrivilegeByAccount.md +46 -0
- tccli/examples/sqlserver/v20180328/DescribeDBRestoreTime.md +31 -0
- tccli/examples/sqlserver/v20180328/DescribeDatabaseNames.md +27 -0
- tccli/examples/sqlserver/v20180328/DescribeInquiryPriceParameter.md +30 -0
- tccli/examples/sqlserver/v20180328/DescribeInstanceTasks.md +36 -0
- tccli/examples/sqlserver/v20180328/DescribeInstanceTradeParameter.md +37 -0
- tccli/examples/sqlserver/v20180328/DescribeProductSpec.md +81 -0
- tccli/examples/sqlserver/v20180328/DescribeReadOnlyGroupAutoWeight.md +60 -0
- tccli/examples/sqlserver/v20180328/DescribeRestoreTask.md +46 -0
- tccli/examples/sqlserver/v20180328/DescribeSpecSellStatus.md +124 -0
- tccli/examples/sqlserver/v20180328/DescribeUpgradeInstanceCheck.md +71 -0
- tccli/examples/sqlserver/v20180328/ModifyCloseWanIp.md +21 -0
- tccli/examples/sqlserver/v20180328/ModifyDBInstanceNote.md +21 -0
- tccli/examples/sqlserver/v20180328/ModifyOpenWanIp.md +21 -0
- tccli/examples/sqlserver/v20180328/ModifyPublishSubscribe.md +51 -0
- tccli/examples/tbaas/v20180416/DescribeFabricBlock.md +37 -0
- tccli/examples/tbaas/v20180416/DescribeFabricTransaction.md +33 -0
- tccli/examples/tbaas/v20180416/InvokeFabricChaincode.md +28 -0
- tccli/examples/tbaas/v20180416/QueryFabricChaincode.md +27 -0
- tccli/examples/tcss/v20201101/AddEditImageAutoAuthorizedRule.md +1 -1
- tccli/examples/tcss/v20201101/CreateAssetImageScanSetting.md +4 -4
- tccli/examples/tcss/v20201101/DescribeAssetImageDetail.md +28 -27
- tccli/examples/tcss/v20201101/DescribeImageAutoAuthorizedRule.md +2 -2
- tccli/examples/tcss/v20201101/RenewImageAuthorizeState.md +2 -2
- tccli/examples/tke/v20180525/DescribeClusterEndpoints.md +1 -0
- tccli/examples/tke/v20180525/DescribeClusterExtraArgs.md +31 -0
- tccli/examples/tke/v20180525/DescribeExternalNodeSupportConfig.md +81 -0
- tccli/examples/tke/v20180525/DescribeIPAMD.md +26 -0
- tccli/examples/trocket/v20230308/ImportSourceClusterConsumerGroups.md +23 -0
- tccli/examples/trocket/v20230308/ImportSourceClusterTopics.md +25 -0
- tccli/examples/wedata/v20210820/DescribeApproveList.md +43 -161
- tccli/examples/wedata/v20210820/DescribeApproveTypeList.md +64 -0
- tccli/services/__init__.py +1 -5
- tccli/services/billing/v20180709/api.json +10 -10
- tccli/services/cdb/v20170320/api.json +10 -1
- tccli/services/cloudstudio/cloudstudio_client.py +30 -1042
- tccli/services/cvm/v20170312/api.json +68 -68
- tccli/services/cvm/v20170312/examples.json +4 -4
- tccli/services/cwp/v20180228/api.json +20 -0
- tccli/services/cwp/v20180228/examples.json +1 -1
- tccli/services/cynosdb/v20190107/api.json +10 -11
- tccli/services/cynosdb/v20190107/examples.json +14 -14
- tccli/services/dsgc/v20190723/api.json +48 -41
- tccli/services/ess/v20201111/api.json +9 -9
- tccli/services/essbasic/v20210526/api.json +10 -10
- tccli/services/essbasic/v20210526/examples.json +6 -6
- tccli/services/hai/v20230812/api.json +69 -69
- tccli/services/hai/v20230812/examples.json +1 -1
- tccli/services/sqlserver/sqlserver_client.py +1418 -358
- tccli/services/sqlserver/v20180328/api.json +2426 -172
- tccli/services/sqlserver/v20180328/examples.json +166 -0
- tccli/services/tbaas/tbaas_client.py +273 -61
- tccli/services/tbaas/v20180416/api.json +539 -0
- tccli/services/tbaas/v20180416/examples.json +32 -0
- tccli/services/tchd/v20230306/api.json +1 -1
- tccli/services/tcss/v20201101/api.json +443 -87
- tccli/services/tcss/v20201101/examples.json +7 -7
- tccli/services/tdmq/v20200217/api.json +9 -9
- tccli/services/tke/tke_client.py +159 -0
- tccli/services/tke/v20180525/api.json +375 -0
- tccli/services/tke/v20180525/examples.json +25 -1
- tccli/services/trocket/trocket_client.py +171 -65
- tccli/services/trocket/v20230308/api.json +230 -0
- tccli/services/trocket/v20230308/examples.json +16 -0
- tccli/services/tse/v20201207/api.json +57 -35
- tccli/services/vrs/v20200824/api.json +10 -0
- tccli/services/waf/v20180125/api.json +201 -54
- tccli/services/wedata/v20210820/api.json +144 -14
- tccli/services/wedata/v20210820/examples.json +16 -2
- tccli/services/wedata/wedata_client.py +53 -0
- tccli/services/weilingwith/v20230427/api.json +13 -13
- {tccli-3.0.1004.1.dist-info → tccli-3.0.1005.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1004.1.dist-info → tccli-3.0.1005.1.dist-info}/RECORD +96 -72
- tccli/services/casb/__init__.py +0 -4
- tccli/services/casb/casb_client.py +0 -194
- tccli/services/casb/v20200507/api.json +0 -110
- tccli/services/casb/v20200507/examples.json +0 -19
- tccli/services/cloudstudio/v20210524/api.json +0 -2604
- tccli/services/cloudstudio/v20210524/examples.json +0 -205
- {tccli-3.0.1004.1.dist-info → tccli-3.0.1005.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1004.1.dist-info → tccli-3.0.1005.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1004.1.dist-info → tccli-3.0.1005.1.dist-info}/license_files/LICENSE +0 -0
@@ -17,7 +17,7 @@ from tencentcloud.trocket.v20230308 import models as models_v20230308
|
|
17
17
|
from jmespath import search
|
18
18
|
import time
|
19
19
|
|
20
|
-
def
|
20
|
+
def doModifyTopic(args, parsed_globals):
|
21
21
|
g_param = parse_global_arg(parsed_globals)
|
22
22
|
|
23
23
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -46,11 +46,11 @@ def doDescribeTopicStatsOp(args, parsed_globals):
|
|
46
46
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
47
47
|
client._sdkVersion += ("_CLI_" + __version__)
|
48
48
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
-
model = models.
|
49
|
+
model = models.ModifyTopicRequest()
|
50
50
|
model.from_json_string(json.dumps(args))
|
51
51
|
start_time = time.time()
|
52
52
|
while True:
|
53
|
-
rsp = client.
|
53
|
+
rsp = client.ModifyTopic(model)
|
54
54
|
result = rsp.to_json_string()
|
55
55
|
try:
|
56
56
|
json_obj = json.loads(result)
|
@@ -69,7 +69,7 @@ def doDescribeTopicStatsOp(args, parsed_globals):
|
|
69
69
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
70
70
|
|
71
71
|
|
72
|
-
def
|
72
|
+
def doCreateRole(args, parsed_globals):
|
73
73
|
g_param = parse_global_arg(parsed_globals)
|
74
74
|
|
75
75
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -98,11 +98,11 @@ def doDescribeConsumerGroup(args, parsed_globals):
|
|
98
98
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
99
99
|
client._sdkVersion += ("_CLI_" + __version__)
|
100
100
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
-
model = models.
|
101
|
+
model = models.CreateRoleRequest()
|
102
102
|
model.from_json_string(json.dumps(args))
|
103
103
|
start_time = time.time()
|
104
104
|
while True:
|
105
|
-
rsp = client.
|
105
|
+
rsp = client.CreateRole(model)
|
106
106
|
result = rsp.to_json_string()
|
107
107
|
try:
|
108
108
|
json_obj = json.loads(result)
|
@@ -121,7 +121,7 @@ def doDescribeConsumerGroup(args, parsed_globals):
|
|
121
121
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
122
|
|
123
123
|
|
124
|
-
def
|
124
|
+
def doImportSourceClusterConsumerGroups(args, parsed_globals):
|
125
125
|
g_param = parse_global_arg(parsed_globals)
|
126
126
|
|
127
127
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -150,11 +150,11 @@ def doCreateTopic(args, parsed_globals):
|
|
150
150
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
151
151
|
client._sdkVersion += ("_CLI_" + __version__)
|
152
152
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
-
model = models.
|
153
|
+
model = models.ImportSourceClusterConsumerGroupsRequest()
|
154
154
|
model.from_json_string(json.dumps(args))
|
155
155
|
start_time = time.time()
|
156
156
|
while True:
|
157
|
-
rsp = client.
|
157
|
+
rsp = client.ImportSourceClusterConsumerGroups(model)
|
158
158
|
result = rsp.to_json_string()
|
159
159
|
try:
|
160
160
|
json_obj = json.loads(result)
|
@@ -173,7 +173,7 @@ def doCreateTopic(args, parsed_globals):
|
|
173
173
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
174
174
|
|
175
175
|
|
176
|
-
def
|
176
|
+
def doDeleteInstance(args, parsed_globals):
|
177
177
|
g_param = parse_global_arg(parsed_globals)
|
178
178
|
|
179
179
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -202,11 +202,11 @@ def doDeleteTopic(args, parsed_globals):
|
|
202
202
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
203
203
|
client._sdkVersion += ("_CLI_" + __version__)
|
204
204
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
205
|
-
model = models.
|
205
|
+
model = models.DeleteInstanceRequest()
|
206
206
|
model.from_json_string(json.dumps(args))
|
207
207
|
start_time = time.time()
|
208
208
|
while True:
|
209
|
-
rsp = client.
|
209
|
+
rsp = client.DeleteInstance(model)
|
210
210
|
result = rsp.to_json_string()
|
211
211
|
try:
|
212
212
|
json_obj = json.loads(result)
|
@@ -225,7 +225,7 @@ def doDeleteTopic(args, parsed_globals):
|
|
225
225
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
226
|
|
227
227
|
|
228
|
-
def
|
228
|
+
def doCreateConsumerGroup(args, parsed_globals):
|
229
229
|
g_param = parse_global_arg(parsed_globals)
|
230
230
|
|
231
231
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -254,11 +254,11 @@ def doDeleteConsumerGroup(args, parsed_globals):
|
|
254
254
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
255
255
|
client._sdkVersion += ("_CLI_" + __version__)
|
256
256
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
257
|
-
model = models.
|
257
|
+
model = models.CreateConsumerGroupRequest()
|
258
258
|
model.from_json_string(json.dumps(args))
|
259
259
|
start_time = time.time()
|
260
260
|
while True:
|
261
|
-
rsp = client.
|
261
|
+
rsp = client.CreateConsumerGroup(model)
|
262
262
|
result = rsp.to_json_string()
|
263
263
|
try:
|
264
264
|
json_obj = json.loads(result)
|
@@ -277,7 +277,7 @@ def doDeleteConsumerGroup(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 doDescribeRoleList(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 doModifyTopic(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.DescribeRoleListRequest()
|
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.DescribeRoleList(model)
|
314
314
|
result = rsp.to_json_string()
|
315
315
|
try:
|
316
316
|
json_obj = json.loads(result)
|
@@ -329,7 +329,7 @@ def doModifyTopic(args, parsed_globals):
|
|
329
329
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
330
330
|
|
331
331
|
|
332
|
-
def
|
332
|
+
def doDescribeTopicStatsOp(args, parsed_globals):
|
333
333
|
g_param = parse_global_arg(parsed_globals)
|
334
334
|
|
335
335
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -358,11 +358,11 @@ def doCreateInstance(args, parsed_globals):
|
|
358
358
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
359
359
|
client._sdkVersion += ("_CLI_" + __version__)
|
360
360
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
361
|
-
model = models.
|
361
|
+
model = models.DescribeTopicStatsOpRequest()
|
362
362
|
model.from_json_string(json.dumps(args))
|
363
363
|
start_time = time.time()
|
364
364
|
while True:
|
365
|
-
rsp = client.
|
365
|
+
rsp = client.DescribeTopicStatsOp(model)
|
366
366
|
result = rsp.to_json_string()
|
367
367
|
try:
|
368
368
|
json_obj = json.loads(result)
|
@@ -381,7 +381,7 @@ def doCreateInstance(args, parsed_globals):
|
|
381
381
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
382
382
|
|
383
383
|
|
384
|
-
def
|
384
|
+
def doDeleteConsumerGroup(args, parsed_globals):
|
385
385
|
g_param = parse_global_arg(parsed_globals)
|
386
386
|
|
387
387
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -410,11 +410,11 @@ def doDescribeInstanceList(args, parsed_globals):
|
|
410
410
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
411
411
|
client._sdkVersion += ("_CLI_" + __version__)
|
412
412
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
413
|
-
model = models.
|
413
|
+
model = models.DeleteConsumerGroupRequest()
|
414
414
|
model.from_json_string(json.dumps(args))
|
415
415
|
start_time = time.time()
|
416
416
|
while True:
|
417
|
-
rsp = client.
|
417
|
+
rsp = client.DeleteConsumerGroup(model)
|
418
418
|
result = rsp.to_json_string()
|
419
419
|
try:
|
420
420
|
json_obj = json.loads(result)
|
@@ -433,7 +433,7 @@ def doDescribeInstanceList(args, parsed_globals):
|
|
433
433
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
434
434
|
|
435
435
|
|
436
|
-
def
|
436
|
+
def doModifyConsumerGroup(args, parsed_globals):
|
437
437
|
g_param = parse_global_arg(parsed_globals)
|
438
438
|
|
439
439
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -462,11 +462,11 @@ def doCreateRole(args, parsed_globals):
|
|
462
462
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
463
463
|
client._sdkVersion += ("_CLI_" + __version__)
|
464
464
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
465
|
-
model = models.
|
465
|
+
model = models.ModifyConsumerGroupRequest()
|
466
466
|
model.from_json_string(json.dumps(args))
|
467
467
|
start_time = time.time()
|
468
468
|
while True:
|
469
|
-
rsp = client.
|
469
|
+
rsp = client.ModifyConsumerGroup(model)
|
470
470
|
result = rsp.to_json_string()
|
471
471
|
try:
|
472
472
|
json_obj = json.loads(result)
|
@@ -537,7 +537,7 @@ def doDeleteRole(args, parsed_globals):
|
|
537
537
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
538
538
|
|
539
539
|
|
540
|
-
def
|
540
|
+
def doDescribeConsumerGroup(args, parsed_globals):
|
541
541
|
g_param = parse_global_arg(parsed_globals)
|
542
542
|
|
543
543
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -566,11 +566,115 @@ def doModifyConsumerGroup(args, parsed_globals):
|
|
566
566
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
567
567
|
client._sdkVersion += ("_CLI_" + __version__)
|
568
568
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
569
|
-
model = models.
|
569
|
+
model = models.DescribeConsumerGroupRequest()
|
570
570
|
model.from_json_string(json.dumps(args))
|
571
571
|
start_time = time.time()
|
572
572
|
while True:
|
573
|
-
rsp = client.
|
573
|
+
rsp = client.DescribeConsumerGroup(model)
|
574
|
+
result = rsp.to_json_string()
|
575
|
+
try:
|
576
|
+
json_obj = json.loads(result)
|
577
|
+
except TypeError as e:
|
578
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
579
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
580
|
+
break
|
581
|
+
cur_time = time.time()
|
582
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
583
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
584
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
585
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
586
|
+
else:
|
587
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
588
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
589
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
590
|
+
|
591
|
+
|
592
|
+
def doCreateTopic(args, parsed_globals):
|
593
|
+
g_param = parse_global_arg(parsed_globals)
|
594
|
+
|
595
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
596
|
+
cred = credential.CVMRoleCredential()
|
597
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
598
|
+
cred = credential.STSAssumeRoleCredential(
|
599
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
600
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
|
601
|
+
)
|
602
|
+
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):
|
603
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
604
|
+
else:
|
605
|
+
cred = credential.Credential(
|
606
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
607
|
+
)
|
608
|
+
http_profile = HttpProfile(
|
609
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
610
|
+
reqMethod="POST",
|
611
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
612
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
613
|
+
)
|
614
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
615
|
+
if g_param[OptionsDefine.Language]:
|
616
|
+
profile.language = g_param[OptionsDefine.Language]
|
617
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
618
|
+
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
619
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
620
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
621
|
+
model = models.CreateTopicRequest()
|
622
|
+
model.from_json_string(json.dumps(args))
|
623
|
+
start_time = time.time()
|
624
|
+
while True:
|
625
|
+
rsp = client.CreateTopic(model)
|
626
|
+
result = rsp.to_json_string()
|
627
|
+
try:
|
628
|
+
json_obj = json.loads(result)
|
629
|
+
except TypeError as e:
|
630
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
631
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
632
|
+
break
|
633
|
+
cur_time = time.time()
|
634
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
635
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
636
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
637
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
638
|
+
else:
|
639
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
640
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
641
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
642
|
+
|
643
|
+
|
644
|
+
def doCreateInstance(args, parsed_globals):
|
645
|
+
g_param = parse_global_arg(parsed_globals)
|
646
|
+
|
647
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
648
|
+
cred = credential.CVMRoleCredential()
|
649
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
650
|
+
cred = credential.STSAssumeRoleCredential(
|
651
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
652
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
|
653
|
+
)
|
654
|
+
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):
|
655
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
656
|
+
else:
|
657
|
+
cred = credential.Credential(
|
658
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
659
|
+
)
|
660
|
+
http_profile = HttpProfile(
|
661
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
662
|
+
reqMethod="POST",
|
663
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
664
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
665
|
+
)
|
666
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
667
|
+
if g_param[OptionsDefine.Language]:
|
668
|
+
profile.language = g_param[OptionsDefine.Language]
|
669
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
670
|
+
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
671
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
672
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
673
|
+
model = models.CreateInstanceRequest()
|
674
|
+
model.from_json_string(json.dumps(args))
|
675
|
+
start_time = time.time()
|
676
|
+
while True:
|
677
|
+
rsp = client.CreateInstance(model)
|
574
678
|
result = rsp.to_json_string()
|
575
679
|
try:
|
576
680
|
json_obj = json.loads(result)
|
@@ -641,7 +745,7 @@ def doDescribeInstance(args, parsed_globals):
|
|
641
745
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
642
746
|
|
643
747
|
|
644
|
-
def
|
748
|
+
def doDeleteTopic(args, parsed_globals):
|
645
749
|
g_param = parse_global_arg(parsed_globals)
|
646
750
|
|
647
751
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -670,11 +774,11 @@ def doModifyRole(args, parsed_globals):
|
|
670
774
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
671
775
|
client._sdkVersion += ("_CLI_" + __version__)
|
672
776
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
673
|
-
model = models.
|
777
|
+
model = models.DeleteTopicRequest()
|
674
778
|
model.from_json_string(json.dumps(args))
|
675
779
|
start_time = time.time()
|
676
780
|
while True:
|
677
|
-
rsp = client.
|
781
|
+
rsp = client.DeleteTopic(model)
|
678
782
|
result = rsp.to_json_string()
|
679
783
|
try:
|
680
784
|
json_obj = json.loads(result)
|
@@ -693,7 +797,7 @@ def doModifyRole(args, parsed_globals):
|
|
693
797
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
694
798
|
|
695
799
|
|
696
|
-
def
|
800
|
+
def doImportSourceClusterTopics(args, parsed_globals):
|
697
801
|
g_param = parse_global_arg(parsed_globals)
|
698
802
|
|
699
803
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -722,11 +826,11 @@ def doDeleteInstance(args, parsed_globals):
|
|
722
826
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
723
827
|
client._sdkVersion += ("_CLI_" + __version__)
|
724
828
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
725
|
-
model = models.
|
829
|
+
model = models.ImportSourceClusterTopicsRequest()
|
726
830
|
model.from_json_string(json.dumps(args))
|
727
831
|
start_time = time.time()
|
728
832
|
while True:
|
729
|
-
rsp = client.
|
833
|
+
rsp = client.ImportSourceClusterTopics(model)
|
730
834
|
result = rsp.to_json_string()
|
731
835
|
try:
|
732
836
|
json_obj = json.loads(result)
|
@@ -745,7 +849,7 @@ def doDeleteInstance(args, parsed_globals):
|
|
745
849
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
746
850
|
|
747
851
|
|
748
|
-
def
|
852
|
+
def doDescribeInstanceList(args, parsed_globals):
|
749
853
|
g_param = parse_global_arg(parsed_globals)
|
750
854
|
|
751
855
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -774,11 +878,11 @@ def doDescribeTopic(args, parsed_globals):
|
|
774
878
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
775
879
|
client._sdkVersion += ("_CLI_" + __version__)
|
776
880
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
777
|
-
model = models.
|
881
|
+
model = models.DescribeInstanceListRequest()
|
778
882
|
model.from_json_string(json.dumps(args))
|
779
883
|
start_time = time.time()
|
780
884
|
while True:
|
781
|
-
rsp = client.
|
885
|
+
rsp = client.DescribeInstanceList(model)
|
782
886
|
result = rsp.to_json_string()
|
783
887
|
try:
|
784
888
|
json_obj = json.loads(result)
|
@@ -797,7 +901,7 @@ def doDescribeTopic(args, parsed_globals):
|
|
797
901
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
798
902
|
|
799
903
|
|
800
|
-
def
|
904
|
+
def doDescribeConsumerGroupList(args, parsed_globals):
|
801
905
|
g_param = parse_global_arg(parsed_globals)
|
802
906
|
|
803
907
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -826,11 +930,11 @@ def doDescribeTopicList(args, parsed_globals):
|
|
826
930
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
827
931
|
client._sdkVersion += ("_CLI_" + __version__)
|
828
932
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
829
|
-
model = models.
|
933
|
+
model = models.DescribeConsumerGroupListRequest()
|
830
934
|
model.from_json_string(json.dumps(args))
|
831
935
|
start_time = time.time()
|
832
936
|
while True:
|
833
|
-
rsp = client.
|
937
|
+
rsp = client.DescribeConsumerGroupList(model)
|
834
938
|
result = rsp.to_json_string()
|
835
939
|
try:
|
836
940
|
json_obj = json.loads(result)
|
@@ -849,7 +953,7 @@ def doDescribeTopicList(args, parsed_globals):
|
|
849
953
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
954
|
|
851
955
|
|
852
|
-
def
|
956
|
+
def doModifyRole(args, parsed_globals):
|
853
957
|
g_param = parse_global_arg(parsed_globals)
|
854
958
|
|
855
959
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -878,11 +982,11 @@ def doCreateConsumerGroup(args, parsed_globals):
|
|
878
982
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
879
983
|
client._sdkVersion += ("_CLI_" + __version__)
|
880
984
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
881
|
-
model = models.
|
985
|
+
model = models.ModifyRoleRequest()
|
882
986
|
model.from_json_string(json.dumps(args))
|
883
987
|
start_time = time.time()
|
884
988
|
while True:
|
885
|
-
rsp = client.
|
989
|
+
rsp = client.ModifyRole(model)
|
886
990
|
result = rsp.to_json_string()
|
887
991
|
try:
|
888
992
|
json_obj = json.loads(result)
|
@@ -901,7 +1005,7 @@ def doCreateConsumerGroup(args, parsed_globals):
|
|
901
1005
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
902
1006
|
|
903
1007
|
|
904
|
-
def
|
1008
|
+
def doDescribeTopic(args, parsed_globals):
|
905
1009
|
g_param = parse_global_arg(parsed_globals)
|
906
1010
|
|
907
1011
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -930,11 +1034,11 @@ def doDescribeRoleList(args, parsed_globals):
|
|
930
1034
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
931
1035
|
client._sdkVersion += ("_CLI_" + __version__)
|
932
1036
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
933
|
-
model = models.
|
1037
|
+
model = models.DescribeTopicRequest()
|
934
1038
|
model.from_json_string(json.dumps(args))
|
935
1039
|
start_time = time.time()
|
936
1040
|
while True:
|
937
|
-
rsp = client.
|
1041
|
+
rsp = client.DescribeTopic(model)
|
938
1042
|
result = rsp.to_json_string()
|
939
1043
|
try:
|
940
1044
|
json_obj = json.loads(result)
|
@@ -953,7 +1057,7 @@ def doDescribeRoleList(args, parsed_globals):
|
|
953
1057
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
954
1058
|
|
955
1059
|
|
956
|
-
def
|
1060
|
+
def doDescribeTopicList(args, parsed_globals):
|
957
1061
|
g_param = parse_global_arg(parsed_globals)
|
958
1062
|
|
959
1063
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -982,11 +1086,11 @@ def doModifyInstance(args, parsed_globals):
|
|
982
1086
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
983
1087
|
client._sdkVersion += ("_CLI_" + __version__)
|
984
1088
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
985
|
-
model = models.
|
1089
|
+
model = models.DescribeTopicListRequest()
|
986
1090
|
model.from_json_string(json.dumps(args))
|
987
1091
|
start_time = time.time()
|
988
1092
|
while True:
|
989
|
-
rsp = client.
|
1093
|
+
rsp = client.DescribeTopicList(model)
|
990
1094
|
result = rsp.to_json_string()
|
991
1095
|
try:
|
992
1096
|
json_obj = json.loads(result)
|
@@ -1005,7 +1109,7 @@ def doModifyInstance(args, parsed_globals):
|
|
1005
1109
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1006
1110
|
|
1007
1111
|
|
1008
|
-
def
|
1112
|
+
def doModifyInstance(args, parsed_globals):
|
1009
1113
|
g_param = parse_global_arg(parsed_globals)
|
1010
1114
|
|
1011
1115
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1034,11 +1138,11 @@ def doDescribeConsumerGroupList(args, parsed_globals):
|
|
1034
1138
|
client = mod.TrocketClient(cred, g_param[OptionsDefine.Region], profile)
|
1035
1139
|
client._sdkVersion += ("_CLI_" + __version__)
|
1036
1140
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1037
|
-
model = models.
|
1141
|
+
model = models.ModifyInstanceRequest()
|
1038
1142
|
model.from_json_string(json.dumps(args))
|
1039
1143
|
start_time = time.time()
|
1040
1144
|
while True:
|
1041
|
-
rsp = client.
|
1145
|
+
rsp = client.ModifyInstance(model)
|
1042
1146
|
result = rsp.to_json_string()
|
1043
1147
|
try:
|
1044
1148
|
json_obj = json.loads(result)
|
@@ -1068,26 +1172,28 @@ MODELS_MAP = {
|
|
1068
1172
|
}
|
1069
1173
|
|
1070
1174
|
ACTION_MAP = {
|
1175
|
+
"ModifyTopic": doModifyTopic,
|
1176
|
+
"CreateRole": doCreateRole,
|
1177
|
+
"ImportSourceClusterConsumerGroups": doImportSourceClusterConsumerGroups,
|
1178
|
+
"DeleteInstance": doDeleteInstance,
|
1179
|
+
"CreateConsumerGroup": doCreateConsumerGroup,
|
1180
|
+
"DescribeRoleList": doDescribeRoleList,
|
1071
1181
|
"DescribeTopicStatsOp": doDescribeTopicStatsOp,
|
1182
|
+
"DeleteConsumerGroup": doDeleteConsumerGroup,
|
1183
|
+
"ModifyConsumerGroup": doModifyConsumerGroup,
|
1184
|
+
"DeleteRole": doDeleteRole,
|
1072
1185
|
"DescribeConsumerGroup": doDescribeConsumerGroup,
|
1073
1186
|
"CreateTopic": doCreateTopic,
|
1074
|
-
"DeleteTopic": doDeleteTopic,
|
1075
|
-
"DeleteConsumerGroup": doDeleteConsumerGroup,
|
1076
|
-
"ModifyTopic": doModifyTopic,
|
1077
1187
|
"CreateInstance": doCreateInstance,
|
1078
|
-
"DescribeInstanceList": doDescribeInstanceList,
|
1079
|
-
"CreateRole": doCreateRole,
|
1080
|
-
"DeleteRole": doDeleteRole,
|
1081
|
-
"ModifyConsumerGroup": doModifyConsumerGroup,
|
1082
1188
|
"DescribeInstance": doDescribeInstance,
|
1189
|
+
"DeleteTopic": doDeleteTopic,
|
1190
|
+
"ImportSourceClusterTopics": doImportSourceClusterTopics,
|
1191
|
+
"DescribeInstanceList": doDescribeInstanceList,
|
1192
|
+
"DescribeConsumerGroupList": doDescribeConsumerGroupList,
|
1083
1193
|
"ModifyRole": doModifyRole,
|
1084
|
-
"DeleteInstance": doDeleteInstance,
|
1085
1194
|
"DescribeTopic": doDescribeTopic,
|
1086
1195
|
"DescribeTopicList": doDescribeTopicList,
|
1087
|
-
"CreateConsumerGroup": doCreateConsumerGroup,
|
1088
|
-
"DescribeRoleList": doDescribeRoleList,
|
1089
1196
|
"ModifyInstance": doModifyInstance,
|
1090
|
-
"DescribeConsumerGroupList": doDescribeConsumerGroupList,
|
1091
1197
|
|
1092
1198
|
}
|
1093
1199
|
|