tccli-intl-en 3.0.1254.1__py2.py3-none-any.whl → 3.0.1256.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tccli/__init__.py +1 -1
- tccli/services/ccc/ccc_client.py +305 -40
- tccli/services/ccc/v20200210/api.json +1137 -90
- tccli/services/ccc/v20200210/examples.json +40 -0
- tccli/services/cmq/cmq_client.py +4 -799
- tccli/services/cmq/v20190304/api.json +173 -1367
- tccli/services/cmq/v20190304/examples.json +0 -120
- tccli/services/cvm/cvm_client.py +65 -12
- tccli/services/cvm/v20170312/api.json +52 -0
- tccli/services/cvm/v20170312/examples.json +8 -0
- tccli/services/faceid/v20180301/api.json +18 -0
- tccli/services/waf/v20180125/api.json +1372 -194
- tccli/services/waf/v20180125/examples.json +89 -1
- tccli/services/waf/waf_client.py +632 -49
- {tccli_intl_en-3.0.1254.1.dist-info → tccli_intl_en-3.0.1256.1.dist-info}/METADATA +2 -2
- {tccli_intl_en-3.0.1254.1.dist-info → tccli_intl_en-3.0.1256.1.dist-info}/RECORD +20 -20
- {tccli_intl_en-3.0.1254.1.dist-info → tccli_intl_en-3.0.1256.1.dist-info}/LICENSE +0 -0
- {tccli_intl_en-3.0.1254.1.dist-info → tccli_intl_en-3.0.1256.1.dist-info}/WHEEL +0 -0
- {tccli_intl_en-3.0.1254.1.dist-info → tccli_intl_en-3.0.1256.1.dist-info}/entry_points.txt +0 -0
- {tccli_intl_en-3.0.1254.1.dist-info → tccli_intl_en-3.0.1256.1.dist-info}/top_level.txt +0 -0
tccli/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '3.0.
|
|
1
|
+
__version__ = '3.0.1256.1'
|
tccli/services/ccc/ccc_client.py
CHANGED
|
@@ -69,7 +69,7 @@ def doUnbindNumberCallOutSkillGroup(args, parsed_globals):
|
|
|
69
69
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
70
70
|
|
|
71
71
|
|
|
72
|
-
def
|
|
72
|
+
def doModifyStaff(args, parsed_globals):
|
|
73
73
|
g_param = parse_global_arg(parsed_globals)
|
|
74
74
|
|
|
75
75
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -98,11 +98,11 @@ def doDescribeExtensions(args, parsed_globals):
|
|
|
98
98
|
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
|
99
99
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
100
100
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
101
|
-
model = models.
|
|
101
|
+
model = models.ModifyStaffRequest()
|
|
102
102
|
model.from_json_string(json.dumps(args))
|
|
103
103
|
start_time = time.time()
|
|
104
104
|
while True:
|
|
105
|
-
rsp = client.
|
|
105
|
+
rsp = client.ModifyStaff(model)
|
|
106
106
|
result = rsp.to_json_string()
|
|
107
107
|
try:
|
|
108
108
|
json_obj = json.loads(result)
|
|
@@ -173,7 +173,7 @@ def doDescribeAILatency(args, parsed_globals):
|
|
|
173
173
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
174
174
|
|
|
175
175
|
|
|
176
|
-
def
|
|
176
|
+
def doCreateExtension(args, parsed_globals):
|
|
177
177
|
g_param = parse_global_arg(parsed_globals)
|
|
178
178
|
|
|
179
179
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -202,11 +202,11 @@ def doDescribeAutoCalloutTasks(args, parsed_globals):
|
|
|
202
202
|
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
|
203
203
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
204
204
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
205
|
-
model = models.
|
|
205
|
+
model = models.CreateExtensionRequest()
|
|
206
206
|
model.from_json_string(json.dumps(args))
|
|
207
207
|
start_time = time.time()
|
|
208
208
|
while True:
|
|
209
|
-
rsp = client.
|
|
209
|
+
rsp = client.CreateExtension(model)
|
|
210
210
|
result = rsp.to_json_string()
|
|
211
211
|
try:
|
|
212
212
|
json_obj = json.loads(result)
|
|
@@ -433,7 +433,7 @@ def doDeleteCCCSkillGroup(args, parsed_globals):
|
|
|
433
433
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
434
434
|
|
|
435
435
|
|
|
436
|
-
def
|
|
436
|
+
def doStopAutoCalloutTask(args, parsed_globals):
|
|
437
437
|
g_param = parse_global_arg(parsed_globals)
|
|
438
438
|
|
|
439
439
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -462,11 +462,11 @@ def doModifyOwnNumberApply(args, parsed_globals):
|
|
|
462
462
|
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
|
463
463
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
464
464
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
465
|
-
model = models.
|
|
465
|
+
model = models.StopAutoCalloutTaskRequest()
|
|
466
466
|
model.from_json_string(json.dumps(args))
|
|
467
467
|
start_time = time.time()
|
|
468
468
|
while True:
|
|
469
|
-
rsp = client.
|
|
469
|
+
rsp = client.StopAutoCalloutTask(model)
|
|
470
470
|
result = rsp.to_json_string()
|
|
471
471
|
try:
|
|
472
472
|
json_obj = json.loads(result)
|
|
@@ -589,6 +589,58 @@ def doDescribePSTNActiveSessionList(args, parsed_globals):
|
|
|
589
589
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
590
590
|
|
|
591
591
|
|
|
592
|
+
def doBindNumberCallInInterface(args, parsed_globals):
|
|
593
|
+
g_param = parse_global_arg(parsed_globals)
|
|
594
|
+
|
|
595
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
596
|
+
cred = credential.CVMRoleCredential()
|
|
597
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
598
|
+
cred = credential.STSAssumeRoleCredential(
|
|
599
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
600
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
601
|
+
)
|
|
602
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
603
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
604
|
+
else:
|
|
605
|
+
cred = credential.Credential(
|
|
606
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
607
|
+
)
|
|
608
|
+
http_profile = HttpProfile(
|
|
609
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
610
|
+
reqMethod="POST",
|
|
611
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
612
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
613
|
+
)
|
|
614
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
615
|
+
if g_param[OptionsDefine.Language]:
|
|
616
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
617
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
618
|
+
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
|
619
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
620
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
621
|
+
model = models.BindNumberCallInInterfaceRequest()
|
|
622
|
+
model.from_json_string(json.dumps(args))
|
|
623
|
+
start_time = time.time()
|
|
624
|
+
while True:
|
|
625
|
+
rsp = client.BindNumberCallInInterface(model)
|
|
626
|
+
result = rsp.to_json_string()
|
|
627
|
+
try:
|
|
628
|
+
json_obj = json.loads(result)
|
|
629
|
+
except TypeError as e:
|
|
630
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
631
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
632
|
+
break
|
|
633
|
+
cur_time = time.time()
|
|
634
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
635
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
636
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
637
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
638
|
+
else:
|
|
639
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
640
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
641
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
642
|
+
|
|
643
|
+
|
|
592
644
|
def doDeleteExtension(args, parsed_globals):
|
|
593
645
|
g_param = parse_global_arg(parsed_globals)
|
|
594
646
|
|
|
@@ -849,7 +901,7 @@ def doDeleteStaff(args, parsed_globals):
|
|
|
849
901
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
850
902
|
|
|
851
903
|
|
|
852
|
-
def
|
|
904
|
+
def doDescribeExtensions(args, parsed_globals):
|
|
853
905
|
g_param = parse_global_arg(parsed_globals)
|
|
854
906
|
|
|
855
907
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -878,11 +930,11 @@ def doModifyStaff(args, parsed_globals):
|
|
|
878
930
|
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
|
879
931
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
880
932
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
881
|
-
model = models.
|
|
933
|
+
model = models.DescribeExtensionsRequest()
|
|
882
934
|
model.from_json_string(json.dumps(args))
|
|
883
935
|
start_time = time.time()
|
|
884
936
|
while True:
|
|
885
|
-
rsp = client.
|
|
937
|
+
rsp = client.DescribeExtensions(model)
|
|
886
938
|
result = rsp.to_json_string()
|
|
887
939
|
try:
|
|
888
940
|
json_obj = json.loads(result)
|
|
@@ -901,7 +953,7 @@ def doModifyStaff(args, parsed_globals):
|
|
|
901
953
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
902
954
|
|
|
903
955
|
|
|
904
|
-
def
|
|
956
|
+
def doDescribeAutoCalloutTasks(args, parsed_globals):
|
|
905
957
|
g_param = parse_global_arg(parsed_globals)
|
|
906
958
|
|
|
907
959
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -930,11 +982,11 @@ def doCreateExtension(args, parsed_globals):
|
|
|
930
982
|
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
|
931
983
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
932
984
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
933
|
-
model = models.
|
|
985
|
+
model = models.DescribeAutoCalloutTasksRequest()
|
|
934
986
|
model.from_json_string(json.dumps(args))
|
|
935
987
|
start_time = time.time()
|
|
936
988
|
while True:
|
|
937
|
-
rsp = client.
|
|
989
|
+
rsp = client.DescribeAutoCalloutTasks(model)
|
|
938
990
|
result = rsp.to_json_string()
|
|
939
991
|
try:
|
|
940
992
|
json_obj = json.loads(result)
|
|
@@ -1213,6 +1265,58 @@ def doDescribeTelSession(args, parsed_globals):
|
|
|
1213
1265
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1214
1266
|
|
|
1215
1267
|
|
|
1268
|
+
def doDescribeSkillGroupInfoList(args, parsed_globals):
|
|
1269
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1270
|
+
|
|
1271
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1272
|
+
cred = credential.CVMRoleCredential()
|
|
1273
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1274
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1275
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1276
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1277
|
+
)
|
|
1278
|
+
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):
|
|
1279
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1280
|
+
else:
|
|
1281
|
+
cred = credential.Credential(
|
|
1282
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1283
|
+
)
|
|
1284
|
+
http_profile = HttpProfile(
|
|
1285
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1286
|
+
reqMethod="POST",
|
|
1287
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1288
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1289
|
+
)
|
|
1290
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
1291
|
+
if g_param[OptionsDefine.Language]:
|
|
1292
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1293
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1294
|
+
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1295
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1296
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1297
|
+
model = models.DescribeSkillGroupInfoListRequest()
|
|
1298
|
+
model.from_json_string(json.dumps(args))
|
|
1299
|
+
start_time = time.time()
|
|
1300
|
+
while True:
|
|
1301
|
+
rsp = client.DescribeSkillGroupInfoList(model)
|
|
1302
|
+
result = rsp.to_json_string()
|
|
1303
|
+
try:
|
|
1304
|
+
json_obj = json.loads(result)
|
|
1305
|
+
except TypeError as e:
|
|
1306
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1307
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1308
|
+
break
|
|
1309
|
+
cur_time = time.time()
|
|
1310
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1311
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1312
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1313
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1314
|
+
else:
|
|
1315
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1316
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1317
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1318
|
+
|
|
1319
|
+
|
|
1216
1320
|
def doCreateCallOutSession(args, parsed_globals):
|
|
1217
1321
|
g_param = parse_global_arg(parsed_globals)
|
|
1218
1322
|
|
|
@@ -1421,7 +1525,7 @@ def doDescribePredictiveDialingSessions(args, parsed_globals):
|
|
|
1421
1525
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1422
1526
|
|
|
1423
1527
|
|
|
1424
|
-
def
|
|
1528
|
+
def doDescribeTelCdr(args, parsed_globals):
|
|
1425
1529
|
g_param = parse_global_arg(parsed_globals)
|
|
1426
1530
|
|
|
1427
1531
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -1450,11 +1554,11 @@ def doResumePredictiveDialingCampaign(args, parsed_globals):
|
|
|
1450
1554
|
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1451
1555
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
1452
1556
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1453
|
-
model = models.
|
|
1557
|
+
model = models.DescribeTelCdrRequest()
|
|
1454
1558
|
model.from_json_string(json.dumps(args))
|
|
1455
1559
|
start_time = time.time()
|
|
1456
1560
|
while True:
|
|
1457
|
-
rsp = client.
|
|
1561
|
+
rsp = client.DescribeTelCdr(model)
|
|
1458
1562
|
result = rsp.to_json_string()
|
|
1459
1563
|
try:
|
|
1460
1564
|
json_obj = json.loads(result)
|
|
@@ -1525,7 +1629,7 @@ def doTransferToManual(args, parsed_globals):
|
|
|
1525
1629
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1526
1630
|
|
|
1527
1631
|
|
|
1528
|
-
def
|
|
1632
|
+
def doDescribeStaffStatusHistory(args, parsed_globals):
|
|
1529
1633
|
g_param = parse_global_arg(parsed_globals)
|
|
1530
1634
|
|
|
1531
1635
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -1554,11 +1658,11 @@ def doDescribeSkillGroupInfoList(args, parsed_globals):
|
|
|
1554
1658
|
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1555
1659
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
1556
1660
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1557
|
-
model = models.
|
|
1661
|
+
model = models.DescribeStaffStatusHistoryRequest()
|
|
1558
1662
|
model.from_json_string(json.dumps(args))
|
|
1559
1663
|
start_time = time.time()
|
|
1560
1664
|
while True:
|
|
1561
|
-
rsp = client.
|
|
1665
|
+
rsp = client.DescribeStaffStatusHistory(model)
|
|
1562
1666
|
result = rsp.to_json_string()
|
|
1563
1667
|
try:
|
|
1564
1668
|
json_obj = json.loads(result)
|
|
@@ -1577,7 +1681,7 @@ def doDescribeSkillGroupInfoList(args, parsed_globals):
|
|
|
1577
1681
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1578
1682
|
|
|
1579
1683
|
|
|
1580
|
-
def
|
|
1684
|
+
def doModifyOwnNumberApply(args, parsed_globals):
|
|
1581
1685
|
g_param = parse_global_arg(parsed_globals)
|
|
1582
1686
|
|
|
1583
1687
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -1606,11 +1710,63 @@ def doStopAutoCalloutTask(args, parsed_globals):
|
|
|
1606
1710
|
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1607
1711
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
1608
1712
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1609
|
-
model = models.
|
|
1713
|
+
model = models.ModifyOwnNumberApplyRequest()
|
|
1610
1714
|
model.from_json_string(json.dumps(args))
|
|
1611
1715
|
start_time = time.time()
|
|
1612
1716
|
while True:
|
|
1613
|
-
rsp = client.
|
|
1717
|
+
rsp = client.ModifyOwnNumberApply(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
|
+
|
|
1736
|
+
def doDescribeSessionDetail(args, parsed_globals):
|
|
1737
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1738
|
+
|
|
1739
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1740
|
+
cred = credential.CVMRoleCredential()
|
|
1741
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1742
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1743
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1744
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1745
|
+
)
|
|
1746
|
+
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):
|
|
1747
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1748
|
+
else:
|
|
1749
|
+
cred = credential.Credential(
|
|
1750
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1751
|
+
)
|
|
1752
|
+
http_profile = HttpProfile(
|
|
1753
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1754
|
+
reqMethod="POST",
|
|
1755
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1756
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1757
|
+
)
|
|
1758
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
1759
|
+
if g_param[OptionsDefine.Language]:
|
|
1760
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1761
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1762
|
+
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1763
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1764
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1765
|
+
model = models.DescribeSessionDetailRequest()
|
|
1766
|
+
model.from_json_string(json.dumps(args))
|
|
1767
|
+
start_time = time.time()
|
|
1768
|
+
while True:
|
|
1769
|
+
rsp = client.DescribeSessionDetail(model)
|
|
1614
1770
|
result = rsp.to_json_string()
|
|
1615
1771
|
try:
|
|
1616
1772
|
json_obj = json.loads(result)
|
|
@@ -1889,6 +2045,58 @@ def doDescribeCCCBuyInfoList(args, parsed_globals):
|
|
|
1889
2045
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1890
2046
|
|
|
1891
2047
|
|
|
2048
|
+
def doResumePredictiveDialingCampaign(args, parsed_globals):
|
|
2049
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2050
|
+
|
|
2051
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2052
|
+
cred = credential.CVMRoleCredential()
|
|
2053
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2054
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2055
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2056
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2057
|
+
)
|
|
2058
|
+
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):
|
|
2059
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2060
|
+
else:
|
|
2061
|
+
cred = credential.Credential(
|
|
2062
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2063
|
+
)
|
|
2064
|
+
http_profile = HttpProfile(
|
|
2065
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2066
|
+
reqMethod="POST",
|
|
2067
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2068
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2069
|
+
)
|
|
2070
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
2071
|
+
if g_param[OptionsDefine.Language]:
|
|
2072
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2073
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2074
|
+
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2075
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2076
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2077
|
+
model = models.ResumePredictiveDialingCampaignRequest()
|
|
2078
|
+
model.from_json_string(json.dumps(args))
|
|
2079
|
+
start_time = time.time()
|
|
2080
|
+
while True:
|
|
2081
|
+
rsp = client.ResumePredictiveDialingCampaign(model)
|
|
2082
|
+
result = rsp.to_json_string()
|
|
2083
|
+
try:
|
|
2084
|
+
json_obj = json.loads(result)
|
|
2085
|
+
except TypeError as e:
|
|
2086
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2087
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2088
|
+
break
|
|
2089
|
+
cur_time = time.time()
|
|
2090
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2091
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2092
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2093
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2094
|
+
else:
|
|
2095
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2096
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2097
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2098
|
+
|
|
2099
|
+
|
|
1892
2100
|
def doCreateCCCSkillGroup(args, parsed_globals):
|
|
1893
2101
|
g_param = parse_global_arg(parsed_globals)
|
|
1894
2102
|
|
|
@@ -2461,7 +2669,7 @@ def doUpdateCCCSkillGroup(args, parsed_globals):
|
|
|
2461
2669
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2462
2670
|
|
|
2463
2671
|
|
|
2464
|
-
def
|
|
2672
|
+
def doCreateUserSig(args, parsed_globals):
|
|
2465
2673
|
g_param = parse_global_arg(parsed_globals)
|
|
2466
2674
|
|
|
2467
2675
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -2490,11 +2698,11 @@ def doForceMemberOffline(args, parsed_globals):
|
|
|
2490
2698
|
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2491
2699
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
2492
2700
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2493
|
-
model = models.
|
|
2701
|
+
model = models.CreateUserSigRequest()
|
|
2494
2702
|
model.from_json_string(json.dumps(args))
|
|
2495
2703
|
start_time = time.time()
|
|
2496
2704
|
while True:
|
|
2497
|
-
rsp = client.
|
|
2705
|
+
rsp = client.CreateUserSig(model)
|
|
2498
2706
|
result = rsp.to_json_string()
|
|
2499
2707
|
try:
|
|
2500
2708
|
json_obj = json.loads(result)
|
|
@@ -2773,6 +2981,58 @@ def doDescribeProtectedTelCdr(args, parsed_globals):
|
|
|
2773
2981
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2774
2982
|
|
|
2775
2983
|
|
|
2984
|
+
def doForceMemberOffline(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('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2993
|
+
)
|
|
2994
|
+
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):
|
|
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.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
|
3011
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
3012
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
3013
|
+
model = models.ForceMemberOfflineRequest()
|
|
3014
|
+
model.from_json_string(json.dumps(args))
|
|
3015
|
+
start_time = time.time()
|
|
3016
|
+
while True:
|
|
3017
|
+
rsp = client.ForceMemberOffline(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 doDescribeCallInMetrics(args, parsed_globals):
|
|
2777
3037
|
g_param = parse_global_arg(parsed_globals)
|
|
2778
3038
|
|
|
@@ -2825,7 +3085,7 @@ def doDescribeCallInMetrics(args, parsed_globals):
|
|
|
2825
3085
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2826
3086
|
|
|
2827
3087
|
|
|
2828
|
-
def
|
|
3088
|
+
def doControlAIConversation(args, parsed_globals):
|
|
2829
3089
|
g_param = parse_global_arg(parsed_globals)
|
|
2830
3090
|
|
|
2831
3091
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -2854,11 +3114,11 @@ def doDescribeTelCdr(args, parsed_globals):
|
|
|
2854
3114
|
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2855
3115
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
2856
3116
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2857
|
-
model = models.
|
|
3117
|
+
model = models.ControlAIConversationRequest()
|
|
2858
3118
|
model.from_json_string(json.dumps(args))
|
|
2859
3119
|
start_time = time.time()
|
|
2860
3120
|
while True:
|
|
2861
|
-
rsp = client.
|
|
3121
|
+
rsp = client.ControlAIConversation(model)
|
|
2862
3122
|
result = rsp.to_json_string()
|
|
2863
3123
|
try:
|
|
2864
3124
|
json_obj = json.loads(result)
|
|
@@ -3253,41 +3513,45 @@ MODELS_MAP = {
|
|
|
3253
3513
|
|
|
3254
3514
|
ACTION_MAP = {
|
|
3255
3515
|
"UnbindNumberCallOutSkillGroup": doUnbindNumberCallOutSkillGroup,
|
|
3256
|
-
"
|
|
3516
|
+
"ModifyStaff": doModifyStaff,
|
|
3257
3517
|
"DescribeAILatency": doDescribeAILatency,
|
|
3258
|
-
"
|
|
3518
|
+
"CreateExtension": doCreateExtension,
|
|
3259
3519
|
"AbortAgentCruiseDialingCampaign": doAbortAgentCruiseDialingCampaign,
|
|
3260
3520
|
"CreateAICall": doCreateAICall,
|
|
3261
3521
|
"DescribeAgentCruiseDialingCampaign": doDescribeAgentCruiseDialingCampaign,
|
|
3262
3522
|
"DeleteCCCSkillGroup": doDeleteCCCSkillGroup,
|
|
3263
|
-
"
|
|
3523
|
+
"StopAutoCalloutTask": doStopAutoCalloutTask,
|
|
3264
3524
|
"DescribePredictiveDialingCampaign": doDescribePredictiveDialingCampaign,
|
|
3265
3525
|
"DescribePSTNActiveSessionList": doDescribePSTNActiveSessionList,
|
|
3526
|
+
"BindNumberCallInInterface": doBindNumberCallInInterface,
|
|
3266
3527
|
"DeleteExtension": doDeleteExtension,
|
|
3267
3528
|
"BindStaffSkillGroupList": doBindStaffSkillGroupList,
|
|
3268
3529
|
"BindNumberCallOutSkillGroup": doBindNumberCallOutSkillGroup,
|
|
3269
3530
|
"CreatePredictiveDialingCampaign": doCreatePredictiveDialingCampaign,
|
|
3270
3531
|
"DeleteStaff": doDeleteStaff,
|
|
3271
|
-
"
|
|
3272
|
-
"
|
|
3532
|
+
"DescribeExtensions": doDescribeExtensions,
|
|
3533
|
+
"DescribeAutoCalloutTasks": doDescribeAutoCalloutTasks,
|
|
3273
3534
|
"ResetExtensionPassword": doResetExtensionPassword,
|
|
3274
3535
|
"CreateStaff": doCreateStaff,
|
|
3275
3536
|
"DescribeAICallExtractResult": doDescribeAICallExtractResult,
|
|
3276
3537
|
"DescribeExtension": doDescribeExtension,
|
|
3277
3538
|
"DescribeTelSession": doDescribeTelSession,
|
|
3539
|
+
"DescribeSkillGroupInfoList": doDescribeSkillGroupInfoList,
|
|
3278
3540
|
"CreateCallOutSession": doCreateCallOutSession,
|
|
3279
3541
|
"DescribePredictiveDialingCampaigns": doDescribePredictiveDialingCampaigns,
|
|
3280
3542
|
"DescribeAutoCalloutTask": doDescribeAutoCalloutTask,
|
|
3281
3543
|
"DescribePredictiveDialingSessions": doDescribePredictiveDialingSessions,
|
|
3282
|
-
"
|
|
3544
|
+
"DescribeTelCdr": doDescribeTelCdr,
|
|
3283
3545
|
"TransferToManual": doTransferToManual,
|
|
3284
|
-
"
|
|
3285
|
-
"
|
|
3546
|
+
"DescribeStaffStatusHistory": doDescribeStaffStatusHistory,
|
|
3547
|
+
"ModifyOwnNumberApply": doModifyOwnNumberApply,
|
|
3548
|
+
"DescribeSessionDetail": doDescribeSessionDetail,
|
|
3286
3549
|
"DescribeIvrAudioList": doDescribeIvrAudioList,
|
|
3287
3550
|
"UploadIvrAudio": doUploadIvrAudio,
|
|
3288
3551
|
"CreateAgentCruiseDialingCampaign": doCreateAgentCruiseDialingCampaign,
|
|
3289
3552
|
"CreateOwnNumberApply": doCreateOwnNumberApply,
|
|
3290
3553
|
"DescribeCCCBuyInfoList": doDescribeCCCBuyInfoList,
|
|
3554
|
+
"ResumePredictiveDialingCampaign": doResumePredictiveDialingCampaign,
|
|
3291
3555
|
"CreateCCCSkillGroup": doCreateCCCSkillGroup,
|
|
3292
3556
|
"UnbindStaffSkillGroupList": doUnbindStaffSkillGroupList,
|
|
3293
3557
|
"ModifyStaffPassword": doModifyStaffPassword,
|
|
@@ -3299,14 +3563,15 @@ ACTION_MAP = {
|
|
|
3299
3563
|
"CreateAutoCalloutTask": doCreateAutoCalloutTask,
|
|
3300
3564
|
"ModifyExtension": doModifyExtension,
|
|
3301
3565
|
"UpdateCCCSkillGroup": doUpdateCCCSkillGroup,
|
|
3302
|
-
"
|
|
3566
|
+
"CreateUserSig": doCreateUserSig,
|
|
3303
3567
|
"DescribeTelRecordAsr": doDescribeTelRecordAsr,
|
|
3304
3568
|
"HangUpCall": doHangUpCall,
|
|
3305
3569
|
"PausePredictiveDialingCampaign": doPausePredictiveDialingCampaign,
|
|
3306
3570
|
"CreateAdminURL": doCreateAdminURL,
|
|
3307
3571
|
"DescribeProtectedTelCdr": doDescribeProtectedTelCdr,
|
|
3572
|
+
"ForceMemberOffline": doForceMemberOffline,
|
|
3308
3573
|
"DescribeCallInMetrics": doDescribeCallInMetrics,
|
|
3309
|
-
"
|
|
3574
|
+
"ControlAIConversation": doControlAIConversation,
|
|
3310
3575
|
"CreateSDKLoginToken": doCreateSDKLoginToken,
|
|
3311
3576
|
"DescribeNumbers": doDescribeNumbers,
|
|
3312
3577
|
"AbortPredictiveDialingCampaign": doAbortPredictiveDialingCampaign,
|