tccli 3.0.1188.1__py2.py3-none-any.whl → 3.0.1190.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 +2 -1
- tccli/services/aiart/aiart_client.py +53 -0
- tccli/services/aiart/v20221229/api.json +107 -0
- tccli/services/aiart/v20221229/examples.json +8 -0
- tccli/services/apm/v20210622/api.json +3 -1
- tccli/services/billing/v20180709/api.json +3 -0
- tccli/services/billing/v20180709/examples.json +1 -1
- tccli/services/cfg/v20210820/api.json +20 -5
- tccli/services/cfw/v20190904/api.json +82 -2
- tccli/services/ckafka/v20190819/api.json +5 -5
- tccli/services/dcdb/dcdb_client.py +106 -0
- tccli/services/dcdb/v20180411/api.json +318 -0
- tccli/services/dcdb/v20180411/examples.json +28 -0
- tccli/services/dnspod/dnspod_client.py +53 -0
- tccli/services/dnspod/v20210323/api.json +118 -0
- tccli/services/dnspod/v20210323/examples.json +8 -0
- tccli/services/emr/emr_client.py +269 -4
- tccli/services/emr/v20190103/api.json +591 -0
- tccli/services/emr/v20190103/examples.json +46 -0
- tccli/services/es/es_client.py +53 -0
- tccli/services/es/v20180416/api.json +54 -0
- tccli/services/es/v20180416/examples.json +14 -0
- tccli/services/ess/v20201111/api.json +9 -9
- tccli/services/ess/v20201111/examples.json +7 -1
- tccli/services/essbasic/essbasic_client.py +53 -0
- tccli/services/essbasic/v20210526/api.json +120 -0
- tccli/services/essbasic/v20210526/examples.json +14 -0
- tccli/services/iotexplorer/v20190423/api.json +2 -2
- tccli/services/iss/iss_client.py +118 -65
- tccli/services/iss/v20230517/api.json +78 -0
- tccli/services/iss/v20230517/examples.json +8 -0
- tccli/services/mariadb/mariadb_client.py +110 -4
- tccli/services/mariadb/v20170312/api.json +318 -0
- tccli/services/mariadb/v20170312/examples.json +16 -0
- tccli/services/mps/v20190612/api.json +131 -3
- tccli/services/ocr/v20181119/api.json +22 -2
- tccli/services/redis/redis_client.py +110 -4
- tccli/services/redis/v20180412/api.json +209 -0
- tccli/services/redis/v20180412/examples.json +16 -0
- tccli/services/sms/v20210111/api.json +9 -9
- tccli/services/ssl/v20191205/api.json +3 -3
- tccli/services/ssl/v20191205/examples.json +2 -2
- tccli/services/teo/v20220901/api.json +14 -14
- tccli/services/tke/tke_client.py +364 -46
- tccli/services/tke/v20180525/api.json +9 -0
- tccli/services/tke/v20220501/api.json +525 -0
- tccli/services/tke/v20220501/examples.json +54 -0
- tccli/services/tsf/v20180326/api.json +74 -29
- tccli/services/vdb/v20230616/api.json +491 -0
- tccli/services/vdb/v20230616/examples.json +46 -0
- tccli/services/vdb/vdb_client.py +265 -0
- tccli/services/vod/v20240718/api.json +121 -0
- tccli/services/vod/v20240718/examples.json +31 -0
- tccli/services/vod/vod_client.py +58 -0
- tccli/services/vpc/v20170312/api.json +13 -4
- {tccli-3.0.1188.1.dist-info → tccli-3.0.1190.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1188.1.dist-info → tccli-3.0.1190.1.dist-info}/RECORD +61 -59
- {tccli-3.0.1188.1.dist-info → tccli-3.0.1190.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1188.1.dist-info → tccli-3.0.1190.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1188.1.dist-info → tccli-3.0.1190.1.dist-info}/license_files/LICENSE +0 -0
@@ -231,6 +231,13 @@
|
|
231
231
|
"output": "DescribeDomainShareInfoResponse",
|
232
232
|
"status": "online"
|
233
233
|
},
|
234
|
+
"DescribeDomainShareUserList": {
|
235
|
+
"document": "获取指定域名的已共享列表",
|
236
|
+
"input": "DescribeDomainShareUserListRequest",
|
237
|
+
"name": "获取指定域名的已共享列表",
|
238
|
+
"output": "DescribeDomainShareUserListResponse",
|
239
|
+
"status": "online"
|
240
|
+
},
|
234
241
|
"DescribeDomainWhois": {
|
235
242
|
"document": "获取域名Whois信息",
|
236
243
|
"input": "DescribeDomainWhoisRequest",
|
@@ -3531,6 +3538,51 @@
|
|
3531
3538
|
],
|
3532
3539
|
"type": "object"
|
3533
3540
|
},
|
3541
|
+
"DescribeDomainShareUserListRequest": {
|
3542
|
+
"document": "DescribeDomainShareUserList请求参数结构体",
|
3543
|
+
"members": [
|
3544
|
+
{
|
3545
|
+
"disabled": false,
|
3546
|
+
"document": "域名",
|
3547
|
+
"example": "dnspod.cn",
|
3548
|
+
"member": "string",
|
3549
|
+
"name": "Domain",
|
3550
|
+
"required": true,
|
3551
|
+
"type": "string"
|
3552
|
+
},
|
3553
|
+
{
|
3554
|
+
"disabled": false,
|
3555
|
+
"document": "域名 ID 。参数 DomainId 优先级比参数 Domain 高,如果传递参数 DomainId 将忽略参数 Domain 。可以通过接口DescribeDomainList查到所有的Domain以及DomainId",
|
3556
|
+
"example": "61",
|
3557
|
+
"member": "uint64",
|
3558
|
+
"name": "DomainId",
|
3559
|
+
"required": false,
|
3560
|
+
"type": "int"
|
3561
|
+
}
|
3562
|
+
],
|
3563
|
+
"type": "object"
|
3564
|
+
},
|
3565
|
+
"DescribeDomainShareUserListResponse": {
|
3566
|
+
"document": "DescribeDomainShareUserList返回参数结构体",
|
3567
|
+
"members": [
|
3568
|
+
{
|
3569
|
+
"disabled": false,
|
3570
|
+
"document": "域名套餐信息",
|
3571
|
+
"example": "无",
|
3572
|
+
"member": "DomainShareUserInfo",
|
3573
|
+
"name": "DomainShareList",
|
3574
|
+
"type": "list",
|
3575
|
+
"value_allowed_null": false
|
3576
|
+
},
|
3577
|
+
{
|
3578
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
3579
|
+
"member": "string",
|
3580
|
+
"name": "RequestId",
|
3581
|
+
"type": "string"
|
3582
|
+
}
|
3583
|
+
],
|
3584
|
+
"type": "object"
|
3585
|
+
},
|
3534
3586
|
"DescribeDomainWhoisRequest": {
|
3535
3587
|
"document": "DescribeDomainWhois请求参数结构体",
|
3536
3588
|
"members": [
|
@@ -5873,6 +5925,72 @@
|
|
5873
5925
|
],
|
5874
5926
|
"usage": "out"
|
5875
5927
|
},
|
5928
|
+
"DomainShareUserInfo": {
|
5929
|
+
"document": "域名共享信息",
|
5930
|
+
"members": [
|
5931
|
+
{
|
5932
|
+
"disabled": false,
|
5933
|
+
"document": "共享记录ID",
|
5934
|
+
"example": "21253",
|
5935
|
+
"member": "uint64",
|
5936
|
+
"name": "DomainShareId",
|
5937
|
+
"required": false,
|
5938
|
+
"type": "int",
|
5939
|
+
"value_allowed_null": false
|
5940
|
+
},
|
5941
|
+
{
|
5942
|
+
"disabled": false,
|
5943
|
+
"document": "共享模式。r-只读;w-可写;rw-可读写。\n注意:此字段可能返回 null,表示取不到有效值。",
|
5944
|
+
"example": "rw",
|
5945
|
+
"member": "string",
|
5946
|
+
"name": "Mode",
|
5947
|
+
"required": false,
|
5948
|
+
"type": "string",
|
5949
|
+
"value_allowed_null": true
|
5950
|
+
},
|
5951
|
+
{
|
5952
|
+
"disabled": false,
|
5953
|
+
"document": "共享到的用户昵称\n注意:此字段可能返回 null,表示取不到有效值。",
|
5954
|
+
"example": "张三",
|
5955
|
+
"member": "string",
|
5956
|
+
"name": "Nickname",
|
5957
|
+
"required": false,
|
5958
|
+
"type": "string",
|
5959
|
+
"value_allowed_null": true
|
5960
|
+
},
|
5961
|
+
{
|
5962
|
+
"disabled": false,
|
5963
|
+
"document": "共享到的用户UIN\n注意:此字段可能返回 null,表示取不到有效值。",
|
5964
|
+
"example": "700000283316",
|
5965
|
+
"member": "string",
|
5966
|
+
"name": "QCloudUIN",
|
5967
|
+
"required": false,
|
5968
|
+
"type": "string",
|
5969
|
+
"value_allowed_null": true
|
5970
|
+
},
|
5971
|
+
{
|
5972
|
+
"disabled": false,
|
5973
|
+
"document": "共享状态。enabled-有效;pause-无效。\n注意:此字段可能返回 null,表示取不到有效值。",
|
5974
|
+
"example": "enabled",
|
5975
|
+
"member": "string",
|
5976
|
+
"name": "Status",
|
5977
|
+
"required": false,
|
5978
|
+
"type": "string",
|
5979
|
+
"value_allowed_null": true
|
5980
|
+
},
|
5981
|
+
{
|
5982
|
+
"disabled": false,
|
5983
|
+
"document": "共享的子域名\n注意:此字段可能返回 null,表示取不到有效值。",
|
5984
|
+
"example": "api",
|
5985
|
+
"member": "string",
|
5986
|
+
"name": "SubDomain",
|
5987
|
+
"required": false,
|
5988
|
+
"type": "string",
|
5989
|
+
"value_allowed_null": true
|
5990
|
+
}
|
5991
|
+
],
|
5992
|
+
"usage": "out"
|
5993
|
+
},
|
5876
5994
|
"DownloadSnapshotRequest": {
|
5877
5995
|
"document": "DownloadSnapshot请求参数结构体",
|
5878
5996
|
"members": [
|
@@ -276,6 +276,14 @@
|
|
276
276
|
"title": "获取域名共享信息"
|
277
277
|
}
|
278
278
|
],
|
279
|
+
"DescribeDomainShareUserList": [
|
280
|
+
{
|
281
|
+
"document": "获取指定域名的已共享列表",
|
282
|
+
"input": "POST / HTTP/1.1\nHost: dnspod.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeDomainShareUserList\n<公共请求参数>\n\n{\n \"Domain\": \"example.com\"\n}",
|
283
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"1dbb40a1-8834-43e2-bae0-c5e2d0823944\",\n \"DomainShareList\": [\n {\n \"DomainShareId\": 21253,\n \"Mode\": \"rw\",\n \"Nickname\": \"我的测试环境企业\",\n \"QCloudUIN\": \"700000283316\",\n \"Status\": \"enabled\",\n \"SubDomain\": \"\"\n }\n ]\n }\n}",
|
284
|
+
"title": "获取指定域名的已共享列表"
|
285
|
+
}
|
286
|
+
],
|
279
287
|
"DescribeDomainWhois": [
|
280
288
|
{
|
281
289
|
"document": "获取域名Whois信息",
|
tccli/services/emr/emr_client.py
CHANGED
@@ -1213,6 +1213,58 @@ def doDeleteUserManagerUserList(args, parsed_globals):
|
|
1213
1213
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1214
1214
|
|
1215
1215
|
|
1216
|
+
def doTerminateSLInstance(args, parsed_globals):
|
1217
|
+
g_param = parse_global_arg(parsed_globals)
|
1218
|
+
|
1219
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1220
|
+
cred = credential.CVMRoleCredential()
|
1221
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1222
|
+
cred = credential.STSAssumeRoleCredential(
|
1223
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1224
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1225
|
+
)
|
1226
|
+
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):
|
1227
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1228
|
+
else:
|
1229
|
+
cred = credential.Credential(
|
1230
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1231
|
+
)
|
1232
|
+
http_profile = HttpProfile(
|
1233
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1234
|
+
reqMethod="POST",
|
1235
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1236
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1237
|
+
)
|
1238
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1239
|
+
if g_param[OptionsDefine.Language]:
|
1240
|
+
profile.language = g_param[OptionsDefine.Language]
|
1241
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1242
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
1243
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1244
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1245
|
+
model = models.TerminateSLInstanceRequest()
|
1246
|
+
model.from_json_string(json.dumps(args))
|
1247
|
+
start_time = time.time()
|
1248
|
+
while True:
|
1249
|
+
rsp = client.TerminateSLInstance(model)
|
1250
|
+
result = rsp.to_json_string()
|
1251
|
+
try:
|
1252
|
+
json_obj = json.loads(result)
|
1253
|
+
except TypeError as e:
|
1254
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1255
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1256
|
+
break
|
1257
|
+
cur_time = time.time()
|
1258
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1259
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1260
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1261
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1262
|
+
else:
|
1263
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1264
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1265
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1266
|
+
|
1267
|
+
|
1216
1268
|
def doAddUsersForUserManager(args, parsed_globals):
|
1217
1269
|
g_param = parse_global_arg(parsed_globals)
|
1218
1270
|
|
@@ -1317,6 +1369,110 @@ def doModifyAutoRenewFlag(args, parsed_globals):
|
|
1317
1369
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1318
1370
|
|
1319
1371
|
|
1372
|
+
def doCreateSLInstance(args, parsed_globals):
|
1373
|
+
g_param = parse_global_arg(parsed_globals)
|
1374
|
+
|
1375
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1376
|
+
cred = credential.CVMRoleCredential()
|
1377
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1378
|
+
cred = credential.STSAssumeRoleCredential(
|
1379
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1380
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1381
|
+
)
|
1382
|
+
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):
|
1383
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1384
|
+
else:
|
1385
|
+
cred = credential.Credential(
|
1386
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1387
|
+
)
|
1388
|
+
http_profile = HttpProfile(
|
1389
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1390
|
+
reqMethod="POST",
|
1391
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1392
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1393
|
+
)
|
1394
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1395
|
+
if g_param[OptionsDefine.Language]:
|
1396
|
+
profile.language = g_param[OptionsDefine.Language]
|
1397
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1398
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
1399
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1400
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1401
|
+
model = models.CreateSLInstanceRequest()
|
1402
|
+
model.from_json_string(json.dumps(args))
|
1403
|
+
start_time = time.time()
|
1404
|
+
while True:
|
1405
|
+
rsp = client.CreateSLInstance(model)
|
1406
|
+
result = rsp.to_json_string()
|
1407
|
+
try:
|
1408
|
+
json_obj = json.loads(result)
|
1409
|
+
except TypeError as e:
|
1410
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1411
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1412
|
+
break
|
1413
|
+
cur_time = time.time()
|
1414
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1415
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1416
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1417
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1418
|
+
else:
|
1419
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1420
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1421
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1422
|
+
|
1423
|
+
|
1424
|
+
def doDescribeSLInstanceList(args, parsed_globals):
|
1425
|
+
g_param = parse_global_arg(parsed_globals)
|
1426
|
+
|
1427
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1428
|
+
cred = credential.CVMRoleCredential()
|
1429
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1430
|
+
cred = credential.STSAssumeRoleCredential(
|
1431
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1432
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1433
|
+
)
|
1434
|
+
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):
|
1435
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1436
|
+
else:
|
1437
|
+
cred = credential.Credential(
|
1438
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1439
|
+
)
|
1440
|
+
http_profile = HttpProfile(
|
1441
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1442
|
+
reqMethod="POST",
|
1443
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1444
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1445
|
+
)
|
1446
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1447
|
+
if g_param[OptionsDefine.Language]:
|
1448
|
+
profile.language = g_param[OptionsDefine.Language]
|
1449
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1450
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
1451
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1452
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1453
|
+
model = models.DescribeSLInstanceListRequest()
|
1454
|
+
model.from_json_string(json.dumps(args))
|
1455
|
+
start_time = time.time()
|
1456
|
+
while True:
|
1457
|
+
rsp = client.DescribeSLInstanceList(model)
|
1458
|
+
result = rsp.to_json_string()
|
1459
|
+
try:
|
1460
|
+
json_obj = json.loads(result)
|
1461
|
+
except TypeError as e:
|
1462
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1463
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1464
|
+
break
|
1465
|
+
cur_time = time.time()
|
1466
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1467
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1468
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1469
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1470
|
+
else:
|
1471
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1472
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1473
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1474
|
+
|
1475
|
+
|
1320
1476
|
def doDescribeJobFlow(args, parsed_globals):
|
1321
1477
|
g_param = parse_global_arg(parsed_globals)
|
1322
1478
|
|
@@ -1681,7 +1837,7 @@ def doDescribeResourceScheduleDiffDetail(args, parsed_globals):
|
|
1681
1837
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1682
1838
|
|
1683
1839
|
|
1684
|
-
def
|
1840
|
+
def doDescribeSLInstance(args, parsed_globals):
|
1685
1841
|
g_param = parse_global_arg(parsed_globals)
|
1686
1842
|
|
1687
1843
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1710,11 +1866,63 @@ def doSyncPodState(args, parsed_globals):
|
|
1710
1866
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
1711
1867
|
client._sdkVersion += ("_CLI_" + __version__)
|
1712
1868
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1713
|
-
model = models.
|
1869
|
+
model = models.DescribeSLInstanceRequest()
|
1714
1870
|
model.from_json_string(json.dumps(args))
|
1715
1871
|
start_time = time.time()
|
1716
1872
|
while True:
|
1717
|
-
rsp = client.
|
1873
|
+
rsp = client.DescribeSLInstance(model)
|
1874
|
+
result = rsp.to_json_string()
|
1875
|
+
try:
|
1876
|
+
json_obj = json.loads(result)
|
1877
|
+
except TypeError as e:
|
1878
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1879
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1880
|
+
break
|
1881
|
+
cur_time = time.time()
|
1882
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1883
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1884
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1885
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1886
|
+
else:
|
1887
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1888
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1889
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1890
|
+
|
1891
|
+
|
1892
|
+
def doModifySLInstance(args, parsed_globals):
|
1893
|
+
g_param = parse_global_arg(parsed_globals)
|
1894
|
+
|
1895
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1896
|
+
cred = credential.CVMRoleCredential()
|
1897
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1898
|
+
cred = credential.STSAssumeRoleCredential(
|
1899
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1900
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1901
|
+
)
|
1902
|
+
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):
|
1903
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1904
|
+
else:
|
1905
|
+
cred = credential.Credential(
|
1906
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1907
|
+
)
|
1908
|
+
http_profile = HttpProfile(
|
1909
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1910
|
+
reqMethod="POST",
|
1911
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1912
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1913
|
+
)
|
1914
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1915
|
+
if g_param[OptionsDefine.Language]:
|
1916
|
+
profile.language = g_param[OptionsDefine.Language]
|
1917
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1918
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
1919
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1920
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1921
|
+
model = models.ModifySLInstanceRequest()
|
1922
|
+
model.from_json_string(json.dumps(args))
|
1923
|
+
start_time = time.time()
|
1924
|
+
while True:
|
1925
|
+
rsp = client.ModifySLInstance(model)
|
1718
1926
|
result = rsp.to_json_string()
|
1719
1927
|
try:
|
1720
1928
|
json_obj = json.loads(result)
|
@@ -2149,6 +2357,58 @@ def doStartStopServiceOrMonitor(args, parsed_globals):
|
|
2149
2357
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2150
2358
|
|
2151
2359
|
|
2360
|
+
def doSyncPodState(args, parsed_globals):
|
2361
|
+
g_param = parse_global_arg(parsed_globals)
|
2362
|
+
|
2363
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2364
|
+
cred = credential.CVMRoleCredential()
|
2365
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2366
|
+
cred = credential.STSAssumeRoleCredential(
|
2367
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2368
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2369
|
+
)
|
2370
|
+
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):
|
2371
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2372
|
+
else:
|
2373
|
+
cred = credential.Credential(
|
2374
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2375
|
+
)
|
2376
|
+
http_profile = HttpProfile(
|
2377
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2378
|
+
reqMethod="POST",
|
2379
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2380
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2381
|
+
)
|
2382
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2383
|
+
if g_param[OptionsDefine.Language]:
|
2384
|
+
profile.language = g_param[OptionsDefine.Language]
|
2385
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2386
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
2387
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2388
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2389
|
+
model = models.SyncPodStateRequest()
|
2390
|
+
model.from_json_string(json.dumps(args))
|
2391
|
+
start_time = time.time()
|
2392
|
+
while True:
|
2393
|
+
rsp = client.SyncPodState(model)
|
2394
|
+
result = rsp.to_json_string()
|
2395
|
+
try:
|
2396
|
+
json_obj = json.loads(result)
|
2397
|
+
except TypeError as e:
|
2398
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2399
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2400
|
+
break
|
2401
|
+
cur_time = time.time()
|
2402
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2403
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2404
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2405
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2406
|
+
else:
|
2407
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2408
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2409
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2410
|
+
|
2411
|
+
|
2152
2412
|
def doTerminateTasks(args, parsed_globals):
|
2153
2413
|
g_param = parse_global_arg(parsed_globals)
|
2154
2414
|
|
@@ -2859,8 +3119,11 @@ ACTION_MAP = {
|
|
2859
3119
|
"ResetYarnConfig": doResetYarnConfig,
|
2860
3120
|
"DescribeUsersForUserManager": doDescribeUsersForUserManager,
|
2861
3121
|
"DeleteUserManagerUserList": doDeleteUserManagerUserList,
|
3122
|
+
"TerminateSLInstance": doTerminateSLInstance,
|
2862
3123
|
"AddUsersForUserManager": doAddUsersForUserManager,
|
2863
3124
|
"ModifyAutoRenewFlag": doModifyAutoRenewFlag,
|
3125
|
+
"CreateSLInstance": doCreateSLInstance,
|
3126
|
+
"DescribeSLInstanceList": doDescribeSLInstanceList,
|
2864
3127
|
"DescribeJobFlow": doDescribeJobFlow,
|
2865
3128
|
"ModifyAutoScaleStrategy": doModifyAutoScaleStrategy,
|
2866
3129
|
"DeleteAutoScaleStrategy": doDeleteAutoScaleStrategy,
|
@@ -2868,7 +3131,8 @@ ACTION_MAP = {
|
|
2868
3131
|
"DescribeInstanceRenewNodes": doDescribeInstanceRenewNodes,
|
2869
3132
|
"ModifyResourceScheduler": doModifyResourceScheduler,
|
2870
3133
|
"DescribeResourceScheduleDiffDetail": doDescribeResourceScheduleDiffDetail,
|
2871
|
-
"
|
3134
|
+
"DescribeSLInstance": doDescribeSLInstance,
|
3135
|
+
"ModifySLInstance": doModifySLInstance,
|
2872
3136
|
"CreateInstance": doCreateInstance,
|
2873
3137
|
"InquiryPriceCreateInstance": doInquiryPriceCreateInstance,
|
2874
3138
|
"InquirePriceRenewEmr": doInquirePriceRenewEmr,
|
@@ -2877,6 +3141,7 @@ ACTION_MAP = {
|
|
2877
3141
|
"ModifyResourceScheduleConfig": doModifyResourceScheduleConfig,
|
2878
3142
|
"DescribeHiveQueries": doDescribeHiveQueries,
|
2879
3143
|
"StartStopServiceOrMonitor": doStartStopServiceOrMonitor,
|
3144
|
+
"SyncPodState": doSyncPodState,
|
2880
3145
|
"TerminateTasks": doTerminateTasks,
|
2881
3146
|
"TerminateInstance": doTerminateInstance,
|
2882
3147
|
"DescribeAutoScaleStrategies": doDescribeAutoScaleStrategies,
|