tccli 3.0.872.1__py2.py3-none-any.whl → 3.0.874.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/services/autoscaling/v20180419/api.json +1 -2
  3. tccli/services/autoscaling/v20180419/examples.json +1 -1
  4. tccli/services/billing/v20180709/api.json +30 -40
  5. tccli/services/billing/v20180709/examples.json +1 -1
  6. tccli/services/cdb/v20170320/api.json +23 -0
  7. tccli/services/cdb/v20170320/examples.json +1 -1
  8. tccli/services/ckafka/ckafka_client.py +53 -0
  9. tccli/services/ckafka/v20190819/api.json +264 -3
  10. tccli/services/ckafka/v20190819/examples.json +9 -1
  11. tccli/services/cwp/v20180228/api.json +63 -54
  12. tccli/services/cwp/v20180228/examples.json +2 -2
  13. tccli/services/dasb/v20191018/api.json +16 -52
  14. tccli/services/dasb/v20191018/examples.json +5 -5
  15. tccli/services/dlc/v20210125/api.json +37 -15
  16. tccli/services/dlc/v20210125/examples.json +1 -1
  17. tccli/services/eis/v20210601/api.json +34 -4
  18. tccli/services/eis/v20210601/examples.json +4 -4
  19. tccli/services/ess/ess_client.py +53 -0
  20. tccli/services/ess/v20201111/api.json +58 -1
  21. tccli/services/ess/v20201111/examples.json +8 -0
  22. tccli/services/essbasic/v20210526/api.json +10 -1
  23. tccli/services/iotvideo/v20201215/api.json +9 -6
  24. tccli/services/iotvideo/v20211125/api.json +9 -6
  25. tccli/services/monitor/monitor_client.py +53 -0
  26. tccli/services/monitor/v20180724/api.json +24 -0
  27. tccli/services/monitor/v20180724/examples.json +8 -0
  28. tccli/services/mrs/v20200910/api.json +2 -2
  29. tccli/services/mrs/v20200910/examples.json +1 -1
  30. tccli/services/oceanus/v20190422/api.json +17 -46
  31. tccli/services/omics/omics_client.py +170 -11
  32. tccli/services/omics/v20221128/api.json +312 -0
  33. tccli/services/omics/v20221128/examples.json +24 -0
  34. tccli/services/redis/v20180412/api.json +136 -174
  35. tccli/services/redis/v20180412/examples.json +21 -21
  36. tccli/services/rum/v20210622/api.json +9 -16
  37. tccli/services/scf/v20180416/api.json +29 -21
  38. tccli/services/scf/v20180416/examples.json +1 -1
  39. tccli/services/ssl/v20191205/api.json +52 -57
  40. tccli/services/ssl/v20191205/examples.json +3 -3
  41. tccli/services/ssm/v20190923/api.json +26 -30
  42. tccli/services/ssm/v20190923/examples.json +4 -4
  43. tccli/services/tcss/v20201101/api.json +9 -9
  44. tccli/services/tcss/v20201101/examples.json +1 -1
  45. tccli/services/teo/v20220901/api.json +3 -3
  46. tccli/services/tione/v20211111/api.json +17 -55
  47. tccli/services/tione/v20211111/examples.json +5 -5
  48. tccli/services/trp/v20210515/api.json +0 -2
  49. tccli/services/trp/v20210515/examples.json +2 -2
  50. tccli/services/vpc/v20170312/api.json +70 -47
  51. tccli/services/vpc/v20170312/examples.json +17 -23
  52. tccli/services/vrs/v20200824/api.json +3 -3
  53. tccli/services/wedata/v20210820/api.json +11 -10
  54. {tccli-3.0.872.1.dist-info → tccli-3.0.874.1.dist-info}/METADATA +2 -2
  55. {tccli-3.0.872.1.dist-info → tccli-3.0.874.1.dist-info}/RECORD +59 -59
  56. {tccli-3.0.872.1.dist-info → tccli-3.0.874.1.dist-info}/LICENSE +0 -0
  57. {tccli-3.0.872.1.dist-info → tccli-3.0.874.1.dist-info}/WHEEL +0 -0
  58. {tccli-3.0.872.1.dist-info → tccli-3.0.874.1.dist-info}/entry_points.txt +0 -0
  59. {tccli-3.0.872.1.dist-info → tccli-3.0.874.1.dist-info}/top_level.txt +0 -0
@@ -301,7 +301,6 @@
301
301
  "document": "描述用户创建的集群信息",
