tccli 3.0.1064.1__py2.py3-none-any.whl → 3.0.1067.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 (83) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/examples/ccc/v20200210/AbortPredictiveDialingCampaign.md +21 -0
  3. tccli/examples/ccc/v20200210/CreatePredictiveDialingCampaign.md +33 -0
  4. tccli/examples/ccc/v20200210/DeletePredictiveDialingCampaign.md +21 -0
  5. tccli/examples/ccc/v20200210/DescribePredictiveDialingCampaign.md +32 -0
  6. tccli/examples/ccc/v20200210/DescribePredictiveDialingCampaigns.md +55 -0
  7. tccli/examples/ccc/v20200210/DescribePredictiveDialingSessions.md +29 -0
  8. tccli/examples/ccc/v20200210/PausePredictiveDialingCampaign.md +21 -0
  9. tccli/examples/ccc/v20200210/ResumePredictiveDialingCampaign.md +21 -0
  10. tccli/examples/ccc/v20200210/UpdatePredictiveDialingCampaign.md +33 -0
  11. tccli/examples/cfw/v20190904/CreateBlockIgnoreRuleNew.md +25 -0
  12. tccli/examples/cfw/v20190904/DeleteBlockIgnoreRuleNew.md +23 -0
  13. tccli/examples/cfw/v20190904/ModifyBlockIgnoreRuleNew.md +24 -0
  14. tccli/examples/cls/v20201016/DescribeConfigMachineGroups.md +1 -0
  15. tccli/examples/cls/v20201016/DescribeMachineGroups.md +1 -0
  16. tccli/examples/csip/v20221121/DescribeTopAttackInfo.md +26 -0
  17. tccli/examples/ecm/v20190719/ModifyPrivateIpAddressesAttribute.md +1 -1
  18. tccli/examples/mna/v20210119/AddDevice.md +1 -1
  19. tccli/examples/mna/v20210119/GetMultiFlowStatistic.md +7 -1
  20. tccli/examples/mna/v20210119/GetNetMonitor.md +7 -49
  21. tccli/examples/mna/v20210119/GetStatisticData.md +5 -3
  22. tccli/examples/omics/v20221128/CreateVolume.md +25 -0
  23. tccli/examples/omics/v20221128/DeleteVolume.md +20 -0
  24. tccli/examples/omics/v20221128/DeleteVolumeData.md +21 -0
  25. tccli/examples/omics/v20221128/DescribeVolumes.md +37 -0
  26. tccli/examples/omics/v20221128/ModifyVolume.md +21 -0
  27. tccli/examples/postgres/v20170312/ModifyDBInstanceSpec.md +1 -0
  28. tccli/examples/tse/v20201207/CreateGovernanceInstances.md +32 -0
  29. tccli/examples/tse/v20201207/DeleteGovernanceInstances.md +35 -0
  30. tccli/examples/tse/v20201207/DescribeGovernanceInstances.md +56 -0
  31. tccli/examples/tse/v20201207/ModifyGovernanceInstances.md +35 -0
  32. tccli/examples/vod/v20180717/CreateDomainVerifyRecord.md +3 -1
  33. tccli/examples/vod/v20180717/DescribeDefaultDistributionConfig.md +22 -0
  34. tccli/examples/vod/v20180717/ModifyDefaultDistributionConfig.md +21 -0
  35. tccli/examples/waf/v20180125/CreateDeals.md +42 -0
  36. tccli/examples/wedata/v20210820/BatchStartIntegrationTasks.md +10 -7
  37. tccli/examples/wedata/v20210820/BatchStopIntegrationTasks.md +37 -6
  38. tccli/services/ccc/ccc_client.py +493 -16
  39. tccli/services/ccc/v20200210/api.json +927 -42
  40. tccli/services/ccc/v20200210/examples.json +72 -0
  41. tccli/services/cdb/v20170320/api.json +1 -1
  42. tccli/services/cfw/cfw_client.py +171 -12
  43. tccli/services/cfw/v20190904/api.json +258 -2
  44. tccli/services/cfw/v20190904/examples.json +24 -0
  45. tccli/services/ckafka/v20190819/api.json +17 -17
  46. tccli/services/cls/v20201016/api.json +45 -17
  47. tccli/services/cls/v20201016/examples.json +2 -2
  48. tccli/services/csip/csip_client.py +57 -4
  49. tccli/services/csip/v20221121/api.json +70 -0
  50. tccli/services/csip/v20221121/examples.json +8 -0
  51. tccli/services/cynosdb/v20190107/api.json +3 -3
  52. tccli/services/ecm/v20190719/api.json +3 -3
  53. tccli/services/ecm/v20190719/examples.json +1 -1
  54. tccli/services/ess/v20201111/api.json +3 -3
  55. tccli/services/essbasic/v20210526/api.json +5 -5
  56. tccli/services/iotvideo/v20211125/api.json +1 -1
  57. tccli/services/lighthouse/v20200324/api.json +1 -1
  58. tccli/services/mna/v20210119/api.json +144 -9
  59. tccli/services/mna/v20210119/examples.json +6 -6
  60. tccli/services/monitor/v20180724/api.json +20 -0
  61. tccli/services/omics/omics_client.py +277 -12
  62. tccli/services/omics/v20221128/api.json +425 -0
  63. tccli/services/omics/v20221128/examples.json +40 -0
  64. tccli/services/postgres/v20170312/api.json +27 -0
  65. tccli/services/postgres/v20170312/examples.json +1 -1
  66. tccli/services/trp/v20210515/api.json +18 -0
  67. tccli/services/trtc/v20190722/api.json +10 -1
  68. tccli/services/tse/tse_client.py +220 -8
  69. tccli/services/tse/v20201207/api.json +779 -42
  70. tccli/services/tse/v20201207/examples.json +32 -0
  71. tccli/services/vod/v20180717/api.json +146 -1
  72. tccli/services/vod/v20180717/examples.json +17 -1
  73. tccli/services/vod/vod_client.py +106 -0
  74. tccli/services/waf/v20180125/api.json +256 -1
  75. tccli/services/waf/v20180125/examples.json +8 -0
  76. tccli/services/waf/waf_client.py +57 -4
  77. tccli/services/wedata/v20210820/api.json +140 -15
  78. tccli/services/wedata/v20210820/examples.json +10 -4
  79. {tccli-3.0.1064.1.dist-info → tccli-3.0.1067.1.dist-info}/METADATA +2 -2
  80. {tccli-3.0.1064.1.dist-info → tccli-3.0.1067.1.dist-info}/RECORD +83 -58
  81. {tccli-3.0.1064.1.dist-info → tccli-3.0.1067.1.dist-info}/WHEEL +0 -0
  82. {tccli-3.0.1064.1.dist-info → tccli-3.0.1067.1.dist-info}/entry_points.txt +0 -0
  83. {tccli-3.0.1064.1.dist-info → tccli-3.0.1067.1.dist-info}/license_files/LICENSE +0 -0
