tccli 3.0.1217.1__py2.py3-none-any.whl → 3.0.1219.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/command.py +0 -1
- tccli/configure.py +11 -1
- tccli/services/__init__.py +3 -0
- tccli/services/aa/aa_client.py +13 -1
- tccli/services/aai/aai_client.py +13 -1
- tccli/services/acp/acp_client.py +13 -1
- tccli/services/advisor/advisor_client.py +13 -1
- tccli/services/af/af_client.py +13 -1
- tccli/services/af/v20200226/api.json +2 -2
- tccli/services/afc/afc_client.py +13 -1
- tccli/services/aiart/aiart_client.py +13 -1
- tccli/services/ame/ame_client.py +13 -1
- tccli/services/ams/ams_client.py +13 -1
- tccli/services/anicloud/anicloud_client.py +13 -1
- tccli/services/antiddos/antiddos_client.py +13 -1
- tccli/services/apcas/apcas_client.py +13 -1
- tccli/services/ape/ape_client.py +13 -1
- tccli/services/api/api_client.py +13 -1
- tccli/services/apigateway/apigateway_client.py +13 -1
- tccli/services/apm/apm_client.py +13 -1
- tccli/services/asr/asr_client.py +13 -1
- tccli/services/asw/asw_client.py +13 -1
- tccli/services/autoscaling/autoscaling_client.py +13 -1
- tccli/services/ba/ba_client.py +13 -1
- tccli/services/batch/batch_client.py +13 -1
- tccli/services/bda/bda_client.py +13 -1
- tccli/services/bh/bh_client.py +13 -1
- tccli/services/bi/bi_client.py +13 -1
- tccli/services/billing/billing_client.py +13 -1
- tccli/services/billing/v20180709/api.json +176 -181
- tccli/services/billing/v20180709/examples.json +7 -7
- tccli/services/bizlive/bizlive_client.py +13 -1
- tccli/services/bm/bm_client.py +13 -1
- tccli/services/bma/bma_client.py +13 -1
- tccli/services/bmeip/bmeip_client.py +13 -1
- tccli/services/bmlb/bmlb_client.py +13 -1
- tccli/services/bmvpc/bmvpc_client.py +13 -1
- tccli/services/bpaas/bpaas_client.py +13 -1
- tccli/services/bri/bri_client.py +13 -1
- tccli/services/bsca/bsca_client.py +13 -1
- tccli/services/btoe/btoe_client.py +13 -1
- tccli/services/ca/ca_client.py +13 -1
- tccli/services/cam/cam_client.py +13 -1
- tccli/services/captcha/captcha_client.py +13 -1
- tccli/services/car/car_client.py +13 -1
- tccli/services/cat/cat_client.py +13 -1
- tccli/services/cbs/cbs_client.py +13 -1
- tccli/services/ccc/ccc_client.py +13 -1
- tccli/services/cdb/cdb_client.py +13 -1
- tccli/services/cdc/cdc_client.py +13 -1
- tccli/services/cdn/cdn_client.py +13 -1
- tccli/services/cds/cds_client.py +13 -1
- tccli/services/cdwch/cdwch_client.py +13 -1
- tccli/services/cdwdoris/cdwdoris_client.py +13 -1
- tccli/services/cdwpg/cdwpg_client.py +13 -1
- tccli/services/cdz/cdz_client.py +13 -1
- tccli/services/cfg/cfg_client.py +13 -1
- tccli/services/cfs/cfs_client.py +13 -1
- tccli/services/cfw/cfw_client.py +13 -1
- tccli/services/chdfs/chdfs_client.py +13 -1
- tccli/services/ciam/ciam_client.py +13 -1
- tccli/services/cii/cii_client.py +13 -1
- tccli/services/cim/cim_client.py +13 -1
- tccli/services/cis/cis_client.py +13 -1
- tccli/services/ckafka/ckafka_client.py +13 -1
- tccli/services/ckafka/v20190819/api.json +7 -7
- tccli/services/clb/clb_client.py +13 -1
- tccli/services/clb/v20180317/api.json +12 -12
- tccli/services/cloudapp/cloudapp_client.py +13 -1
- tccli/services/cloudaudit/cloudaudit_client.py +13 -1
- tccli/services/cloudhsm/cloudhsm_client.py +13 -1
- tccli/services/cloudstudio/cloudstudio_client.py +13 -1
- tccli/services/cls/cls_client.py +13 -1
- tccli/services/cme/cme_client.py +13 -1
- tccli/services/cmq/cmq_client.py +13 -1
- tccli/services/cms/cms_client.py +13 -1
- tccli/services/config/config_client.py +13 -1
- tccli/services/controlcenter/controlcenter_client.py +13 -1
- tccli/services/cpdp/cpdp_client.py +13 -1
- tccli/services/csip/csip_client.py +13 -1
- tccli/services/csxg/csxg_client.py +13 -1
- tccli/services/cvm/cvm_client.py +13 -1
- tccli/services/cwp/cwp_client.py +13 -1
- tccli/services/cwp/v20180228/api.json +1 -1
- tccli/services/cws/cws_client.py +13 -1
- tccli/services/cynosdb/cynosdb_client.py +13 -1
- tccli/services/dasb/dasb_client.py +13 -1
- tccli/services/dataintegration/dataintegration_client.py +13 -1
- tccli/services/dayu/dayu_client.py +13 -1
- tccli/services/dbbrain/dbbrain_client.py +13 -1
- tccli/services/dbdc/dbdc_client.py +13 -1
- tccli/services/dc/dc_client.py +13 -1
- tccli/services/dcdb/dcdb_client.py +13 -1
- tccli/services/dlc/dlc_client.py +13 -1
- tccli/services/dnspod/dnspod_client.py +13 -1
- tccli/services/domain/domain_client.py +13 -1
- tccli/services/drm/drm_client.py +13 -1
- tccli/services/ds/ds_client.py +13 -1
- tccli/services/dsgc/dsgc_client.py +13 -1
- tccli/services/dtf/dtf_client.py +13 -1
- tccli/services/dts/dts_client.py +13 -1
- tccli/services/eb/eb_client.py +13 -1
- tccli/services/ecc/ecc_client.py +13 -1
- tccli/services/ecdn/ecdn_client.py +13 -1
- tccli/services/ecm/ecm_client.py +13 -1
- tccli/services/eiam/eiam_client.py +13 -1
- tccli/services/eis/eis_client.py +13 -1
- tccli/services/emr/emr_client.py +13 -1
- tccli/services/es/es_client.py +13 -1
- tccli/services/es/v20180416/examples.json +2 -2
- tccli/services/ess/ess_client.py +13 -1
- tccli/services/ess/v20201111/api.json +9 -0
- tccli/services/essbasic/essbasic_client.py +13 -1
- tccli/services/essbasic/v20210526/api.json +9 -0
- tccli/services/facefusion/facefusion_client.py +13 -1
- tccli/services/faceid/faceid_client.py +13 -1
- tccli/services/faceid/v20180301/api.json +2 -2
- tccli/services/fmu/fmu_client.py +13 -1
- tccli/services/ft/ft_client.py +13 -1
- tccli/services/gaap/gaap_client.py +13 -1
- tccli/services/gme/gme_client.py +13 -1
- tccli/services/goosefs/goosefs_client.py +13 -1
- tccli/services/gpm/gpm_client.py +13 -1
- tccli/services/gs/gs_client.py +13 -1
- tccli/services/gse/gse_client.py +13 -1
- tccli/services/gwlb/gwlb_client.py +13 -1
- tccli/services/habo/habo_client.py +13 -1
- tccli/services/hai/hai_client.py +13 -1
- tccli/services/hasim/hasim_client.py +13 -1
- tccli/services/hcm/hcm_client.py +13 -1
- tccli/services/hunyuan/hunyuan_client.py +13 -1
- tccli/services/iai/iai_client.py +13 -1
- tccli/services/iai/v20180301/api.json +17 -13
- tccli/services/iai/v20200303/examples.json +200 -200
- tccli/services/iap/__init__.py +4 -0
- tccli/services/iap/iap_client.py +472 -0
- tccli/services/iap/v20240713/api.json +471 -0
- tccli/services/iap/v20240713/examples.json +59 -0
- tccli/services/ic/ic_client.py +13 -1
- tccli/services/icr/icr_client.py +13 -1
- tccli/services/ie/ie_client.py +13 -1
- tccli/services/iecp/iecp_client.py +13 -1
- tccli/services/ig/ig_client.py +13 -1
- tccli/services/iir/iir_client.py +13 -1
- tccli/services/ims/ims_client.py +13 -1
- tccli/services/ioa/ioa_client.py +13 -1
- tccli/services/iot/iot_client.py +13 -1
- tccli/services/iotcloud/iotcloud_client.py +13 -1
- tccli/services/iotexplorer/iotexplorer_client.py +13 -1
- tccli/services/iottid/iottid_client.py +13 -1
- tccli/services/iotvideo/iotvideo_client.py +13 -1
- tccli/services/iotvideoindustry/iotvideoindustry_client.py +13 -1
- tccli/services/irp/irp_client.py +13 -1
- tccli/services/iss/iss_client.py +13 -1
- tccli/services/ivld/ivld_client.py +13 -1
- tccli/services/keewidb/keewidb_client.py +13 -1
- tccli/services/kms/kms_client.py +13 -1
- tccli/services/lcic/lcic_client.py +13 -1
- tccli/services/lcic/v20220817/api.json +3 -3
- tccli/services/lighthouse/lighthouse_client.py +13 -1
- tccli/services/live/live_client.py +441 -5
- tccli/services/live/v20180801/api.json +1070 -68
- tccli/services/live/v20180801/examples.json +64 -0
- tccli/services/lke/lke_client.py +13 -1
- tccli/services/lowcode/lowcode_client.py +13 -1
- tccli/services/lp/lp_client.py +13 -1
- tccli/services/mall/mall_client.py +13 -1
- tccli/services/mariadb/mariadb_client.py +13 -1
- tccli/services/market/market_client.py +13 -1
- tccli/services/market/v20191010/api.json +4 -4
- tccli/services/market/v20191010/examples.json +2 -2
- tccli/services/memcached/memcached_client.py +13 -1
- tccli/services/mgobe/mgobe_client.py +13 -1
- tccli/services/mmps/mmps_client.py +13 -1
- tccli/services/mna/mna_client.py +13 -1
- tccli/services/mongodb/mongodb_client.py +13 -1
- tccli/services/monitor/monitor_client.py +13 -1
- tccli/services/mps/mps_client.py +13 -1
- tccli/services/mps/v20190612/api.json +20 -0
- tccli/services/mqtt/mqtt_client.py +13 -1
- tccli/services/mrs/mrs_client.py +13 -1
- tccli/services/ms/ms_client.py +13 -1
- tccli/services/msp/msp_client.py +13 -1
- tccli/services/mvj/mvj_client.py +13 -1
- tccli/services/nlp/nlp_client.py +13 -1
- tccli/services/npp/npp_client.py +13 -1
- tccli/services/oceanus/oceanus_client.py +13 -1
- tccli/services/ocr/ocr_client.py +13 -1
- tccli/services/omics/omics_client.py +13 -1
- tccli/services/organization/organization_client.py +13 -1
- tccli/services/partners/partners_client.py +13 -1
- tccli/services/partners/v20180321/api.json +4 -4
- tccli/services/pds/pds_client.py +13 -1
- tccli/services/postgres/postgres_client.py +13 -1
- tccli/services/privatedns/privatedns_client.py +13 -1
- tccli/services/pts/pts_client.py +13 -1
- tccli/services/pts/v20210728/api.json +3 -0
- tccli/services/rce/rce_client.py +13 -1
- tccli/services/redis/redis_client.py +13 -1
- tccli/services/redis/v20180412/api.json +169 -163
- tccli/services/redis/v20180412/examples.json +3 -3
- tccli/services/region/region_client.py +13 -1
- tccli/services/rkp/rkp_client.py +13 -1
- tccli/services/rp/rp_client.py +13 -1
- tccli/services/rum/rum_client.py +13 -1
- tccli/services/scf/scf_client.py +13 -1
- tccli/services/ses/ses_client.py +13 -1
- tccli/services/smh/smh_client.py +13 -1
- tccli/services/smop/smop_client.py +13 -1
- tccli/services/smpn/smpn_client.py +13 -1
- tccli/services/sms/sms_client.py +13 -1
- tccli/services/soe/soe_client.py +13 -1
- tccli/services/solar/solar_client.py +13 -1
- tccli/services/sqlserver/sqlserver_client.py +13 -1
- tccli/services/ssa/ssa_client.py +13 -1
- tccli/services/ssl/ssl_client.py +13 -1
- tccli/services/sslpod/sslpod_client.py +13 -1
- tccli/services/ssm/ssm_client.py +13 -1
- tccli/services/sts/sts_client.py +13 -1
- tccli/services/svp/svp_client.py +13 -1
- tccli/services/svp/v20240125/api.json +27 -27
- tccli/services/svp/v20240125/examples.json +1 -1
- tccli/services/taf/taf_client.py +13 -1
- tccli/services/tag/tag_client.py +13 -1
- tccli/services/tan/tan_client.py +13 -1
- tccli/services/tat/tat_client.py +13 -1
- tccli/services/tat/v20201028/api.json +5 -5
- tccli/services/tav/tav_client.py +13 -1
- tccli/services/tbaas/tbaas_client.py +13 -1
- tccli/services/tbm/tbm_client.py +13 -1
- tccli/services/tbp/tbp_client.py +13 -1
- tccli/services/tcaplusdb/tcaplusdb_client.py +13 -1
- tccli/services/tcb/tcb_client.py +13 -1
- tccli/services/tcbr/tcbr_client.py +13 -1
- tccli/services/tcex/tcex_client.py +13 -1
- tccli/services/tchd/tchd_client.py +13 -1
- tccli/services/tci/tci_client.py +13 -1
- tccli/services/tcm/tcm_client.py +13 -1
- tccli/services/tcr/tcr_client.py +13 -1
- tccli/services/tcss/tcss_client.py +13 -1
- tccli/services/tdcpg/tdcpg_client.py +13 -1
- tccli/services/tdid/tdid_client.py +13 -1
- tccli/services/tdmq/tdmq_client.py +13 -1
- tccli/services/tdmq/v20200217/api.json +1 -1
- tccli/services/tds/tds_client.py +13 -1
- tccli/services/tem/tem_client.py +13 -1
- tccli/services/teo/teo_client.py +13 -1
- tccli/services/thpc/thpc_client.py +13 -1
- tccli/services/tia/tia_client.py +13 -1
- tccli/services/tic/tic_client.py +13 -1
- tccli/services/ticm/ticm_client.py +13 -1
- tccli/services/tics/tics_client.py +13 -1
- tccli/services/tiems/tiems_client.py +13 -1
- tccli/services/tiia/tiia_client.py +13 -1
- tccli/services/tione/tione_client.py +13 -1
- tccli/services/tiw/tiw_client.py +13 -1
- tccli/services/tke/tke_client.py +13 -1
- tccli/services/tke/v20220501/api.json +2 -2
- tccli/services/tkgdq/tkgdq_client.py +13 -1
- tccli/services/tms/tms_client.py +13 -1
- tccli/services/tmt/tmt_client.py +13 -1
- tccli/services/tourism/tourism_client.py +13 -1
- tccli/services/trdp/trdp_client.py +13 -1
- tccli/services/trocket/trocket_client.py +13 -1
- tccli/services/trp/trp_client.py +13 -1
- tccli/services/trro/trro_client.py +13 -1
- tccli/services/trtc/trtc_client.py +13 -1
- tccli/services/tse/tse_client.py +13 -1
- tccli/services/tse/v20201207/api.json +199 -12
- tccli/services/tsf/tsf_client.py +13 -1
- tccli/services/tsi/tsi_client.py +13 -1
- tccli/services/tsw/tsw_client.py +13 -1
- tccli/services/tts/tts_client.py +13 -1
- tccli/services/ump/ump_client.py +13 -1
- tccli/services/vcg/v20240404/api.json +1 -1
- tccli/services/vcg/v20240404/examples.json +4 -4
- tccli/services/vcg/vcg_client.py +13 -1
- tccli/services/vclm/vclm_client.py +13 -1
- tccli/services/vdb/vdb_client.py +13 -1
- tccli/services/vm/vm_client.py +13 -1
- tccli/services/vms/vms_client.py +13 -1
- tccli/services/vod/vod_client.py +13 -1
- tccli/services/vpc/v20170312/api.json +492 -66
- tccli/services/vpc/v20170312/examples.json +59 -21
- tccli/services/vpc/vpc_client.py +225 -1
- tccli/services/vrs/vrs_client.py +13 -1
- tccli/services/vtc/vtc_client.py +13 -1
- tccli/services/waf/waf_client.py +13 -1
- tccli/services/wav/wav_client.py +13 -1
- tccli/services/wedata/wedata_client.py +13 -1
- tccli/services/weilingwith/weilingwith_client.py +13 -1
- tccli/services/wss/wss_client.py +13 -1
- tccli/services/yinsuda/yinsuda_client.py +13 -1
- tccli/services/youmall/youmall_client.py +13 -1
- tccli/services/yunjing/yunjing_client.py +13 -1
- tccli/services/yunsou/yunsou_client.py +13 -1
- tccli/utils.py +8 -0
- {tccli-3.0.1217.1.dist-info → tccli-3.0.1219.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1217.1.dist-info → tccli-3.0.1219.1.dist-info}/RECORD +303 -299
- {tccli-3.0.1217.1.dist-info → tccli-3.0.1219.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1217.1.dist-info → tccli-3.0.1219.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1217.1.dist-info → tccli-3.0.1219.1.dist-info}/license_files/LICENSE +0 -0
@@ -1161,6 +1161,58 @@ def doDescribeLiveDomainReferer(args, parsed_globals):
|
|
1161
1161
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1162
1162
|
|
1163
1163
|
|
1164
|
+
def doDeleteScreenshotTask(args, parsed_globals):
|
1165
|
+
g_param = parse_global_arg(parsed_globals)
|
1166
|
+
|
1167
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1168
|
+
cred = credential.CVMRoleCredential()
|
1169
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1170
|
+
cred = credential.STSAssumeRoleCredential(
|
1171
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1172
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1173
|
+
)
|
1174
|
+
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):
|
1175
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1176
|
+
else:
|
1177
|
+
cred = credential.Credential(
|
1178
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1179
|
+
)
|
1180
|
+
http_profile = HttpProfile(
|
1181
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1182
|
+
reqMethod="POST",
|
1183
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1184
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1185
|
+
)
|
1186
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1187
|
+
if g_param[OptionsDefine.Language]:
|
1188
|
+
profile.language = g_param[OptionsDefine.Language]
|
1189
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1190
|
+
client = mod.LiveClient(cred, g_param[OptionsDefine.Region], profile)
|
1191
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1192
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1193
|
+
model = models.DeleteScreenshotTaskRequest()
|
1194
|
+
model.from_json_string(json.dumps(args))
|
1195
|
+
start_time = time.time()
|
1196
|
+
while True:
|
1197
|
+
rsp = client.DeleteScreenshotTask(model)
|
1198
|
+
result = rsp.to_json_string()
|
1199
|
+
try:
|
1200
|
+
json_obj = json.loads(result)
|
1201
|
+
except TypeError as e:
|
1202
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1203
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1204
|
+
break
|
1205
|
+
cur_time = time.time()
|
1206
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1207
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1208
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1209
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1210
|
+
else:
|
1211
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1212
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1213
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1214
|
+
|
1215
|
+
|
1164
1216
|
def doDescribeTopClientIpSumInfoList(args, parsed_globals):
|
1165
1217
|
g_param = parse_global_arg(parsed_globals)
|
1166
1218
|
|
@@ -2149,6 +2201,58 @@ def doDeleteLiveCallbackTemplate(args, parsed_globals):
|
|
2149
2201
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2150
2202
|
|
2151
2203
|
|
2204
|
+
def doDescribeCasterPlayUrl(args, parsed_globals):
|
2205
|
+
g_param = parse_global_arg(parsed_globals)
|
2206
|
+
|
2207
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2208
|
+
cred = credential.CVMRoleCredential()
|
2209
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2210
|
+
cred = credential.STSAssumeRoleCredential(
|
2211
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2212
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2213
|
+
)
|
2214
|
+
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):
|
2215
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2216
|
+
else:
|
2217
|
+
cred = credential.Credential(
|
2218
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2219
|
+
)
|
2220
|
+
http_profile = HttpProfile(
|
2221
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2222
|
+
reqMethod="POST",
|
2223
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2224
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2225
|
+
)
|
2226
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2227
|
+
if g_param[OptionsDefine.Language]:
|
2228
|
+
profile.language = g_param[OptionsDefine.Language]
|
2229
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2230
|
+
client = mod.LiveClient(cred, g_param[OptionsDefine.Region], profile)
|
2231
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2232
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2233
|
+
model = models.DescribeCasterPlayUrlRequest()
|
2234
|
+
model.from_json_string(json.dumps(args))
|
2235
|
+
start_time = time.time()
|
2236
|
+
while True:
|
2237
|
+
rsp = client.DescribeCasterPlayUrl(model)
|
2238
|
+
result = rsp.to_json_string()
|
2239
|
+
try:
|
2240
|
+
json_obj = json.loads(result)
|
2241
|
+
except TypeError as e:
|
2242
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2243
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2244
|
+
break
|
2245
|
+
cur_time = time.time()
|
2246
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2247
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2248
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2249
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2250
|
+
else:
|
2251
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2252
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2253
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2254
|
+
|
2255
|
+
|
2152
2256
|
def doDescribeLivePushAuthKey(args, parsed_globals):
|
2153
2257
|
g_param = parse_global_arg(parsed_globals)
|
2154
2258
|
|
@@ -2669,6 +2773,58 @@ def doDeleteLiveWatermark(args, parsed_globals):
|
|
2669
2773
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2670
2774
|
|
2671
2775
|
|
2776
|
+
def doModifyCaster(args, parsed_globals):
|
2777
|
+
g_param = parse_global_arg(parsed_globals)
|
2778
|
+
|
2779
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2780
|
+
cred = credential.CVMRoleCredential()
|
2781
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2782
|
+
cred = credential.STSAssumeRoleCredential(
|
2783
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2784
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2785
|
+
)
|
2786
|
+
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):
|
2787
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2788
|
+
else:
|
2789
|
+
cred = credential.Credential(
|
2790
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2791
|
+
)
|
2792
|
+
http_profile = HttpProfile(
|
2793
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2794
|
+
reqMethod="POST",
|
2795
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2796
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2797
|
+
)
|
2798
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2799
|
+
if g_param[OptionsDefine.Language]:
|
2800
|
+
profile.language = g_param[OptionsDefine.Language]
|
2801
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2802
|
+
client = mod.LiveClient(cred, g_param[OptionsDefine.Region], profile)
|
2803
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2804
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2805
|
+
model = models.ModifyCasterRequest()
|
2806
|
+
model.from_json_string(json.dumps(args))
|
2807
|
+
start_time = time.time()
|
2808
|
+
while True:
|
2809
|
+
rsp = client.ModifyCaster(model)
|
2810
|
+
result = rsp.to_json_string()
|
2811
|
+
try:
|
2812
|
+
json_obj = json.loads(result)
|
2813
|
+
except TypeError as e:
|
2814
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2815
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2816
|
+
break
|
2817
|
+
cur_time = time.time()
|
2818
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2819
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2820
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2821
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2822
|
+
else:
|
2823
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2824
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2825
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2826
|
+
|
2827
|
+
|
2672
2828
|
def doDescribeLiveDomainCertBindings(args, parsed_globals):
|
2673
2829
|
g_param = parse_global_arg(parsed_globals)
|
2674
2830
|
|
@@ -4593,6 +4749,58 @@ def doModifyLivePlayAuthKey(args, parsed_globals):
|
|
4593
4749
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4594
4750
|
|
4595
4751
|
|
4752
|
+
def doDeleteCaster(args, parsed_globals):
|
4753
|
+
g_param = parse_global_arg(parsed_globals)
|
4754
|
+
|
4755
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
4756
|
+
cred = credential.CVMRoleCredential()
|
4757
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
4758
|
+
cred = credential.STSAssumeRoleCredential(
|
4759
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
4760
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
4761
|
+
)
|
4762
|
+
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):
|
4763
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
4764
|
+
else:
|
4765
|
+
cred = credential.Credential(
|
4766
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
4767
|
+
)
|
4768
|
+
http_profile = HttpProfile(
|
4769
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
4770
|
+
reqMethod="POST",
|
4771
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
4772
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
4773
|
+
)
|
4774
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
4775
|
+
if g_param[OptionsDefine.Language]:
|
4776
|
+
profile.language = g_param[OptionsDefine.Language]
|
4777
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
4778
|
+
client = mod.LiveClient(cred, g_param[OptionsDefine.Region], profile)
|
4779
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
4780
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
4781
|
+
model = models.DeleteCasterRequest()
|
4782
|
+
model.from_json_string(json.dumps(args))
|
4783
|
+
start_time = time.time()
|
4784
|
+
while True:
|
4785
|
+
rsp = client.DeleteCaster(model)
|
4786
|
+
result = rsp.to_json_string()
|
4787
|
+
try:
|
4788
|
+
json_obj = json.loads(result)
|
4789
|
+
except TypeError as e:
|
4790
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
4791
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
4792
|
+
break
|
4793
|
+
cur_time = time.time()
|
4794
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
4795
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
4796
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
4797
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
4798
|
+
else:
|
4799
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
4800
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
4801
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4802
|
+
|
4803
|
+
|
4596
4804
|
def doDescribeLiveTranscodeTemplate(args, parsed_globals):
|
4597
4805
|
g_param = parse_global_arg(parsed_globals)
|
4598
4806
|
|
@@ -5789,7 +5997,7 @@ def doDescribeLiveCallbackTemplate(args, parsed_globals):
|
|
5789
5997
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
5790
5998
|
|
5791
5999
|
|
5792
|
-
def
|
6000
|
+
def doDescribeLiveTimeShiftWriteSizeInfoList(args, parsed_globals):
|
5793
6001
|
g_param = parse_global_arg(parsed_globals)
|
5794
6002
|
|
5795
6003
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -5818,11 +6026,11 @@ def doDeleteScreenshotTask(args, parsed_globals):
|
|
5818
6026
|
client = mod.LiveClient(cred, g_param[OptionsDefine.Region], profile)
|
5819
6027
|
client._sdkVersion += ("_CLI_" + __version__)
|
5820
6028
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
5821
|
-
model = models.
|
6029
|
+
model = models.DescribeLiveTimeShiftWriteSizeInfoListRequest()
|
5822
6030
|
model.from_json_string(json.dumps(args))
|
5823
6031
|
start_time = time.time()
|
5824
6032
|
while True:
|
5825
|
-
rsp = client.
|
6033
|
+
rsp = client.DescribeLiveTimeShiftWriteSizeInfoList(model)
|
5826
6034
|
result = rsp.to_json_string()
|
5827
6035
|
try:
|
5828
6036
|
json_obj = json.loads(result)
|
@@ -7089,6 +7297,58 @@ def doDeleteLiveStreamMonitor(args, parsed_globals):
|
|
7089
7297
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
7090
7298
|
|
7091
7299
|
|
7300
|
+
def doDescribeCaster(args, parsed_globals):
|
7301
|
+
g_param = parse_global_arg(parsed_globals)
|
7302
|
+
|
7303
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
7304
|
+
cred = credential.CVMRoleCredential()
|
7305
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
7306
|
+
cred = credential.STSAssumeRoleCredential(
|
7307
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
7308
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
7309
|
+
)
|
7310
|
+
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):
|
7311
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
7312
|
+
else:
|
7313
|
+
cred = credential.Credential(
|
7314
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
7315
|
+
)
|
7316
|
+
http_profile = HttpProfile(
|
7317
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
7318
|
+
reqMethod="POST",
|
7319
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
7320
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
7321
|
+
)
|
7322
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
7323
|
+
if g_param[OptionsDefine.Language]:
|
7324
|
+
profile.language = g_param[OptionsDefine.Language]
|
7325
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
7326
|
+
client = mod.LiveClient(cred, g_param[OptionsDefine.Region], profile)
|
7327
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
7328
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
7329
|
+
model = models.DescribeCasterRequest()
|
7330
|
+
model.from_json_string(json.dumps(args))
|
7331
|
+
start_time = time.time()
|
7332
|
+
while True:
|
7333
|
+
rsp = client.DescribeCaster(model)
|
7334
|
+
result = rsp.to_json_string()
|
7335
|
+
try:
|
7336
|
+
json_obj = json.loads(result)
|
7337
|
+
except TypeError as e:
|
7338
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
7339
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
7340
|
+
break
|
7341
|
+
cur_time = time.time()
|
7342
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
7343
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
7344
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
7345
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
7346
|
+
else:
|
7347
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
7348
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
7349
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
7350
|
+
|
7351
|
+
|
7092
7352
|
def doDeleteLiveTimeShiftTemplate(args, parsed_globals):
|
7093
7353
|
g_param = parse_global_arg(parsed_globals)
|
7094
7354
|
|
@@ -7349,6 +7609,58 @@ def doDescribeCasterTransitionTypes(args, parsed_globals):
|
|
7349
7609
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
7350
7610
|
|
7351
7611
|
|
7612
|
+
def doDescribeCasterDisplayInfo(args, parsed_globals):
|
7613
|
+
g_param = parse_global_arg(parsed_globals)
|
7614
|
+
|
7615
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
7616
|
+
cred = credential.CVMRoleCredential()
|
7617
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
7618
|
+
cred = credential.STSAssumeRoleCredential(
|
7619
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
7620
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
7621
|
+
)
|
7622
|
+
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):
|
7623
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
7624
|
+
else:
|
7625
|
+
cred = credential.Credential(
|
7626
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
7627
|
+
)
|
7628
|
+
http_profile = HttpProfile(
|
7629
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
7630
|
+
reqMethod="POST",
|
7631
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
7632
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
7633
|
+
)
|
7634
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
7635
|
+
if g_param[OptionsDefine.Language]:
|
7636
|
+
profile.language = g_param[OptionsDefine.Language]
|
7637
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
7638
|
+
client = mod.LiveClient(cred, g_param[OptionsDefine.Region], profile)
|
7639
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
7640
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
7641
|
+
model = models.DescribeCasterDisplayInfoRequest()
|
7642
|
+
model.from_json_string(json.dumps(args))
|
7643
|
+
start_time = time.time()
|
7644
|
+
while True:
|
7645
|
+
rsp = client.DescribeCasterDisplayInfo(model)
|
7646
|
+
result = rsp.to_json_string()
|
7647
|
+
try:
|
7648
|
+
json_obj = json.loads(result)
|
7649
|
+
except TypeError as e:
|
7650
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
7651
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
7652
|
+
break
|
7653
|
+
cur_time = time.time()
|
7654
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
7655
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
7656
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
7657
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
7658
|
+
else:
|
7659
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
7660
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
7661
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
7662
|
+
|
7663
|
+
|
7352
7664
|
def doStopLiveStreamMonitor(args, parsed_globals):
|
7353
7665
|
g_param = parse_global_arg(parsed_globals)
|
7354
7666
|
|
@@ -7401,6 +7713,58 @@ def doStopLiveStreamMonitor(args, parsed_globals):
|
|
7401
7713
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
7402
7714
|
|
7403
7715
|
|
7716
|
+
def doCreateCaster(args, parsed_globals):
|
7717
|
+
g_param = parse_global_arg(parsed_globals)
|
7718
|
+
|
7719
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
7720
|
+
cred = credential.CVMRoleCredential()
|
7721
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
7722
|
+
cred = credential.STSAssumeRoleCredential(
|
7723
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
7724
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
7725
|
+
)
|
7726
|
+
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):
|
7727
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
7728
|
+
else:
|
7729
|
+
cred = credential.Credential(
|
7730
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
7731
|
+
)
|
7732
|
+
http_profile = HttpProfile(
|
7733
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
7734
|
+
reqMethod="POST",
|
7735
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
7736
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
7737
|
+
)
|
7738
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
7739
|
+
if g_param[OptionsDefine.Language]:
|
7740
|
+
profile.language = g_param[OptionsDefine.Language]
|
7741
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
7742
|
+
client = mod.LiveClient(cred, g_param[OptionsDefine.Region], profile)
|
7743
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
7744
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
7745
|
+
model = models.CreateCasterRequest()
|
7746
|
+
model.from_json_string(json.dumps(args))
|
7747
|
+
start_time = time.time()
|
7748
|
+
while True:
|
7749
|
+
rsp = client.CreateCaster(model)
|
7750
|
+
result = rsp.to_json_string()
|
7751
|
+
try:
|
7752
|
+
json_obj = json.loads(result)
|
7753
|
+
except TypeError as e:
|
7754
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
7755
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
7756
|
+
break
|
7757
|
+
cur_time = time.time()
|
7758
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
7759
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
7760
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
7761
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
7762
|
+
else:
|
7763
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
7764
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
7765
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
7766
|
+
|
7767
|
+
|
7404
7768
|
def doDescribeLiveStreamState(args, parsed_globals):
|
7405
7769
|
g_param = parse_global_arg(parsed_globals)
|
7406
7770
|
|
@@ -7557,6 +7921,58 @@ def doDeleteLiveRecordTemplate(args, parsed_globals):
|
|
7557
7921
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
7558
7922
|
|
7559
7923
|
|
7924
|
+
def doCopyCaster(args, parsed_globals):
|
7925
|
+
g_param = parse_global_arg(parsed_globals)
|
7926
|
+
|
7927
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
7928
|
+
cred = credential.CVMRoleCredential()
|
7929
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
7930
|
+
cred = credential.STSAssumeRoleCredential(
|
7931
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
7932
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
7933
|
+
)
|
7934
|
+
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):
|
7935
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
7936
|
+
else:
|
7937
|
+
cred = credential.Credential(
|
7938
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
7939
|
+
)
|
7940
|
+
http_profile = HttpProfile(
|
7941
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
7942
|
+
reqMethod="POST",
|
7943
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
7944
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
7945
|
+
)
|
7946
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
7947
|
+
if g_param[OptionsDefine.Language]:
|
7948
|
+
profile.language = g_param[OptionsDefine.Language]
|
7949
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
7950
|
+
client = mod.LiveClient(cred, g_param[OptionsDefine.Region], profile)
|
7951
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
7952
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
7953
|
+
model = models.CopyCasterRequest()
|
7954
|
+
model.from_json_string(json.dumps(args))
|
7955
|
+
start_time = time.time()
|
7956
|
+
while True:
|
7957
|
+
rsp = client.CopyCaster(model)
|
7958
|
+
result = rsp.to_json_string()
|
7959
|
+
try:
|
7960
|
+
json_obj = json.loads(result)
|
7961
|
+
except TypeError as e:
|
7962
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
7963
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
7964
|
+
break
|
7965
|
+
cur_time = time.time()
|
7966
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
7967
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
7968
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
7969
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
7970
|
+
else:
|
7971
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
7972
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
7973
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
7974
|
+
|
7975
|
+
|
7560
7976
|
def doDescribeBackupStreamList(args, parsed_globals):
|
7561
7977
|
g_param = parse_global_arg(parsed_globals)
|
7562
7978
|
|
@@ -8318,6 +8734,7 @@ ACTION_MAP = {
|
|
8318
8734
|
"CreateLivePadTemplate": doCreateLivePadTemplate,
|
8319
8735
|
"CreateLiveStreamMonitor": doCreateLiveStreamMonitor,
|
8320
8736
|
"DescribeLiveDomainReferer": doDescribeLiveDomainReferer,
|
8737
|
+
"DeleteScreenshotTask": doDeleteScreenshotTask,
|
8321
8738
|
"DescribeTopClientIpSumInfoList": doDescribeTopClientIpSumInfoList,
|
8322
8739
|
"ModifyPullStreamStatus": doModifyPullStreamStatus,
|
8323
8740
|
"CreateScreenshotTask": doCreateScreenshotTask,
|
@@ -8337,6 +8754,7 @@ ACTION_MAP = {
|
|
8337
8754
|
"DescribeLiveStreamOnlineList": doDescribeLiveStreamOnlineList,
|
8338
8755
|
"EnableOptimalSwitching": doEnableOptimalSwitching,
|
8339
8756
|
"DeleteLiveCallbackTemplate": doDeleteLiveCallbackTemplate,
|
8757
|
+
"DescribeCasterPlayUrl": doDescribeCasterPlayUrl,
|
8340
8758
|
"DescribeLivePushAuthKey": doDescribeLivePushAuthKey,
|
8341
8759
|
"DeletePullStreamConfig": doDeletePullStreamConfig,
|
8342
8760
|
"DescribeTimeShiftRecordDetail": doDescribeTimeShiftRecordDetail,
|
@@ -8347,6 +8765,7 @@ ACTION_MAP = {
|
|
8347
8765
|
"CreateCommonMixStream": doCreateCommonMixStream,
|
8348
8766
|
"DescribeLiveStreamMonitor": doDescribeLiveStreamMonitor,
|
8349
8767
|
"DeleteLiveWatermark": doDeleteLiveWatermark,
|
8768
|
+
"ModifyCaster": doModifyCaster,
|
8350
8769
|
"DescribeLiveDomainCertBindings": doDescribeLiveDomainCertBindings,
|
8351
8770
|
"DescribePlayErrorCodeSumInfoList": doDescribePlayErrorCodeSumInfoList,
|
8352
8771
|
"AddDelayLiveStream": doAddDelayLiveStream,
|
@@ -8384,6 +8803,7 @@ ACTION_MAP = {
|
|
8384
8803
|
"CreateLivePadRule": doCreateLivePadRule,
|
8385
8804
|
"StopLiveRecord": doStopLiveRecord,
|
8386
8805
|
"ModifyLivePlayAuthKey": doModifyLivePlayAuthKey,
|
8806
|
+
"DeleteCaster": doDeleteCaster,
|
8387
8807
|
"DescribeLiveTranscodeTemplate": doDescribeLiveTranscodeTemplate,
|
8388
8808
|
"DescribeScreenShotSheetNumList": doDescribeScreenShotSheetNumList,
|
8389
8809
|
"UnBindLiveDomainCert": doUnBindLiveDomainCert,
|
@@ -8407,7 +8827,7 @@ ACTION_MAP = {
|
|
8407
8827
|
"DescribeLivePadProcessorList": doDescribeLivePadProcessorList,
|
8408
8828
|
"DescribePushBandwidthAndFluxList": doDescribePushBandwidthAndFluxList,
|
8409
8829
|
"DescribeLiveCallbackTemplate": doDescribeLiveCallbackTemplate,
|
8410
|
-
"
|
8830
|
+
"DescribeLiveTimeShiftWriteSizeInfoList": doDescribeLiveTimeShiftWriteSizeInfoList,
|
8411
8831
|
"ForbidLiveStream": doForbidLiveStream,
|
8412
8832
|
"AddLiveDomain": doAddLiveDomain,
|
8413
8833
|
"DeleteLivePadTemplate": doDeleteLivePadTemplate,
|
@@ -8432,15 +8852,19 @@ ACTION_MAP = {
|
|
8432
8852
|
"CreateLiveSnapshotRule": doCreateLiveSnapshotRule,
|
8433
8853
|
"CreateLiveTimeShiftTemplate": doCreateLiveTimeShiftTemplate,
|
8434
8854
|
"DeleteLiveStreamMonitor": doDeleteLiveStreamMonitor,
|
8855
|
+
"DescribeCaster": doDescribeCaster,
|
8435
8856
|
"DeleteLiveTimeShiftTemplate": doDeleteLiveTimeShiftTemplate,
|
8436
8857
|
"DescribeProIspPlaySumInfoList": doDescribeProIspPlaySumInfoList,
|
8437
8858
|
"DescribeAllStreamPlayInfoList": doDescribeAllStreamPlayInfoList,
|
8438
8859
|
"DescribeLivePlayAuthKey": doDescribeLivePlayAuthKey,
|
8439
8860
|
"DescribeCasterTransitionTypes": doDescribeCasterTransitionTypes,
|
8861
|
+
"DescribeCasterDisplayInfo": doDescribeCasterDisplayInfo,
|
8440
8862
|
"StopLiveStreamMonitor": doStopLiveStreamMonitor,
|
8863
|
+
"CreateCaster": doCreateCaster,
|
8441
8864
|
"DescribeLiveStreamState": doDescribeLiveStreamState,
|
8442
8865
|
"ModifyLiveDomainReferer": doModifyLiveDomainReferer,
|
8443
8866
|
"DeleteLiveRecordTemplate": doDeleteLiveRecordTemplate,
|
8867
|
+
"CopyCaster": doCopyCaster,
|
8444
8868
|
"DescribeBackupStreamList": doDescribeBackupStreamList,
|
8445
8869
|
"ResumeDelayLiveStream": doResumeDelayLiveStream,
|
8446
8870
|
"CreateRecordTask": doCreateRecordTask,
|
@@ -8470,7 +8894,13 @@ def action_caller():
|
|
8470
8894
|
|
8471
8895
|
def parse_global_arg(parsed_globals):
|
8472
8896
|
g_param = parsed_globals
|
8473
|
-
|
8897
|
+
cvm_role_flag = True
|
8898
|
+
for param in parsed_globals.keys():
|
8899
|
+
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.RoleArn,
|
8900
|
+
OptionsDefine.RoleSessionName]:
|
8901
|
+
if parsed_globals[param] is not None:
|
8902
|
+
cvm_role_flag = False
|
8903
|
+
break
|
8474
8904
|
is_exist_profile = True
|
8475
8905
|
if not parsed_globals["profile"]:
|
8476
8906
|
is_exist_profile = False
|
@@ -8501,6 +8931,7 @@ def parse_global_arg(parsed_globals):
|
|
8501
8931
|
cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
|
8502
8932
|
cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
|
8503
8933
|
cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
|
8934
|
+
cvm_role_flag = False
|
8504
8935
|
|
8505
8936
|
if os.environ.get(OptionsDefine.ENV_REGION):
|
8506
8937
|
conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
|
@@ -8508,6 +8939,11 @@ def parse_global_arg(parsed_globals):
|
|
8508
8939
|
if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
|
8509
8940
|
cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
|
8510
8941
|
cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
|
8942
|
+
cvm_role_flag = False
|
8943
|
+
|
8944
|
+
if cvm_role_flag:
|
8945
|
+
if "type" in cred and cred["type"] == "cvm-role":
|
8946
|
+
g_param[OptionsDefine.UseCVMRole.replace('-', '_')] = True
|
8511
8947
|
|
8512
8948
|
for param in g_param.keys():
|
8513
8949
|
if g_param[param] is None:
|