tccli 3.0.1064.1__py2.py3-none-any.whl → 3.0.1067.1__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- tccli/__init__.py +1 -1
- tccli/examples/ccc/v20200210/AbortPredictiveDialingCampaign.md +21 -0
- tccli/examples/ccc/v20200210/CreatePredictiveDialingCampaign.md +33 -0
- tccli/examples/ccc/v20200210/DeletePredictiveDialingCampaign.md +21 -0
- tccli/examples/ccc/v20200210/DescribePredictiveDialingCampaign.md +32 -0
- tccli/examples/ccc/v20200210/DescribePredictiveDialingCampaigns.md +55 -0
- tccli/examples/ccc/v20200210/DescribePredictiveDialingSessions.md +29 -0
- tccli/examples/ccc/v20200210/PausePredictiveDialingCampaign.md +21 -0
- tccli/examples/ccc/v20200210/ResumePredictiveDialingCampaign.md +21 -0
- tccli/examples/ccc/v20200210/UpdatePredictiveDialingCampaign.md +33 -0
- tccli/examples/cfw/v20190904/CreateBlockIgnoreRuleNew.md +25 -0
- tccli/examples/cfw/v20190904/DeleteBlockIgnoreRuleNew.md +23 -0
- tccli/examples/cfw/v20190904/ModifyBlockIgnoreRuleNew.md +24 -0
- tccli/examples/cls/v20201016/DescribeConfigMachineGroups.md +1 -0
- tccli/examples/cls/v20201016/DescribeMachineGroups.md +1 -0
- tccli/examples/csip/v20221121/DescribeTopAttackInfo.md +26 -0
- tccli/examples/ecm/v20190719/ModifyPrivateIpAddressesAttribute.md +1 -1
- tccli/examples/mna/v20210119/AddDevice.md +1 -1
- tccli/examples/mna/v20210119/GetMultiFlowStatistic.md +7 -1
- tccli/examples/mna/v20210119/GetNetMonitor.md +7 -49
- tccli/examples/mna/v20210119/GetStatisticData.md +5 -3
- tccli/examples/omics/v20221128/CreateVolume.md +25 -0
- tccli/examples/omics/v20221128/DeleteVolume.md +20 -0
- tccli/examples/omics/v20221128/DeleteVolumeData.md +21 -0
- tccli/examples/omics/v20221128/DescribeVolumes.md +37 -0
- tccli/examples/omics/v20221128/ModifyVolume.md +21 -0
- tccli/examples/postgres/v20170312/ModifyDBInstanceSpec.md +1 -0
- tccli/examples/tse/v20201207/CreateGovernanceInstances.md +32 -0
- tccli/examples/tse/v20201207/DeleteGovernanceInstances.md +35 -0
- tccli/examples/tse/v20201207/DescribeGovernanceInstances.md +56 -0
- tccli/examples/tse/v20201207/ModifyGovernanceInstances.md +35 -0
- tccli/examples/vod/v20180717/CreateDomainVerifyRecord.md +3 -1
- tccli/examples/vod/v20180717/DescribeDefaultDistributionConfig.md +22 -0
- tccli/examples/vod/v20180717/ModifyDefaultDistributionConfig.md +21 -0
- tccli/examples/waf/v20180125/CreateDeals.md +42 -0
- tccli/examples/wedata/v20210820/BatchStartIntegrationTasks.md +10 -7
- tccli/examples/wedata/v20210820/BatchStopIntegrationTasks.md +37 -6
- tccli/services/ccc/ccc_client.py +493 -16
- tccli/services/ccc/v20200210/api.json +927 -42
- tccli/services/ccc/v20200210/examples.json +72 -0
- tccli/services/cdb/v20170320/api.json +1 -1
- tccli/services/cfw/cfw_client.py +171 -12
- tccli/services/cfw/v20190904/api.json +258 -2
- tccli/services/cfw/v20190904/examples.json +24 -0
- tccli/services/ckafka/v20190819/api.json +17 -17
- tccli/services/cls/v20201016/api.json +45 -17
- tccli/services/cls/v20201016/examples.json +2 -2
- tccli/services/csip/csip_client.py +57 -4
- tccli/services/csip/v20221121/api.json +70 -0
- tccli/services/csip/v20221121/examples.json +8 -0
- tccli/services/cynosdb/v20190107/api.json +3 -3
- tccli/services/ecm/v20190719/api.json +3 -3
- tccli/services/ecm/v20190719/examples.json +1 -1
- tccli/services/ess/v20201111/api.json +3 -3
- tccli/services/essbasic/v20210526/api.json +5 -5
- tccli/services/iotvideo/v20211125/api.json +1 -1
- tccli/services/lighthouse/v20200324/api.json +1 -1
- tccli/services/mna/v20210119/api.json +144 -9
- tccli/services/mna/v20210119/examples.json +6 -6
- tccli/services/monitor/v20180724/api.json +20 -0
- tccli/services/omics/omics_client.py +277 -12
- tccli/services/omics/v20221128/api.json +425 -0
- tccli/services/omics/v20221128/examples.json +40 -0
- tccli/services/postgres/v20170312/api.json +27 -0
- tccli/services/postgres/v20170312/examples.json +1 -1
- tccli/services/trp/v20210515/api.json +18 -0
- tccli/services/trtc/v20190722/api.json +10 -1
- tccli/services/tse/tse_client.py +220 -8
- tccli/services/tse/v20201207/api.json +779 -42
- tccli/services/tse/v20201207/examples.json +32 -0
- tccli/services/vod/v20180717/api.json +146 -1
- tccli/services/vod/v20180717/examples.json +17 -1
- tccli/services/vod/vod_client.py +106 -0
- tccli/services/waf/v20180125/api.json +256 -1
- tccli/services/waf/v20180125/examples.json +8 -0
- tccli/services/waf/waf_client.py +57 -4
- tccli/services/wedata/v20210820/api.json +140 -15
- tccli/services/wedata/v20210820/examples.json +10 -4
- {tccli-3.0.1064.1.dist-info → tccli-3.0.1067.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1064.1.dist-info → tccli-3.0.1067.1.dist-info}/RECORD +83 -58
- {tccli-3.0.1064.1.dist-info → tccli-3.0.1067.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1064.1.dist-info → tccli-3.0.1067.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1064.1.dist-info → tccli-3.0.1067.1.dist-info}/license_files/LICENSE +0 -0
tccli/services/ccc/ccc_client.py
CHANGED
@@ -225,7 +225,7 @@ def doDescribeStaffInfoList(args, parsed_globals):
|
|
225
225
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
226
|
|
227
227
|
|
228
|
-
def
|
228
|
+
def doDescribePredictiveDialingCampaign(args, parsed_globals):
|
229
229
|
g_param = parse_global_arg(parsed_globals)
|
230
230
|
|
231
231
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -254,11 +254,11 @@ def doHangUpCall(args, parsed_globals):
|
|
254
254
|
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
255
255
|
client._sdkVersion += ("_CLI_" + __version__)
|
256
256
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
257
|
-
model = models.
|
257
|
+
model = models.DescribePredictiveDialingCampaignRequest()
|
258
258
|
model.from_json_string(json.dumps(args))
|
259
259
|
start_time = time.time()
|
260
260
|
while True:
|
261
|
-
rsp = client.
|
261
|
+
rsp = client.DescribePredictiveDialingCampaign(model)
|
262
262
|
result = rsp.to_json_string()
|
263
263
|
try:
|
264
264
|
json_obj = json.loads(result)
|
@@ -953,7 +953,7 @@ def doCreateCallOutSession(args, parsed_globals):
|
|
953
953
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
954
954
|
|
955
955
|
|
956
|
-
def
|
956
|
+
def doDescribePredictiveDialingCampaigns(args, parsed_globals):
|
957
957
|
g_param = parse_global_arg(parsed_globals)
|
958
958
|
|
959
959
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -982,11 +982,11 @@ def doDescribeCarrierPrivilegeNumberApplicants(args, parsed_globals):
|
|
982
982
|
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
983
983
|
client._sdkVersion += ("_CLI_" + __version__)
|
984
984
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
985
|
-
model = models.
|
985
|
+
model = models.DescribePredictiveDialingCampaignsRequest()
|
986
986
|
model.from_json_string(json.dumps(args))
|
987
987
|
start_time = time.time()
|
988
988
|
while True:
|
989
|
-
rsp = client.
|
989
|
+
rsp = client.DescribePredictiveDialingCampaigns(model)
|
990
990
|
result = rsp.to_json_string()
|
991
991
|
try:
|
992
992
|
json_obj = json.loads(result)
|
@@ -1057,7 +1057,7 @@ def doDescribeAutoCalloutTask(args, parsed_globals):
|
|
1057
1057
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1058
1058
|
|
1059
1059
|
|
1060
|
-
def
|
1060
|
+
def doDescribePredictiveDialingSessions(args, parsed_globals):
|
1061
1061
|
g_param = parse_global_arg(parsed_globals)
|
1062
1062
|
|
1063
1063
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1086,11 +1086,63 @@ def doCreateSDKLoginToken(args, parsed_globals):
|
|
1086
1086
|
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
1087
1087
|
client._sdkVersion += ("_CLI_" + __version__)
|
1088
1088
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1089
|
-
model = models.
|
1089
|
+
model = models.DescribePredictiveDialingSessionsRequest()
|
1090
1090
|
model.from_json_string(json.dumps(args))
|
1091
1091
|
start_time = time.time()
|
1092
1092
|
while True:
|
1093
|
-
rsp = client.
|
1093
|
+
rsp = client.DescribePredictiveDialingSessions(model)
|
1094
|
+
result = rsp.to_json_string()
|
1095
|
+
try:
|
1096
|
+
json_obj = json.loads(result)
|
1097
|
+
except TypeError as e:
|
1098
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1099
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1100
|
+
break
|
1101
|
+
cur_time = time.time()
|
1102
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1103
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1104
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1105
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1106
|
+
else:
|
1107
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1108
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1109
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1110
|
+
|
1111
|
+
|
1112
|
+
def doResumePredictiveDialingCampaign(args, parsed_globals):
|
1113
|
+
g_param = parse_global_arg(parsed_globals)
|
1114
|
+
|
1115
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1116
|
+
cred = credential.CVMRoleCredential()
|
1117
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1118
|
+
cred = credential.STSAssumeRoleCredential(
|
1119
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1120
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1121
|
+
)
|
1122
|
+
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):
|
1123
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1124
|
+
else:
|
1125
|
+
cred = credential.Credential(
|
1126
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1127
|
+
)
|
1128
|
+
http_profile = HttpProfile(
|
1129
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1130
|
+
reqMethod="POST",
|
1131
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1132
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1133
|
+
)
|
1134
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1135
|
+
if g_param[OptionsDefine.Language]:
|
1136
|
+
profile.language = g_param[OptionsDefine.Language]
|
1137
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1138
|
+
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
1139
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1140
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1141
|
+
model = models.ResumePredictiveDialingCampaignRequest()
|
1142
|
+
model.from_json_string(json.dumps(args))
|
1143
|
+
start_time = time.time()
|
1144
|
+
while True:
|
1145
|
+
rsp = client.ResumePredictiveDialingCampaign(model)
|
1094
1146
|
result = rsp.to_json_string()
|
1095
1147
|
try:
|
1096
1148
|
json_obj = json.loads(result)
|
@@ -1213,6 +1265,58 @@ def doStopAutoCalloutTask(args, parsed_globals):
|
|
1213
1265
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1214
1266
|
|
1215
1267
|
|
1268
|
+
def doCreatePredictiveDialingCampaign(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.CreatePredictiveDialingCampaignRequest()
|
1298
|
+
model.from_json_string(json.dumps(args))
|
1299
|
+
start_time = time.time()
|
1300
|
+
while True:
|
1301
|
+
rsp = client.CreatePredictiveDialingCampaign(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 doCreateCarrierPrivilegeNumberApplicant(args, parsed_globals):
|
1217
1321
|
g_param = parse_global_arg(parsed_globals)
|
1218
1322
|
|
@@ -1265,6 +1369,58 @@ def doCreateCarrierPrivilegeNumberApplicant(args, parsed_globals):
|
|
1265
1369
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1266
1370
|
|
1267
1371
|
|
1372
|
+
def doDescribeActiveCarrierPrivilegeNumber(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.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
1399
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1400
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1401
|
+
model = models.DescribeActiveCarrierPrivilegeNumberRequest()
|
1402
|
+
model.from_json_string(json.dumps(args))
|
1403
|
+
start_time = time.time()
|
1404
|
+
while True:
|
1405
|
+
rsp = client.DescribeActiveCarrierPrivilegeNumber(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
|
+
|
1268
1424
|
def doDescribeChatMessages(args, parsed_globals):
|
1269
1425
|
g_param = parse_global_arg(parsed_globals)
|
1270
1426
|
|
@@ -1369,6 +1525,58 @@ def doDescribeCCCBuyInfoList(args, parsed_globals):
|
|
1369
1525
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1370
1526
|
|
1371
1527
|
|
1528
|
+
def doDescribeCarrierPrivilegeNumberApplicants(args, parsed_globals):
|
1529
|
+
g_param = parse_global_arg(parsed_globals)
|
1530
|
+
|
1531
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1532
|
+
cred = credential.CVMRoleCredential()
|
1533
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1534
|
+
cred = credential.STSAssumeRoleCredential(
|
1535
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1536
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1537
|
+
)
|
1538
|
+
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):
|
1539
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1540
|
+
else:
|
1541
|
+
cred = credential.Credential(
|
1542
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1543
|
+
)
|
1544
|
+
http_profile = HttpProfile(
|
1545
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1546
|
+
reqMethod="POST",
|
1547
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1548
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1549
|
+
)
|
1550
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1551
|
+
if g_param[OptionsDefine.Language]:
|
1552
|
+
profile.language = g_param[OptionsDefine.Language]
|
1553
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1554
|
+
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
1555
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1556
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1557
|
+
model = models.DescribeCarrierPrivilegeNumberApplicantsRequest()
|
1558
|
+
model.from_json_string(json.dumps(args))
|
1559
|
+
start_time = time.time()
|
1560
|
+
while True:
|
1561
|
+
rsp = client.DescribeCarrierPrivilegeNumberApplicants(model)
|
1562
|
+
result = rsp.to_json_string()
|
1563
|
+
try:
|
1564
|
+
json_obj = json.loads(result)
|
1565
|
+
except TypeError as e:
|
1566
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1567
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1568
|
+
break
|
1569
|
+
cur_time = time.time()
|
1570
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1571
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1572
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1573
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1574
|
+
else:
|
1575
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1576
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1577
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1578
|
+
|
1579
|
+
|
1372
1580
|
def doCreateCCCSkillGroup(args, parsed_globals):
|
1373
1581
|
g_param = parse_global_arg(parsed_globals)
|
1374
1582
|
|
@@ -1785,6 +1993,110 @@ def doCreateUserSig(args, parsed_globals):
|
|
1785
1993
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1786
1994
|
|
1787
1995
|
|
1996
|
+
def doHangUpCall(args, parsed_globals):
|
1997
|
+
g_param = parse_global_arg(parsed_globals)
|
1998
|
+
|
1999
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2000
|
+
cred = credential.CVMRoleCredential()
|
2001
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2002
|
+
cred = credential.STSAssumeRoleCredential(
|
2003
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2004
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2005
|
+
)
|
2006
|
+
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):
|
2007
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2008
|
+
else:
|
2009
|
+
cred = credential.Credential(
|
2010
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2011
|
+
)
|
2012
|
+
http_profile = HttpProfile(
|
2013
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2014
|
+
reqMethod="POST",
|
2015
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2016
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2017
|
+
)
|
2018
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2019
|
+
if g_param[OptionsDefine.Language]:
|
2020
|
+
profile.language = g_param[OptionsDefine.Language]
|
2021
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2022
|
+
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
2023
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2024
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2025
|
+
model = models.HangUpCallRequest()
|
2026
|
+
model.from_json_string(json.dumps(args))
|
2027
|
+
start_time = time.time()
|
2028
|
+
while True:
|
2029
|
+
rsp = client.HangUpCall(model)
|
2030
|
+
result = rsp.to_json_string()
|
2031
|
+
try:
|
2032
|
+
json_obj = json.loads(result)
|
2033
|
+
except TypeError as e:
|
2034
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2035
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2036
|
+
break
|
2037
|
+
cur_time = time.time()
|
2038
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2039
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2040
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2041
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2042
|
+
else:
|
2043
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2044
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2045
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2046
|
+
|
2047
|
+
|
2048
|
+
def doPausePredictiveDialingCampaign(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.PausePredictiveDialingCampaignRequest()
|
2078
|
+
model.from_json_string(json.dumps(args))
|
2079
|
+
start_time = time.time()
|
2080
|
+
while True:
|
2081
|
+
rsp = client.PausePredictiveDialingCampaign(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
|
+
|
1788
2100
|
def doCreateAdminURL(args, parsed_globals):
|
1789
2101
|
g_param = parse_global_arg(parsed_globals)
|
1790
2102
|
|
@@ -2045,7 +2357,7 @@ def doDescribeTelCdr(args, parsed_globals):
|
|
2045
2357
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2046
2358
|
|
2047
2359
|
|
2048
|
-
def
|
2360
|
+
def doCreateSDKLoginToken(args, parsed_globals):
|
2049
2361
|
g_param = parse_global_arg(parsed_globals)
|
2050
2362
|
|
2051
2363
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2074,11 +2386,11 @@ def doDescribeActiveCarrierPrivilegeNumber(args, parsed_globals):
|
|
2074
2386
|
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
2075
2387
|
client._sdkVersion += ("_CLI_" + __version__)
|
2076
2388
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2077
|
-
model = models.
|
2389
|
+
model = models.CreateSDKLoginTokenRequest()
|
2078
2390
|
model.from_json_string(json.dumps(args))
|
2079
2391
|
start_time = time.time()
|
2080
2392
|
while True:
|
2081
|
-
rsp = client.
|
2393
|
+
rsp = client.CreateSDKLoginToken(model)
|
2082
2394
|
result = rsp.to_json_string()
|
2083
2395
|
try:
|
2084
2396
|
json_obj = json.loads(result)
|
@@ -2149,6 +2461,162 @@ def doDescribeNumbers(args, parsed_globals):
|
|
2149
2461
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2150
2462
|
|
2151
2463
|
|
2464
|
+
def doAbortPredictiveDialingCampaign(args, parsed_globals):
|
2465
|
+
g_param = parse_global_arg(parsed_globals)
|
2466
|
+
|
2467
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2468
|
+
cred = credential.CVMRoleCredential()
|
2469
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2470
|
+
cred = credential.STSAssumeRoleCredential(
|
2471
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2472
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2473
|
+
)
|
2474
|
+
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):
|
2475
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2476
|
+
else:
|
2477
|
+
cred = credential.Credential(
|
2478
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2479
|
+
)
|
2480
|
+
http_profile = HttpProfile(
|
2481
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2482
|
+
reqMethod="POST",
|
2483
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2484
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2485
|
+
)
|
2486
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2487
|
+
if g_param[OptionsDefine.Language]:
|
2488
|
+
profile.language = g_param[OptionsDefine.Language]
|
2489
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2490
|
+
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
2491
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2492
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2493
|
+
model = models.AbortPredictiveDialingCampaignRequest()
|
2494
|
+
model.from_json_string(json.dumps(args))
|
2495
|
+
start_time = time.time()
|
2496
|
+
while True:
|
2497
|
+
rsp = client.AbortPredictiveDialingCampaign(model)
|
2498
|
+
result = rsp.to_json_string()
|
2499
|
+
try:
|
2500
|
+
json_obj = json.loads(result)
|
2501
|
+
except TypeError as e:
|
2502
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2503
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2504
|
+
break
|
2505
|
+
cur_time = time.time()
|
2506
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2507
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2508
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2509
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2510
|
+
else:
|
2511
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2512
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2513
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2514
|
+
|
2515
|
+
|
2516
|
+
def doDeletePredictiveDialingCampaign(args, parsed_globals):
|
2517
|
+
g_param = parse_global_arg(parsed_globals)
|
2518
|
+
|
2519
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2520
|
+
cred = credential.CVMRoleCredential()
|
2521
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2522
|
+
cred = credential.STSAssumeRoleCredential(
|
2523
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2524
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2525
|
+
)
|
2526
|
+
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):
|
2527
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2528
|
+
else:
|
2529
|
+
cred = credential.Credential(
|
2530
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2531
|
+
)
|
2532
|
+
http_profile = HttpProfile(
|
2533
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2534
|
+
reqMethod="POST",
|
2535
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2536
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2537
|
+
)
|
2538
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2539
|
+
if g_param[OptionsDefine.Language]:
|
2540
|
+
profile.language = g_param[OptionsDefine.Language]
|
2541
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2542
|
+
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
2543
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2544
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2545
|
+
model = models.DeletePredictiveDialingCampaignRequest()
|
2546
|
+
model.from_json_string(json.dumps(args))
|
2547
|
+
start_time = time.time()
|
2548
|
+
while True:
|
2549
|
+
rsp = client.DeletePredictiveDialingCampaign(model)
|
2550
|
+
result = rsp.to_json_string()
|
2551
|
+
try:
|
2552
|
+
json_obj = json.loads(result)
|
2553
|
+
except TypeError as e:
|
2554
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2555
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2556
|
+
break
|
2557
|
+
cur_time = time.time()
|
2558
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2559
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2560
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2561
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2562
|
+
else:
|
2563
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2564
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2565
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2566
|
+
|
2567
|
+
|
2568
|
+
def doUpdatePredictiveDialingCampaign(args, parsed_globals):
|
2569
|
+
g_param = parse_global_arg(parsed_globals)
|
2570
|
+
|
2571
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2572
|
+
cred = credential.CVMRoleCredential()
|
2573
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2574
|
+
cred = credential.STSAssumeRoleCredential(
|
2575
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2576
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2577
|
+
)
|
2578
|
+
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):
|
2579
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2580
|
+
else:
|
2581
|
+
cred = credential.Credential(
|
2582
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2583
|
+
)
|
2584
|
+
http_profile = HttpProfile(
|
2585
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2586
|
+
reqMethod="POST",
|
2587
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2588
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2589
|
+
)
|
2590
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2591
|
+
if g_param[OptionsDefine.Language]:
|
2592
|
+
profile.language = g_param[OptionsDefine.Language]
|
2593
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2594
|
+
client = mod.CccClient(cred, g_param[OptionsDefine.Region], profile)
|
2595
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2596
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2597
|
+
model = models.UpdatePredictiveDialingCampaignRequest()
|
2598
|
+
model.from_json_string(json.dumps(args))
|
2599
|
+
start_time = time.time()
|
2600
|
+
while True:
|
2601
|
+
rsp = client.UpdatePredictiveDialingCampaign(model)
|
2602
|
+
result = rsp.to_json_string()
|
2603
|
+
try:
|
2604
|
+
json_obj = json.loads(result)
|
2605
|
+
except TypeError as e:
|
2606
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2607
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2608
|
+
break
|
2609
|
+
cur_time = time.time()
|
2610
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2611
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2612
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2613
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2614
|
+
else:
|
2615
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2616
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2617
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2618
|
+
|
2619
|
+
|
2152
2620
|
CLIENT_MAP = {
|
2153
2621
|
"v20200210": ccc_client_v20200210,
|
2154
2622
|
|
@@ -2164,7 +2632,7 @@ ACTION_MAP = {
|
|
2164
2632
|
"DescribeExtensions": doDescribeExtensions,
|
2165
2633
|
"DescribeAutoCalloutTasks": doDescribeAutoCalloutTasks,
|
2166
2634
|
"DescribeStaffInfoList": doDescribeStaffInfoList,
|
2167
|
-
"
|
2635
|
+
"DescribePredictiveDialingCampaign": doDescribePredictiveDialingCampaign,
|
2168
2636
|
"DescribePSTNActiveSessionList": doDescribePSTNActiveSessionList,
|
2169
2637
|
"DeleteExtension": doDeleteExtension,
|
2170
2638
|
"BindStaffSkillGroupList": doBindStaffSkillGroupList,
|
@@ -2178,14 +2646,18 @@ ACTION_MAP = {
|
|
2178
2646
|
"DescribeExtension": doDescribeExtension,
|
2179
2647
|
"DescribeTelSession": doDescribeTelSession,
|
2180
2648
|
"CreateCallOutSession": doCreateCallOutSession,
|
2181
|
-
"
|
2649
|
+
"DescribePredictiveDialingCampaigns": doDescribePredictiveDialingCampaigns,
|
2182
2650
|
"DescribeAutoCalloutTask": doDescribeAutoCalloutTask,
|
2183
|
-
"
|
2651
|
+
"DescribePredictiveDialingSessions": doDescribePredictiveDialingSessions,
|
2652
|
+
"ResumePredictiveDialingCampaign": doResumePredictiveDialingCampaign,
|
2184
2653
|
"DescribeSkillGroupInfoList": doDescribeSkillGroupInfoList,
|
2185
2654
|
"StopAutoCalloutTask": doStopAutoCalloutTask,
|
2655
|
+
"CreatePredictiveDialingCampaign": doCreatePredictiveDialingCampaign,
|
2186
2656
|
"CreateCarrierPrivilegeNumberApplicant": doCreateCarrierPrivilegeNumberApplicant,
|
2657
|
+
"DescribeActiveCarrierPrivilegeNumber": doDescribeActiveCarrierPrivilegeNumber,
|
2187
2658
|
"DescribeChatMessages": doDescribeChatMessages,
|
2188
2659
|
"DescribeCCCBuyInfoList": doDescribeCCCBuyInfoList,
|
2660
|
+
"DescribeCarrierPrivilegeNumberApplicants": doDescribeCarrierPrivilegeNumberApplicants,
|
2189
2661
|
"CreateCCCSkillGroup": doCreateCCCSkillGroup,
|
2190
2662
|
"UnbindStaffSkillGroupList": doUnbindStaffSkillGroupList,
|
2191
2663
|
"DisableCCCPhoneNumber": doDisableCCCPhoneNumber,
|
@@ -2194,13 +2666,18 @@ ACTION_MAP = {
|
|
2194
2666
|
"CreateAutoCalloutTask": doCreateAutoCalloutTask,
|
2195
2667
|
"ModifyExtension": doModifyExtension,
|
2196
2668
|
"CreateUserSig": doCreateUserSig,
|
2669
|
+
"HangUpCall": doHangUpCall,
|
2670
|
+
"PausePredictiveDialingCampaign": doPausePredictiveDialingCampaign,
|
2197
2671
|
"CreateAdminURL": doCreateAdminURL,
|
2198
2672
|
"DescribeProtectedTelCdr": doDescribeProtectedTelCdr,
|
2199
2673
|
"DescribeIMCdrList": doDescribeIMCdrList,
|
2200
2674
|
"DescribeCallInMetrics": doDescribeCallInMetrics,
|
2201
2675
|
"DescribeTelCdr": doDescribeTelCdr,
|
2202
|
-
"
|
2676
|
+
"CreateSDKLoginToken": doCreateSDKLoginToken,
|
2203
2677
|
"DescribeNumbers": doDescribeNumbers,
|
2678
|
+
"AbortPredictiveDialingCampaign": doAbortPredictiveDialingCampaign,
|
2679
|
+
"DeletePredictiveDialingCampaign": doDeletePredictiveDialingCampaign,
|
2680
|
+
"UpdatePredictiveDialingCampaign": doUpdatePredictiveDialingCampaign,
|
2204
2681
|
|
2205
2682
|
}
|
2206
2683
|
|