302
302
  "members": [
303
303
  {
304
- "default": "",
305
304
  "document": "集群 ID",
306
305
  "example": "cluster-xxxx",
307
306
  "member": "string",
@@ -311,7 +310,6 @@
311
310
  "value_allowed_null": false
312
311
  },
313
312
  {
314
- "default": "",
315
313
  "document": "集群名称",
316
314
  "example": "-",
317
315
  "member": "string",
@@ -321,7 +319,6 @@
321
319
  "value_allowed_null": false
322
320
  },
323
321
  {
324
- "default": "",
325
322
  "document": "地域",
326
323
  "example": "ap-guangzhou",
327
324
  "member": "string",
@@ -331,7 +328,6 @@
331
328
  "value_allowed_null": false
332
329
  },
333
330
  {
334
- "default": "",
335
331
  "document": "用户 AppID",
336
332
  "example": "12314214",
337
333
  "member": "uint64",
@@ -341,7 +337,6 @@
341
337
  "value_allowed_null": false
342
338
  },
343
339
  {
344
- "default": "",
345
340
  "document": "主账号 UIN",
346
341
  "example": "12314214",
347
342
  "member": "string",
@@ -351,7 +346,6 @@
351
346
  "value_allowed_null": false
352
347
  },
353
348
  {
354
- "default": "",
355
349
  "document": "创建者 UIN",
356
350
  "example": "12314214",
357
351
  "member": "string",
@@ -361,7 +355,6 @@
361
355
  "value_allowed_null": false
362
356
  },
363
357
  {
364
- "default": "",
365
358
  "document": "集群状态, 1 未初始化,,3 初始化中,2 运行中",
366
359
  "example": "1",
367
360
  "member": "int64",
@@ -371,7 +364,6 @@
371
364
  "value_allowed_null": false
372
365
  },
373
366
  {
374
- "default": "",
375
367
  "document": "描述",
376
368
  "example": "test",
377
369
  "member": "string",
@@ -381,7 +373,6 @@
381
373
  "value_allowed_null": false
382
374
  },
383
375
  {
384
- "default": "",
385
376
  "document": "集群创建时间",
386
377
  "example": "2020-01-21 00:00:10",
387
378
  "member": "string",
@@ -391,7 +382,6 @@
391
382
  "value_allowed_null": false
392
383
  },
393
384
  {
394
- "default": "",
395
385
  "document": "最后一次操作集群的时间",
396
386
  "example": "2020-01-21 01:00:10",
397
387
  "member": "string",
@@ -401,7 +391,6 @@
401
391
  "value_allowed_null": false
402
392
  },
403
393
  {
404
- "default": "",
405
394
  "document": "CU 数量",
406
395
  "example": "12",
407
396
  "member": "uint64",
@@ -411,7 +400,6 @@
411
400
  "value_allowed_null": false
412
401
  },
413
402
  {
414
- "default": "",
415
403
  "document": "CU 内存规格",
416
404
  "example": "4",
417
405
  "member": "uint64",
@@ -421,7 +409,6 @@
421
409
  "value_allowed_null": false
422
410
  },
423
411
  {
424
- "default": "",
425
412
  "document": "可用区",
426
413
  "example": "ap-guangzhou-1",
427
414
  "member": "string",
@@ -431,7 +418,6 @@
431
418
  "value_allowed_null": false
432
419
  },
433
420
  {
434
- "default": "",
435
421
  "document": "状态描述",
436
422
  "example": "1",
437
423
  "member": "string",
@@ -441,7 +427,6 @@
441
427
  "value_allowed_null": false
442
428
  },
443
429
  {
444
- "default": "",
445
430
  "document": "网络",
446
431
  "example": "[]",
447
432
  "member": "CCN",
@@ -451,7 +436,6 @@
451
436
  "value_allowed_null": false
452
437
  },
453
438
  {
454
- "default": "",
455
439
  "document": "网络",
456
440
  "example": "2",
457
441
  "member": "uint64",
@@ -461,7 +445,6 @@
461
445
  "value_allowed_null": false
462
446
  },
463
447
  {
464
- "default": "",
465
448
  "document": "空闲 CU",
466
449
  "example": "2",
467
450
  "member": "int64",
@@ -471,7 +454,6 @@
471
454
  "value_allowed_null": false
472
455
  },
473
456
  {
474
- "default": "",
475
457
  "document": "集群绑定的标签\n注意:此字段可能返回 null,表示取不到有效值。",
476
458
  "example": "[]",
477
459
  "member": "Tag",
@@ -481,7 +463,6 @@
481
463
  "value_allowed_null": true
482
464
  },
483
465
  {
484
- "default": "",
485
466
  "document": "集群隔离时间; 没隔离时间,则为 -\n注意:此字段可能返回 null,表示取不到有效值。",
486
467
  "example": "-",
487
468
  "member": "string",
@@ -491,7 +472,6 @@
491
472
  "value_allowed_null": true
492
473
  },
493
474
  {
494
- "default": "",
495
475
  "document": "集群过期时间; 没过期概念,则为 -\n注意:此字段可能返回 null,表示取不到有效值。",
496
476
  "example": "-",
497
477
  "member": "string",
@@ -501,7 +481,6 @@
501
481
  "value_allowed_null": true
502
482
  },
503
483
  {
504
- "default": "",
505
484
  "document": "距离过期还有多少秒; 没过期概念,则为 -\n注意:此字段可能返回 null,表示取不到有效值。",
506
485
  "example": "-",
507
486
  "member": "string",
@@ -511,7 +490,6 @@
511
490
  "value_allowed_null": true
512
491
  },
513
492
  {
514
- "default": "",
515
493
  "document": "自动续费标记,0 表示默认状态 (用户未设置,即初始状态,用户开通了预付费不停服特权会进行自动续费), 1 表示自动续费,2表示明确不自动续费(用户设置)\n注意:此字段可能返回 null,表示取不到有效值。",
516
494
  "example": "0",
517
495
  "member": "int64",
@@ -521,7 +499,6 @@
521
499
  "value_allowed_null": true
522
500
  },
523
501
  {
524
- "default": "",
525
502
  "document": "集群的默认 COS 存储桶\n注意:此字段可能返回 null,表示取不到有效值。",
526
503
  "example": "test-12314214",
527
504
  "member": "string",
@@ -531,7 +508,6 @@
531
508
  "value_allowed_null": true
532
509
  },
533
510
  {
534
- "default": "",
535
511
  "document": "集群的CLS 日志集 LogSet\n注意:此字段可能返回 null,表示取不到有效值。",
536
512
  "example": "xxxx-xx-xx-xxxx",
537
513
  "member": "string",
@@ -541,7 +517,6 @@
541
517
  "value_allowed_null": true
542
518
  },
543
519
  {
544
- "default": "",
545
520
  "document": "集群的CLS 日志主题 TopicId\n注意:此字段可能返回 null,表示取不到有效值。",
546
521
  "example": "xxxx-xx-xx-xxxx",
547
522
  "member": "string",
@@ -551,7 +526,6 @@
551
526
  "value_allowed_null": true
552
527
  },
553
528
  {
554
- "default": "",
555
529
  "document": "集群的CLS 日志集 名字\n注意:此字段可能返回 null,表示取不到有效值。",
556
530
  "example": "日志集名字",
557
531
  "member": "string",
@@ -561,7 +535,6 @@
561
535
  "value_allowed_null": true
562
536
  },
563
537
  {
564
- "default": "",
565
538
  "document": "集群的CLS 日志主题 名字\n注意:此字段可能返回 null,表示取不到有效值。",
566
539
  "example": "日志主题名字",
567
540
  "member": "string",
@@ -571,7 +544,6 @@
571
544
  "value_allowed_null": true
572
545
  },
573
546
  {
574
- "default": "",
575
547
  "document": "集群的版本信息\n注意:此字段可能返回 null,表示取不到有效值。",
576
548
  "example": "[]",
577
549
  "member": "ClusterVersion",
@@ -581,7 +553,6 @@
581
553
  "value_allowed_null": true
582
554
  },
583
555
  {
584
- "default": "",
585
556
  "document": "细粒度资源下的空闲CU\n注意:此字段可能返回 null,表示取不到有效值。",
586
557
  "example": "0.5",
587
558
  "member": "float",
@@ -591,7 +562,6 @@
591
562
  "value_allowed_null": true
592
563
  },
593
564
  {
594
- "default": "",
595
565
  "document": "集群的默认日志采集配置\n注意:此字段可能返回 null,表示取不到有效值。",
596
566
  "example": "xxx",
597
567
  "member": "string",
@@ -601,7 +571,6 @@
601
571
  "value_allowed_null": true
602
572
  },
603
573
  {
604
- "default": "",
605
574
  "document": "取值:0-没有设置,1-已设置,2-不允许设置\n注意:此字段可能返回 null,表示取不到有效值。",
606
575
  "example": "0",
607
576
  "member": "int64",
@@ -611,7 +580,6 @@
611
580
  "value_allowed_null": true
612
581
  },
613
582
  {
614
- "default": "",
615
583
  "document": "空间信息\n注意:此字段可能返回 null,表示取不到有效值。",
616
584
  "example": "[]",
617
585
  "member": "WorkSpaceClusterItem",
@@ -621,7 +589,6 @@
621
589
  "value_allowed_null": true
622
590
  },
623
591
  {
624
- "default": "",
625
592
  "document": "运行CU\n注意:此字段可能返回 null,表示取不到有效值。",
626
593
  "example": "0.5",
627
594
  "member": "float",
@@ -631,7 +598,6 @@
631
598
  "value_allowed_null": true
632
599
  },
633
600
  {
634
- "default": "",
635
601
  "document": "0 后付费,1 预付费\n注意:此字段可能返回 null,表示取不到有效值。",
636
602
  "example": "1",
637
603
  "member": "int64",
@@ -641,7 +607,6 @@
641
607
  "value_allowed_null": true
642
608
  },
643
609
  {
644
- "default": "",
645
610
  "document": "前端区分 集群是否需要2CU逻辑 因为历史集群 变配不需要, default 1 新集群都需要\n注意:此字段可能返回 null,表示取不到有效值。",
646
611
  "example": "0 / 1",
647
612
  "member": "int64",
@@ -649,10 +614,24 @@
649
614
  "required": true,
650
615
  "type": "int",
651
616
  "value_allowed_null": true
617
+ },
618
+ {
619
+ "document": "session集群信息\n注意:此字段可能返回 null,表示取不到有效值。",
620
+ "example": "无",
621
+ "member": "ClusterSession",
622
+ "name": "ClusterSessions",
623
+ "required": false,
624
+ "type": "list",
625
+ "value_allowed_null": true
652
626
  }
653
627
  ],