@@ -69,7 +69,7 @@ def doDescribeRuns(args, parsed_globals):
69
69
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
70
70
 
71
71
 
72
- def doGetRunStatus(args, parsed_globals):
72
+ def doDeleteVolume(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,115 @@ def doGetRunStatus(args, parsed_globals):
98
98
  client = mod.OmicsClient(cred, g_param[OptionsDefine.Region], profile)
99
99
  client._sdkVersion += ("_CLI_" + __version__)
100
100
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
101
- model = models.GetRunStatusRequest()
101
+ model = models.DeleteVolumeRequest()
102
102
  model.from_json_string(json.dumps(args))
103
103
  start_time = time.time()
104
104
  while True:
105
- rsp = client.GetRunStatus(model)
105
+ rsp = client.DeleteVolume(model)
106
+ result = rsp.to_json_string()
107
+ try:
108
+ json_obj = json.loads(result)
109
+ except TypeError as e:
110
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
111
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
112
+ break
113
+ cur_time = time.time()
114
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
115
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
116
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
117
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
118
+ else:
119
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
120
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
121
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
122
+
123
+
124
+ def doDescribeTablesRows(args, parsed_globals):
125
+ g_param = parse_global_arg(parsed_globals)
126
+
127
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
128
+ cred = credential.CVMRoleCredential()
129
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
130
+ cred = credential.STSAssumeRoleCredential(
131
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
132
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
133
+ )
134
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
135
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
136
+ else:
137
+ cred = credential.Credential(
138
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
139
+ )
140
+ http_profile = HttpProfile(
141
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
142
+ reqMethod="POST",
143
+ endpoint=g_param[OptionsDefine.Endpoint],
144
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
145
+ )
146
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
147
+ if g_param[OptionsDefine.Language]:
148
+ profile.language = g_param[OptionsDefine.Language]
149
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
150
+ client = mod.OmicsClient(cred, g_param[OptionsDefine.Region], profile)
151
+ client._sdkVersion += ("_CLI_" + __version__)
152
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
153
+ model = models.DescribeTablesRowsRequest()
154
+ model.from_json_string(json.dumps(args))
155
+ start_time = time.time()
156
+ while True:
157
+ rsp = client.DescribeTablesRows(model)
158
+ result = rsp.to_json_string()
159
+ try:
160
+ json_obj = json.loads(result)
161
+ except TypeError as e:
162
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
163
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
164
+ break
165
+ cur_time = time.time()
166
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
167
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
168
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
169
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
170
+ else:
171
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
172
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
173
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
174
+
175
+
176
+ def doDeleteVolumeData(args, parsed_globals):
177
+ g_param = parse_global_arg(parsed_globals)
178
+
179
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
180
+ cred = credential.CVMRoleCredential()
181
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
182
+ cred = credential.STSAssumeRoleCredential(
183
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
184
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
185
+ )
186
+ 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):
187
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
188
+ else:
189
+ cred = credential.Credential(
190
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
191
+ )
192
+ http_profile = HttpProfile(
193
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
194
+ reqMethod="POST",
195
+ endpoint=g_param[OptionsDefine.Endpoint],
196
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
197
+ )
198
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
199
+ if g_param[OptionsDefine.Language]:
200
+ profile.language = g_param[OptionsDefine.Language]
201
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
202
+ client = mod.OmicsClient(cred, g_param[OptionsDefine.Region], profile)
203
+ client._sdkVersion += ("_CLI_" + __version__)
204
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
205
+ model = models.DeleteVolumeDataRequest()
206
+ model.from_json_string(json.dumps(args))
207
+ start_time = time.time()
208
+ while True:
209
+ rsp = client.DeleteVolumeData(model)
106
210
  result = rsp.to_json_string()
