tccli 3.0.830.1__py2.py3-none-any.whl → 3.0.832.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/services/__init__.py +3 -0
- tccli/services/asr/v20190614/api.json +4 -4
- tccli/services/bma/v20221115/api.json +9 -0
- tccli/services/bma/v20221115/examples.json +2 -2
- tccli/services/ccc/v20200210/api.json +9 -0
- tccli/services/ccc/v20200210/examples.json +2 -2
- tccli/services/cdc/v20201214/examples.json +1 -1
- tccli/services/ckafka/v20190819/api.json +1 -20
- tccli/services/ckafka/v20190819/examples.json +1 -1
- tccli/services/cwp/cwp_client.py +2179 -642
- tccli/services/cwp/v20180228/api.json +3069 -479
- tccli/services/cwp/v20180228/examples.json +247 -3
- tccli/services/dlc/dlc_client.py +341 -23
- tccli/services/dlc/v20210125/api.json +505 -0
- tccli/services/dlc/v20210125/examples.json +48 -0
- tccli/services/ess/ess_client.py +163 -4
- tccli/services/ess/v20201111/api.json +304 -0
- tccli/services/ess/v20201111/examples.json +24 -0
- tccli/services/essbasic/v20210526/api.json +68 -150
- tccli/services/essbasic/v20210526/examples.json +17 -17
- tccli/services/gme/gme_client.py +277 -12
- tccli/services/gme/v20180711/api.json +386 -0
- tccli/services/gme/v20180711/examples.json +40 -0
- tccli/services/intlpartnersmgt/__init__.py +4 -0
- tccli/services/intlpartnersmgt/intlpartnersmgt_client.py +724 -0
- tccli/services/intlpartnersmgt/v20220928/api.json +1054 -0
- tccli/services/intlpartnersmgt/v20220928/examples.json +93 -0
- tccli/services/live/v20180801/api.json +10 -10
- tccli/services/live/v20180801/examples.json +3 -3
- tccli/services/tdmq/v20200217/api.json +23 -44
- tccli/services/tdmq/v20200217/examples.json +3 -3
- tccli/services/trtc/v20190722/api.json +2 -2
- tccli/services/tse/v20201207/api.json +42 -1
- {tccli-3.0.830.1.dist-info → tccli-3.0.832.1.dist-info}/METADATA +2 -2
- {tccli-3.0.830.1.dist-info → tccli-3.0.832.1.dist-info}/RECORD +40 -36
- {tccli-3.0.830.1.dist-info → tccli-3.0.832.1.dist-info}/LICENSE +0 -0
- {tccli-3.0.830.1.dist-info → tccli-3.0.832.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.830.1.dist-info → tccli-3.0.832.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.830.1.dist-info → tccli-3.0.832.1.dist-info}/top_level.txt +0 -0
tccli/services/dlc/dlc_client.py
CHANGED
@@ -121,6 +121,58 @@ def doCreateTask(args, parsed_globals):
|
|
121
121
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
122
|
|
123
123
|
|
124
|
+
def doCreateNotebookSessionStatement(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('-', '_')]
|
133
|
+
)
|
134
|
+
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):
|
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.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
151
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
152
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
+
model = models.CreateNotebookSessionStatementRequest()
|
154
|
+
model.from_json_string(json.dumps(args))
|
155
|
+
start_time = time.time()
|
156
|
+
while True:
|
157
|
+
rsp = client.CreateNotebookSessionStatement(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
|
+
|
124
176
|
def doDeleteNotebookSession(args, parsed_globals):
|
125
177
|
g_param = parse_global_arg(parsed_globals)
|
126
178
|
|
@@ -1629,6 +1681,58 @@ def doDescribeNotebookSessionLog(args, parsed_globals):
|
|
1629
1681
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1630
1682
|
|
1631
1683
|
|
1684
|
+
def doSwitchDataEngine(args, parsed_globals):
|
1685
|
+
g_param = parse_global_arg(parsed_globals)
|
1686
|
+
|
1687
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1688
|
+
cred = credential.CVMRoleCredential()
|
1689
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1690
|
+
cred = credential.STSAssumeRoleCredential(
|
1691
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1692
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
|
1693
|
+
)
|
1694
|
+
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):
|
1695
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1696
|
+
else:
|
1697
|
+
cred = credential.Credential(
|
1698
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1699
|
+
)
|
1700
|
+
http_profile = HttpProfile(
|
1701
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1702
|
+
reqMethod="POST",
|
1703
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1704
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1705
|
+
)
|
1706
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1707
|
+
if g_param[OptionsDefine.Language]:
|
1708
|
+
profile.language = g_param[OptionsDefine.Language]
|
1709
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1710
|
+
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
1711
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1712
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1713
|
+
model = models.SwitchDataEngineRequest()
|
1714
|
+
model.from_json_string(json.dumps(args))
|
1715
|
+
start_time = time.time()
|
1716
|
+
while True:
|
1717
|
+
rsp = client.SwitchDataEngine(model)
|
1718
|
+
result = rsp.to_json_string()
|
1719
|
+
try:
|
1720
|
+
json_obj = json.loads(result)
|
1721
|
+
except TypeError as e:
|
1722
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1723
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1724
|
+
break
|
1725
|
+
cur_time = time.time()
|
1726
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1727
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1728
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1729
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1730
|
+
else:
|
1731
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1732
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1733
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1734
|
+
|
1735
|
+
|
1632
1736
|
def doDescribeDataEngines(args, parsed_globals):
|
1633
1737
|
g_param = parse_global_arg(parsed_globals)
|
1634
1738
|
|
@@ -2201,6 +2305,58 @@ def doCreateScript(args, parsed_globals):
|
|
2201
2305
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2202
2306
|
|
2203
2307
|
|
2308
|
+
def doUpdateRowFilter(args, parsed_globals):
|
2309
|
+
g_param = parse_global_arg(parsed_globals)
|
2310
|
+
|
2311
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2312
|
+
cred = credential.CVMRoleCredential()
|
2313
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2314
|
+
cred = credential.STSAssumeRoleCredential(
|
2315
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2316
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
|
2317
|
+
)
|
2318
|
+
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):
|
2319
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2320
|
+
else:
|
2321
|
+
cred = credential.Credential(
|
2322
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2323
|
+
)
|
2324
|
+
http_profile = HttpProfile(
|
2325
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2326
|
+
reqMethod="POST",
|
2327
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2328
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2329
|
+
)
|
2330
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2331
|
+
if g_param[OptionsDefine.Language]:
|
2332
|
+
profile.language = g_param[OptionsDefine.Language]
|
2333
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2334
|
+
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2335
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2336
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2337
|
+
model = models.UpdateRowFilterRequest()
|
2338
|
+
model.from_json_string(json.dumps(args))
|
2339
|
+
start_time = time.time()
|
2340
|
+
while True:
|
2341
|
+
rsp = client.UpdateRowFilter(model)
|
2342
|
+
result = rsp.to_json_string()
|
2343
|
+
try:
|
2344
|
+
json_obj = json.loads(result)
|
2345
|
+
except TypeError as e:
|
2346
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2347
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2348
|
+
break
|
2349
|
+
cur_time = time.time()
|
2350
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2351
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2352
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2353
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2354
|
+
else:
|
2355
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2356
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2357
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2358
|
+
|
2359
|
+
|
2204
2360
|
def doDescribeDMSTables(args, parsed_globals):
|
2205
2361
|
g_param = parse_global_arg(parsed_globals)
|
2206
2362
|
|
@@ -2461,6 +2617,58 @@ def doModifyWorkGroup(args, parsed_globals):
|
|
2461
2617
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2462
2618
|
|
2463
2619
|
|
2620
|
+
def doDescribeLakeFsInfo(args, parsed_globals):
|
2621
|
+
g_param = parse_global_arg(parsed_globals)
|
2622
|
+
|
2623
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2624
|
+
cred = credential.CVMRoleCredential()
|
2625
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2626
|
+
cred = credential.STSAssumeRoleCredential(
|
2627
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2628
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
|
2629
|
+
)
|
2630
|
+
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):
|
2631
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2632
|
+
else:
|
2633
|
+
cred = credential.Credential(
|
2634
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2635
|
+
)
|
2636
|
+
http_profile = HttpProfile(
|
2637
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2638
|
+
reqMethod="POST",
|
2639
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2640
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2641
|
+
)
|
2642
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2643
|
+
if g_param[OptionsDefine.Language]:
|
2644
|
+
profile.language = g_param[OptionsDefine.Language]
|
2645
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2646
|
+
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
2647
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2648
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2649
|
+
model = models.DescribeLakeFsInfoRequest()
|
2650
|
+
model.from_json_string(json.dumps(args))
|
2651
|
+
start_time = time.time()
|
2652
|
+
while True:
|
2653
|
+
rsp = client.DescribeLakeFsInfo(model)
|
2654
|
+
result = rsp.to_json_string()
|
2655
|
+
try:
|
2656
|
+
json_obj = json.loads(result)
|
2657
|
+
except TypeError as e:
|
2658
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2659
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2660
|
+
break
|
2661
|
+
cur_time = time.time()
|
2662
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2663
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2664
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2665
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2666
|
+
else:
|
2667
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2668
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2669
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2670
|
+
|
2671
|
+
|
2464
2672
|
def doDescribeTable(args, parsed_globals):
|
2465
2673
|
g_param = parse_global_arg(parsed_globals)
|
2466
2674
|
|
@@ -2773,6 +2981,58 @@ def doDescribeNotebookSessionStatements(args, parsed_globals):
|
|
2773
2981
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2774
2982
|
|
2775
2983
|
|
2984
|
+
def doCreateDataEngine(args, parsed_globals):
|
2985
|
+
g_param = parse_global_arg(parsed_globals)
|
2986
|
+
|
2987
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2988
|
+
cred = credential.CVMRoleCredential()
|
2989
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2990
|
+
cred = credential.STSAssumeRoleCredential(
|
2991
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2992
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
|
2993
|
+
)
|
2994
|
+
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):
|
2995
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2996
|
+
else:
|
2997
|
+
cred = credential.Credential(
|
2998
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2999
|
+
)
|
3000
|
+
http_profile = HttpProfile(
|
3001
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3002
|
+
reqMethod="POST",
|
3003
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3004
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3005
|
+
)
|
3006
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3007
|
+
if g_param[OptionsDefine.Language]:
|
3008
|
+
profile.language = g_param[OptionsDefine.Language]
|
3009
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3010
|
+
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
3011
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3012
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3013
|
+
model = models.CreateDataEngineRequest()
|
3014
|
+
model.from_json_string(json.dumps(args))
|
3015
|
+
start_time = time.time()
|
3016
|
+
while True:
|
3017
|
+
rsp = client.CreateDataEngine(model)
|
3018
|
+
result = rsp.to_json_string()
|
3019
|
+
try:
|
3020
|
+
json_obj = json.loads(result)
|
3021
|
+
except TypeError as e:
|
3022
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3023
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3024
|
+
break
|
3025
|
+
cur_time = time.time()
|
3026
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3027
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3028
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3029
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3030
|
+
else:
|
3031
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3032
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3033
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3034
|
+
|
3035
|
+
|
2776
3036
|
def doDescribeDMSDatabase(args, parsed_globals):
|
2777
3037
|
g_param = parse_global_arg(parsed_globals)
|
2778
3038
|
|
@@ -2929,6 +3189,58 @@ def doDeleteScript(args, parsed_globals):
|
|
2929
3189
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2930
3190
|
|
2931
3191
|
|
3192
|
+
def doDescribeLakeFsDirSummary(args, parsed_globals):
|
3193
|
+
g_param = parse_global_arg(parsed_globals)
|
3194
|
+
|
3195
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3196
|
+
cred = credential.CVMRoleCredential()
|
3197
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3198
|
+
cred = credential.STSAssumeRoleCredential(
|
3199
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3200
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')]
|
3201
|
+
)
|
3202
|
+
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):
|
3203
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3204
|
+
else:
|
3205
|
+
cred = credential.Credential(
|
3206
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3207
|
+
)
|
3208
|
+
http_profile = HttpProfile(
|
3209
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3210
|
+
reqMethod="POST",
|
3211
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3212
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3213
|
+
)
|
3214
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3215
|
+
if g_param[OptionsDefine.Language]:
|
3216
|
+
profile.language = g_param[OptionsDefine.Language]
|
3217
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3218
|
+
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
3219
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3220
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3221
|
+
model = models.DescribeLakeFsDirSummaryRequest()
|
3222
|
+
model.from_json_string(json.dumps(args))
|
3223
|
+
start_time = time.time()
|
3224
|
+
while True:
|
3225
|
+
rsp = client.DescribeLakeFsDirSummary(model)
|
3226
|
+
result = rsp.to_json_string()
|
3227
|
+
try:
|
3228
|
+
json_obj = json.loads(result)
|
3229
|
+
except TypeError as e:
|
3230
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3231
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3232
|
+
break
|
3233
|
+
cur_time = time.time()
|
3234
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3235
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3236
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3237
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3238
|
+
else:
|
3239
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3240
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3241
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3242
|
+
|
3243
|
+
|
2932
3244
|
def doCreateSparkAppTask(args, parsed_globals):
|
2933
3245
|
g_param = parse_global_arg(parsed_globals)
|
2934
3246
|
|
@@ -3189,7 +3501,7 @@ def doSuspendResumeDataEngine(args, parsed_globals):
|
|
3189
3501
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3190
3502
|
|
3191
3503
|
|
3192
|
-
def
|
3504
|
+
def doDescribeEngineUsageInfo(args, parsed_globals):
|
3193
3505
|
g_param = parse_global_arg(parsed_globals)
|
3194
3506
|
|
3195
3507
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3218,11 +3530,11 @@ def doDescribeDatabases(args, parsed_globals):
|
|
3218
3530
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
3219
3531
|
client._sdkVersion += ("_CLI_" + __version__)
|
3220
3532
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3221
|
-
model = models.
|
3533
|
+
model = models.DescribeEngineUsageInfoRequest()
|
3222
3534
|
model.from_json_string(json.dumps(args))
|
3223
3535
|
start_time = time.time()
|
3224
3536
|
while True:
|
3225
|
-
rsp = client.
|
3537
|
+
rsp = client.DescribeEngineUsageInfo(model)
|
3226
3538
|
result = rsp.to_json_string()
|
3227
3539
|
try:
|
3228
3540
|
json_obj = json.loads(result)
|
@@ -3241,7 +3553,7 @@ def doDescribeDatabases(args, parsed_globals):
|
|
3241
3553
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3242
3554
|
|
3243
3555
|
|
3244
|
-
def
|
3556
|
+
def doDescribeDatabases(args, parsed_globals):
|
3245
3557
|
g_param = parse_global_arg(parsed_globals)
|
3246
3558
|
|
3247
3559
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3270,11 +3582,11 @@ def doAddUsersToWorkGroup(args, parsed_globals):
|
|
3270
3582
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
3271
3583
|
client._sdkVersion += ("_CLI_" + __version__)
|
3272
3584
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3273
|
-
model = models.
|
3585
|
+
model = models.DescribeDatabasesRequest()
|
3274
3586
|
model.from_json_string(json.dumps(args))
|
3275
3587
|
start_time = time.time()
|
3276
3588
|
while True:
|
3277
|
-
rsp = client.
|
3589
|
+
rsp = client.DescribeDatabases(model)
|
3278
3590
|
result = rsp.to_json_string()
|
3279
3591
|
try:
|
3280
3592
|
json_obj = json.loads(result)
|
@@ -3293,7 +3605,7 @@ def doAddUsersToWorkGroup(args, parsed_globals):
|
|
3293
3605
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3294
3606
|
|
3295
3607
|
|
3296
|
-
def
|
3608
|
+
def doAddUsersToWorkGroup(args, parsed_globals):
|
3297
3609
|
g_param = parse_global_arg(parsed_globals)
|
3298
3610
|
|
3299
3611
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3322,11 +3634,11 @@ def doDropDMSTable(args, parsed_globals):
|
|
3322
3634
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
3323
3635
|
client._sdkVersion += ("_CLI_" + __version__)
|
3324
3636
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3325
|
-
model = models.
|
3637
|
+
model = models.AddUsersToWorkGroupRequest()
|
3326
3638
|
model.from_json_string(json.dumps(args))
|
3327
3639
|
start_time = time.time()
|
3328
3640
|
while True:
|
3329
|
-
rsp = client.
|
3641
|
+
rsp = client.AddUsersToWorkGroup(model)
|
3330
3642
|
result = rsp.to_json_string()
|
3331
3643
|
try:
|
3332
3644
|
json_obj = json.loads(result)
|
@@ -3345,7 +3657,7 @@ def doDropDMSTable(args, parsed_globals):
|
|
3345
3657
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3346
3658
|
|
3347
3659
|
|
3348
|
-
def
|
3660
|
+
def doDropDMSTable(args, parsed_globals):
|
3349
3661
|
g_param = parse_global_arg(parsed_globals)
|
3350
3662
|
|
3351
3663
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3374,11 +3686,11 @@ def doCreateTasksInOrder(args, parsed_globals):
|
|
3374
3686
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
3375
3687
|
client._sdkVersion += ("_CLI_" + __version__)
|
3376
3688
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3377
|
-
model = models.
|
3689
|
+
model = models.DropDMSTableRequest()
|
3378
3690
|
model.from_json_string(json.dumps(args))
|
3379
3691
|
start_time = time.time()
|
3380
3692
|
while True:
|
3381
|
-
rsp = client.
|
3693
|
+
rsp = client.DropDMSTable(model)
|
3382
3694
|
result = rsp.to_json_string()
|
3383
3695
|
try:
|
3384
3696
|
json_obj = json.loads(result)
|
@@ -3397,7 +3709,7 @@ def doCreateTasksInOrder(args, parsed_globals):
|
|
3397
3709
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3398
3710
|
|
3399
3711
|
|
3400
|
-
def
|
3712
|
+
def doCreateTasksInOrder(args, parsed_globals):
|
3401
3713
|
g_param = parse_global_arg(parsed_globals)
|
3402
3714
|
|
3403
3715
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3426,11 +3738,11 @@ def doCancelNotebookSessionStatement(args, parsed_globals):
|
|
3426
3738
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
3427
3739
|
client._sdkVersion += ("_CLI_" + __version__)
|
3428
3740
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3429
|
-
model = models.
|
3741
|
+
model = models.CreateTasksInOrderRequest()
|
3430
3742
|
model.from_json_string(json.dumps(args))
|
3431
3743
|
start_time = time.time()
|
3432
3744
|
while True:
|
3433
|
-
rsp = client.
|
3745
|
+
rsp = client.CreateTasksInOrder(model)
|
3434
3746
|
result = rsp.to_json_string()
|
3435
3747
|
try:
|
3436
3748
|
json_obj = json.loads(result)
|
@@ -3449,7 +3761,7 @@ def doCancelNotebookSessionStatement(args, parsed_globals):
|
|
3449
3761
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3450
3762
|
|
3451
3763
|
|
3452
|
-
def
|
3764
|
+
def doCancelNotebookSessionStatement(args, parsed_globals):
|
3453
3765
|
g_param = parse_global_arg(parsed_globals)
|
3454
3766
|
|
3455
3767
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3478,11 +3790,11 @@ def doDetachUserPolicy(args, parsed_globals):
|
|
3478
3790
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
3479
3791
|
client._sdkVersion += ("_CLI_" + __version__)
|
3480
3792
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3481
|
-
model = models.
|
3793
|
+
model = models.CancelNotebookSessionStatementRequest()
|
3482
3794
|
model.from_json_string(json.dumps(args))
|
3483
3795
|
start_time = time.time()
|
3484
3796
|
while True:
|
3485
|
-
rsp = client.
|
3797
|
+
rsp = client.CancelNotebookSessionStatement(model)
|
3486
3798
|
result = rsp.to_json_string()
|
3487
3799
|
try:
|
3488
3800
|
json_obj = json.loads(result)
|
@@ -3917,7 +4229,7 @@ def doListTaskJobLogDetail(args, parsed_globals):
|
|
3917
4229
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3918
4230
|
|
3919
4231
|
|
3920
|
-
def
|
4232
|
+
def doDetachUserPolicy(args, parsed_globals):
|
3921
4233
|
g_param = parse_global_arg(parsed_globals)
|
3922
4234
|
|
3923
4235
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3946,11 +4258,11 @@ def doCreateNotebookSessionStatement(args, parsed_globals):
|
|
3946
4258
|
client = mod.DlcClient(cred, g_param[OptionsDefine.Region], profile)
|
3947
4259
|
client._sdkVersion += ("_CLI_" + __version__)
|
3948
4260
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3949
|
-
model = models.
|
4261
|
+
model = models.DetachUserPolicyRequest()
|
3950
4262
|
model.from_json_string(json.dumps(args))
|
3951
4263
|
start_time = time.time()
|
3952
4264
|
while True:
|
3953
|
-
rsp = client.
|
4265
|
+
rsp = client.DetachUserPolicy(model)
|
3954
4266
|
result = rsp.to_json_string()
|
3955
4267
|
try:
|
3956
4268
|
json_obj = json.loads(result)
|
@@ -4138,6 +4450,7 @@ MODELS_MAP = {
|
|
4138
4450
|
ACTION_MAP = {
|
4139
4451
|
"DetachWorkGroupPolicy": doDetachWorkGroupPolicy,
|
4140
4452
|
"CreateTask": doCreateTask,
|
4453
|
+
"CreateNotebookSessionStatement": doCreateNotebookSessionStatement,
|
4141
4454
|
"DeleteNotebookSession": doDeleteNotebookSession,
|
4142
4455
|
"CheckLockMetaData": doCheckLockMetaData,
|
4143
4456
|
"CreateImportTask": doCreateImportTask,
|
@@ -4167,6 +4480,7 @@ ACTION_MAP = {
|
|
4167
4480
|
"CreateWorkGroup": doCreateWorkGroup,
|
4168
4481
|
"CreateNotebookSessionStatementSupportBatchSQL": doCreateNotebookSessionStatementSupportBatchSQL,
|
4169
4482
|
"DescribeNotebookSessionLog": doDescribeNotebookSessionLog,
|
4483
|
+
"SwitchDataEngine": doSwitchDataEngine,
|
4170
4484
|
"DescribeDataEngines": doDescribeDataEngines,
|
4171
4485
|
"UnbindWorkGroupsFromUser": doUnbindWorkGroupsFromUser,
|
4172
4486
|
"CreateInternalTable": doCreateInternalTable,
|
@@ -4178,31 +4492,35 @@ ACTION_MAP = {
|
|
4178
4492
|
"CreateSparkApp": doCreateSparkApp,
|
4179
4493
|
"DescribeTaskResult": doDescribeTaskResult,
|
4180
4494
|
"CreateScript": doCreateScript,
|
4495
|
+
"UpdateRowFilter": doUpdateRowFilter,
|
4181
4496
|
"DescribeDMSTables": doDescribeDMSTables,
|
4182
4497
|
"CreateDatabase": doCreateDatabase,
|
4183
4498
|
"DescribeNotebookSessionStatement": doDescribeNotebookSessionStatement,
|
4184
4499
|
"DescribeWorkGroups": doDescribeWorkGroups,
|
4185
4500
|
"ModifyWorkGroup": doModifyWorkGroup,
|
4501
|
+
"DescribeLakeFsInfo": doDescribeLakeFsInfo,
|
4186
4502
|
"DescribeTable": doDescribeTable,
|
4187
4503
|
"DescribeViews": doDescribeViews,
|
4188
4504
|
"CancelTask": doCancelTask,
|
4189
4505
|
"ModifySparkApp": doModifySparkApp,
|
4190
4506
|
"AlterDMSPartition": doAlterDMSPartition,
|
4191
4507
|
"DescribeNotebookSessionStatements": doDescribeNotebookSessionStatements,
|
4508
|
+
"CreateDataEngine": doCreateDataEngine,
|
4192
4509
|
"DescribeDMSDatabase": doDescribeDMSDatabase,
|
4193
4510
|
"DescribeTasks": doDescribeTasks,
|
4194
4511
|
"DeleteScript": doDeleteScript,
|
4512
|
+
"DescribeLakeFsDirSummary": doDescribeLakeFsDirSummary,
|
4195
4513
|
"CreateSparkAppTask": doCreateSparkAppTask,
|
4196
4514
|
"DropDMSPartitions": doDropDMSPartitions,
|
4197
4515
|
"ModifyUser": doModifyUser,
|
4198
4516
|
"DeleteUser": doDeleteUser,
|
4199
4517
|
"SuspendResumeDataEngine": doSuspendResumeDataEngine,
|
4518
|
+
"DescribeEngineUsageInfo": doDescribeEngineUsageInfo,
|
4200
4519
|
"DescribeDatabases": doDescribeDatabases,
|
4201
4520
|
"AddUsersToWorkGroup": doAddUsersToWorkGroup,
|
4202
4521
|
"DropDMSTable": doDropDMSTable,
|
4203
4522
|
"CreateTasksInOrder": doCreateTasksInOrder,
|
4204
4523
|
"CancelNotebookSessionStatement": doCancelNotebookSessionStatement,
|
4205
|
-
"DetachUserPolicy": doDetachUserPolicy,
|
4206
4524
|
"DescribeStoreLocation": doDescribeStoreLocation,
|
4207
4525
|
"DescribeSparkAppJob": doDescribeSparkAppJob,
|
4208
4526
|
"DescribeNotebookSessionStatementSqlResult": doDescribeNotebookSessionStatementSqlResult,
|
@@ -4211,7 +4529,7 @@ ACTION_MAP = {
|
|
4211
4529
|
"DescribeSparkAppJobs": doDescribeSparkAppJobs,
|
4212
4530
|
"AttachUserPolicy": doAttachUserPolicy,
|
4213
4531
|
"ListTaskJobLogDetail": doListTaskJobLogDetail,
|
4214
|
-
"
|
4532
|
+
"DetachUserPolicy": doDetachUserPolicy,
|
4215
4533
|
"CreateDMSDatabase": doCreateDMSDatabase,
|
4216
4534
|
"DescribeTables": doDescribeTables,
|
4217
4535
|
"CreateExportTask": doCreateExportTask,
|