654
628
  "usage": "out"
655
629
  },
630
+ "ClusterSession": {
631
+ "document": "session集群信息",
632
+ "members": [],
633
+ "usage": "out"
634
+ },
656
635
  "ClusterVersion": {
657
636
  "document": "集群的版本相关信息",
658
637
  "members": [
@@ -3104,8 +3083,8 @@
3104
3083
  "document": "系统配置属性",
3105
3084
  "members": [
3106
3085
  {
3107
- "default": "",
3108
3086
  "document": "系统配置的Key",
3087
+ "example": "无",
3109
3088
  "member": "string",
3110
3089
  "name": "Key",
3111
3090
  "required": true,
@@ -3113,8 +3092,8 @@
3113
3092
  "value_allowed_null": false
3114
3093
  },
3115
3094
  {
3116
- "default": "",
3117
3095
  "document": "系统配置的Value",
3096
+ "example": "无",
3118
3097
  "member": "string",
3119
3098
  "name": "Value",
3120
3099
  "required": true,
@@ -3122,7 +3101,7 @@
3122
3101
  "value_allowed_null": false
3123
3102
  }
3124
3103
  ],
3125
- "usage": "in"
3104
+ "usage": "both"
3126
3105
  },
3127
3106
  "RefJobStatusCountItem": {
3128
3107
  "document": "依赖作业分状态计数信息",
@@ -4156,7 +4135,6 @@
4156
4135
  "document": "空间和集群绑定关系",
4157
4136
  "members": [
4158
4137
  {
4159
- "default": "",
4160
4138
  "document": "集群 ID",
4161
4139
  "example": "1234",
4162
4140
  "member": "int64",
@@ -4166,7 +4144,6 @@
4166
4144
  "value_allowed_null": false
4167
4145
  },
4168
4146
  {
4169
- "default": "",
4170
4147
  "document": "集群 SerialId",
4171
4148
  "example": "cluster-xxxx",
4172
4149
  "member": "string",
@@ -4176,7 +4153,6 @@
4176
4153
  "value_allowed_null": false
4177
4154
  },
4178
4155
  {
4179
- "default": "",
4180
4156
  "document": "集群名称",
4181
4157
  "example": "MyCluster",
4182
4158
  "member": "string",
@@ -4186,7 +4162,6 @@
4186
4162
  "value_allowed_null": false
4187
4163
  },
4188
4164
  {
4189
- "default": "",
4190
4165
  "document": "工作空间 SerialId",
4191
4166
  "example": "spc-xxx",
4192
4167
  "member": "string",
@@ -4196,7 +4171,6 @@
4196
4171
  "value_allowed_null": false
4197
4172
  },
4198
4173
  {
4199
- "default": "",
4200
4174
  "document": "工作空间名称",
4201
4175
  "example": "Myspace",
4202
4176
  "member": "string",
@@ -4206,7 +4180,6 @@
4206
4180
  "value_allowed_null": false
4207
4181
  },
4208
4182
  {
4209
- "default": "",
4210
4183
  "document": "绑定状态 2 绑定 1 解除绑定",
4211
4184
  "example": "1",
4212
4185
  "member": "int64",
@@ -4216,7 +4189,6 @@
4216
4189
  "value_allowed_null": false
4217
4190
  },
4218
4191
  {
4219
- "default": "",
4220
4192
  "document": "项目ID",
4221
4193
  "example": "1",
4222
4194
  "member": "int64",
@@ -4226,7 +4198,6 @@
4226
4198
  "value_allowed_null": false
4227
4199
  },
4228
4200
  {
4229
- "default": "",
4230
4201
  "document": "项目ID string类型\n注意:此字段可能返回 null,表示取不到有效值。",
4231
4202
  "example": "1",
4232
4203
  "member": "string",
@@ -17,7 +17,7 @@ from tencentcloud.omics.v20221128 import models as models_v20221128
17
17
  from jmespath import search
18
18
  import time
19
19
 
20
- def doGetRunCalls(args, parsed_globals):
20
+ def doDescribeRuns(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,63 @@ def doGetRunCalls(args, parsed_globals):
46
46
  client = mod.OmicsClient(cred, g_param[OptionsDefine.Region], profile)
47
47
  client._sdkVersion += ("_CLI_" + __version__)
48
48
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
49
- model = models.GetRunCallsRequest()
49
+ model = models.DescribeRunsRequest()
50
50
  model.from_json_string(json.dumps(args))
51
51
  start_time = time.time()
52
52
  while True:
53
- rsp = client.GetRunCalls(model)
53
+ rsp = client.DescribeRuns(model)
54
+ result = rsp.to_json_string()
55
+ try:
56
+ json_obj = json.loads(result)
57
+ except TypeError as e:
58
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
59
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
60
+ break
61
+ cur_time = time.time()
62
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
63
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
64
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
65
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
66
+ else:
67
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
68
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
69
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
70
+
71
+
72
+ def doDescribeTablesRows(args, parsed_globals):
73
+ g_param = parse_global_arg(parsed_globals)
74
+
75
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
76
+ cred = credential.CVMRoleCredential()
77
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
78
+ cred = credential.STSAssumeRoleCredential(
79
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
80
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
81
+ )
82
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
83
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
84
+ else:
85
+ cred = credential.Credential(
86
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
87
+ )
88
+ http_profile = HttpProfile(
89
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
90
+ reqMethod="POST",
91
+ endpoint=g_param[OptionsDefine.Endpoint],
92
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
93
+ )
94
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
95
+ if g_param[OptionsDefine.Language]:
96
+ profile.language = g_param[OptionsDefine.Language]
97
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
98
+ client = mod.OmicsClient(cred, g_param[OptionsDefine.Region], profile)
99
+ client._sdkVersion += ("_CLI_" + __version__)
100
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
101
+ model = models.DescribeTablesRowsRequest()
102
+ model.from_json_string(json.dumps(args))
103
+ start_time = time.time()
104
+ while True:
105
+ rsp = client.DescribeTablesRows(model)
54
106
  result = rsp.to_json_string()
55
107
  try:
56
108
  json_obj = json.loads(result)
@@ -173,6 +225,58 @@ def doImportTableFile(args, parsed_globals):
173
225
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
174
226
 
175
227
 
228
+ def doGetRunCalls(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('-', '_')]
237
+ )
238
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_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.OmicsClient(cred, g_param[OptionsDefine.Region], profile)
255
+ client._sdkVersion += ("_CLI_" + __version__)
256
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
257
+ model = models.GetRunCallsRequest()
258
+ model.from_json_string(json.dumps(args))
259
+ start_time = time.time()
260
+ while True:
261
+ rsp = client.GetRunCalls(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
+
176
280
  def doCreateEnvironment(args, parsed_globals):
177
281
  g_param = parse_global_arg(parsed_globals)
178
282
 
@@ -225,7 +329,7 @@ def doCreateEnvironment(args, parsed_globals):
225
329
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
226
330
 
227
331
 
228
- def doRunApplication(args, parsed_globals):
332
+ def doRetryRuns(args, parsed_globals):
229
333
  g_param = parse_global_arg(parsed_globals)
230
334
 
231
335
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -254,11 +358,11 @@ def doRunApplication(args, parsed_globals):
254
358
  client = mod.OmicsClient(cred, g_param[OptionsDefine.Region], profile)
255
359
  client._sdkVersion += ("_CLI_" + __version__)
256
360
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
257
- model = models.RunApplicationRequest()
361
+ model = models.RetryRunsRequest()
258
362
  model.from_json_string(json.dumps(args))
259
363
  start_time = time.time()
260
364
  while True:
261
- rsp = client.RunApplication(model)
365
+ rsp = client.RetryRuns(model)
262
366
  result = rsp.to_json_string()
263
367
  try:
264
368
  json_obj = json.loads(result)
@@ -277,7 +381,7 @@ def doRunApplication(args, parsed_globals):
277
381
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
278
382
 
279
383
 
280
- def doDescribeRuns(args, parsed_globals):
384
+ def doRunApplication(args, parsed_globals):
281
385
  g_param = parse_global_arg(parsed_globals)
282
386
 
283
387
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -306,11 +410,11 @@ def doDescribeRuns(args, parsed_globals):
306
410
  client = mod.OmicsClient(cred, g_param[OptionsDefine.Region], profile)
307
411
  client._sdkVersion += ("_CLI_" + __version__)
308
412
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
309
- model = models.DescribeRunsRequest()
413
+ model = models.RunApplicationRequest()
310
414
  model.from_json_string(json.dumps(args))
311
415
  start_time = time.time()
312
416
  while True:
313
- rsp = client.DescribeRuns(model)
417
+ rsp = client.RunApplication(model)
314
418
  result = rsp.to_json_string()
315
419
  try:
316
420
  json_obj = json.loads(result)
@@ -433,6 +537,58 @@ def doDeleteEnvironment(args, parsed_globals):
433
537
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
434
538
 
435
539
 
540
+ def doDescribeTables(args, parsed_globals):
541
+ g_param = parse_global_arg(parsed_globals)
542
+
543
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
544
+ cred = credential.CVMRoleCredential()
545
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
546
+ cred = credential.STSAssumeRoleCredential(
547
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
548
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
549
+ )
550
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
551
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
552
+ else:
553
+ cred = credential.Credential(
554
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
555
+ )
556
+ http_profile = HttpProfile(
557
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
558
+ reqMethod="POST",
559
+ endpoint=g_param[OptionsDefine.Endpoint],
560
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
561
+ )
562
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
563
+ if g_param[OptionsDefine.Language]:
564
+ profile.language = g_param[OptionsDefine.Language]
565
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
566
+ client = mod.OmicsClient(cred, g_param[OptionsDefine.Region], profile)
567
+ client._sdkVersion += ("_CLI_" + __version__)
568
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
569
+ model = models.DescribeTablesRequest()
570
+ model.from_json_string(json.dumps(args))
571
+ start_time = time.time()
572
+ while True:
573
+ rsp = client.DescribeTables(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
+
436
592
  def doGetRunStatus(args, parsed_globals):
437
593
  g_param = parse_global_arg(parsed_globals)
438
594
 
@@ -496,14 +652,17 @@ MODELS_MAP = {
496
652
  }
497
653
 
498
654
  ACTION_MAP = {
499
- "GetRunCalls": doGetRunCalls,
655
+ "DescribeRuns": doDescribeRuns,
656
+ "DescribeTablesRows": doDescribeTablesRows,
500
657
  "DescribeEnvironments": doDescribeEnvironments,
501
658
  "ImportTableFile": doImportTableFile,
659
+ "GetRunCalls": doGetRunCalls,
502
660
  "CreateEnvironment": doCreateEnvironment,
661
+ "RetryRuns": doRetryRuns,
503
662
  "RunApplication": doRunApplication,
504
- "DescribeRuns": doDescribeRuns,
505
663
  "DescribeRunGroups": doDescribeRunGroups,
506
664
  "DeleteEnvironment": doDeleteEnvironment,
665
+ "DescribeTables": doDescribeTables,
507
666
  "GetRunStatus": doGetRunStatus,
508
667
 
509
668
  }