107
211
  try:
108
212
  json_obj = json.loads(result)
@@ -225,7 +329,7 @@ def doGetRunMetadataFile(args, parsed_globals):
225
329
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
226
330
 
227
331
 
228
- def doGetRunCalls(args, parsed_globals):
332
+ def doCreateVolume(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 doGetRunCalls(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.GetRunCallsRequest()
361
+ model = models.CreateVolumeRequest()
258
362
  model.from_json_string(json.dumps(args))
259
363
  start_time = time.time()
260
364
  while True:
261
- rsp = client.GetRunCalls(model)
365
+ rsp = client.CreateVolume(model)
262
366
  result = rsp.to_json_string()
263
367
  try:
264
368
  json_obj = json.loads(result)
@@ -329,6 +433,58 @@ def doImportTableFile(args, parsed_globals):
329
433
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
330
434
 
331
435
 
436
+ def doGetRunStatus(args, parsed_globals):
437
+ g_param = parse_global_arg(parsed_globals)
438
+
439
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
440
+ cred = credential.CVMRoleCredential()
441
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
442
+ cred = credential.STSAssumeRoleCredential(
443
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
444
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
445
+ )
446
+ 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):
447
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
448
+ else:
449
+ cred = credential.Credential(
450
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
451
+ )
452
+ http_profile = HttpProfile(
453
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
454
+ reqMethod="POST",
455
+ endpoint=g_param[OptionsDefine.Endpoint],
456
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
457
+ )
458
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
459
+ if g_param[OptionsDefine.Language]:
460
+ profile.language = g_param[OptionsDefine.Language]
461
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
462
+ client = mod.OmicsClient(cred, g_param[OptionsDefine.Region], profile)
463
+ client._sdkVersion += ("_CLI_" + __version__)
464
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
465
+ model = models.GetRunStatusRequest()
466
+ model.from_json_string(json.dumps(args))
467
+ start_time = time.time()
468
+ while True:
469
+ rsp = client.GetRunStatus(model)
470
+ result = rsp.to_json_string()
471
+ try:
472
+ json_obj = json.loads(result)
473
+ except TypeError as e:
474
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
475
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
476
+ break
477
+ cur_time = time.time()
478
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
479
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
480
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
481
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
482
+ else:
483
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
484
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
485
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
486
+
487
+
332
488
  def doRunWorkflow(args, parsed_globals):
333
489
  g_param = parse_global_arg(parsed_globals)
334
490
 
@@ -381,6 +537,58 @@ def doRunWorkflow(args, parsed_globals):
381
537
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
382
538
 
383
539
 
540
+ def doGetRunCalls(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('-', '_')], endpoint=g_param["sts_cred_endpoint"]
549
+ )
550
+ 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):
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.GetRunCallsRequest()
570
+ model.from_json_string(json.dumps(args))
571
+ start_time = time.time()
572
+ while True:
573
+ rsp = client.GetRunCalls(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
+
384
592
  def doCreateEnvironment(args, parsed_globals):
385
593
  g_param = parse_global_arg(parsed_globals)
386
594
 
@@ -641,6 +849,58 @@ def doDescribeRunGroups(args, parsed_globals):
641
849
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
642
850
 
643
851
 
852
+ def doModifyVolume(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.OmicsClient(cred, g_param[OptionsDefine.Region], profile)
879
+ client._sdkVersion += ("_CLI_" + __version__)
880
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
881
+ model = models.ModifyVolumeRequest()
882
+ model.from_json_string(json.dumps(args))
883
+ start_time = time.time()
884
+ while True:
885
+ rsp = client.ModifyVolume(model)
886
+ result = rsp.to_json_string()
887
+ try:
888
+ json_obj = json.loads(result)
889
+ except TypeError as e:
890
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
891
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
892
+ break
893
+ cur_time = time.time()
894
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
895
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
896
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
897
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
898
+ else:
899
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
900
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
901
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
902
+
903
+
644
904
  def doDeleteEnvironment(args, parsed_globals):
645
905
  g_param = parse_global_arg(parsed_globals)
646
906
 
@@ -745,7 +1005,7 @@ def doDescribeTables(args, parsed_globals):
745
1005
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
746
1006
 
747
1007
 
748
- def doDescribeTablesRows(args, parsed_globals):
1008
+ def doDescribeVolumes(args, parsed_globals):
749
1009
  g_param = parse_global_arg(parsed_globals)
750
1010
 
751
1011
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -774,11 +1034,11 @@ def doDescribeTablesRows(args, parsed_globals):
774
1034
  client = mod.OmicsClient(cred, g_param[OptionsDefine.Region], profile)
775
1035
  client._sdkVersion += ("_CLI_" + __version__)
776
1036
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
777
- model = models.DescribeTablesRowsRequest()
1037
+ model = models.DescribeVolumesRequest()
778
1038
  model.from_json_string(json.dumps(args))
779
1039
  start_time = time.time()
780
1040
  while True:
781
- rsp = client.DescribeTablesRows(model)
1041
+ rsp = client.DescribeVolumes(model)
782
1042
  result = rsp.to_json_string()
783
1043
  try:
784
1044
  json_obj = json.loads(result)
@@ -809,20 +1069,25 @@ MODELS_MAP = {
809
1069
 
810
1070
  ACTION_MAP = {
811
1071
  "DescribeRuns": doDescribeRuns,
812
- "GetRunStatus": doGetRunStatus,
1072
+ "DeleteVolume": doDeleteVolume,
1073
+ "DescribeTablesRows": doDescribeTablesRows,
1074
+ "DeleteVolumeData": doDeleteVolumeData,
813
1075
  "DescribeEnvironments": doDescribeEnvironments,
814
1076
  "GetRunMetadataFile": doGetRunMetadataFile,
815
- "GetRunCalls": doGetRunCalls,
1077
+ "CreateVolume": doCreateVolume,
816
1078
  "ImportTableFile": doImportTableFile,
1079
+ "GetRunStatus": doGetRunStatus,
817
1080
  "RunWorkflow": doRunWorkflow,
1081
+ "GetRunCalls": doGetRunCalls,
818
1082
  "CreateEnvironment": doCreateEnvironment,
819
1083
  "RetryRuns": doRetryRuns,
820
1084
  "TerminateRunGroup": doTerminateRunGroup,
821
1085
  "RunApplication": doRunApplication,
822
1086
  "DescribeRunGroups": doDescribeRunGroups,
1087
+ "ModifyVolume": doModifyVolume,
823
1088
  "DeleteEnvironment": doDeleteEnvironment,
824
1089
  "DescribeTables": doDescribeTables,
825
- "DescribeTablesRows": doDescribeTablesRows,
1090
+ "DescribeVolumes": doDescribeVolumes,
826
1091
 
827
1092
  }
828
1093